Shaggi Posted March 19, 2012 Share Posted March 19, 2012 I don't think the OP will be too concerned, he hasn't been online in nearly 3 years, as this is a 5 year old topic brought back from the dead. Ah lol, didnt notice Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Link to comment Share on other sites More sharing options...
ValeryVal Posted March 19, 2012 Share Posted March 19, 2012 But how can we change a While statement like when you want to get gui msg like this one:Like this: ; A simple custom messagebox that uses the MessageLoop mode #include <GUIConstantsEx.au3> _Main() Func _Main() Local $YesID, $NoID, $ExitID, $msg GUICreate("Custom Msgbox", 210, 80) GUICtrlCreateLabel("Please click a button!", 10, 10) $YesID = GUICtrlCreateButton("Yes", 10, 50, 50, 20) $NoID = GUICtrlCreateButton("No", 80, 50, 50, 20) $ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20) GUISetState() ; display the GUI for $i = 0 to 0 $msg = GUIGetMsg() Select Case $msg = $YesID MsgBox(0, "You clicked on", "Yes") Case $msg = $NoID MsgBox(0, "You clicked on", "No") Case $msg = $ExitID MsgBox(0, "You clicked on", "Exit") Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "You clicked on", "Close") EndSelect if $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID then ExitLoop $i -= 1 next EndFunc ;==>_Main The point of world view Link to comment Share on other sites More sharing options...
Kealper Posted March 20, 2012 Share Posted March 20, 2012 Well it's been so long since this topic was originally started, the timing stuff first mentioned might not even be relevant now... Maybe it was a good thing to dig this up from the grave, since performance issues now might not be the same as performance issues back in 2007 Although some of the things mentioned would still apply, since they are dealing with letting more magic happen in the interpreter's internal workings instead of in the code being interpreted... Some things I should mention is with the StringRegExp functions, those now seem about twice as fast as their non-regex counterparts for searching large amounts of text with a simple regex pattern. But as a rule-of-thumb in any interpreted language, if you can get the interpreter to do more work by having your code do less work (like $i += 1 instead of $i = $i + 1) then it'll run faster. (although it isn't going to be that much faster!) Link to comment Share on other sites More sharing options...
Brobbl Posted April 23, 2013 Share Posted April 23, 2013 (edited) Hey, just read this and decided to share something interesting about speeding up code.Also, sorry about bumping this, but i think its (still in 2013) really interesting.Story / Problem:I discovered this lately when i was filling a listview of 19 collumns with the > 30,000 entries of my sql data base.GUICtrlCreateListViewItem("nineteen|collumns|full|of|data", $handle)If the entry had 'success', 'failure', 'downloaded', etc... in the status collumn, the entry would get colored._GUICtrlListView_SetItemColor($handle,$i,0x88ff88) ; greenThis process took over 40 minutes on my notebook, so i was looking for a solution to speed up the whole thing.Solution: I found this when i was trying to make the GUI more user friendly. I hid and disabled all the controls from the GUI and set the cursor to waiting, both returning to normal when the Listview was finished.GUISetCursor(15, 1) GUICtrlSetState($handle, $GUI_DISABLE + $GUI_HIDE) ; ... _LoadList() ; ... GUISetCursor(2, 0) GUICtrlSetState($handle, $GUI_ENABLE + $GUI_SHOW)After these modifications, the whole process took only 2 minutes, so you can actually increase the performance by 2000% !TL/DR:Hiding a Listview control while filling huge amounts of data into it drastically increases performance.-----And sorry for my bad english Edited April 23, 2013 by Brobbl Link to comment Share on other sites More sharing options...
wraithdu Posted April 23, 2013 Share Posted April 23, 2013 (edited) TL/DR: Hiding a Listview control while filling huge amounts of data into it drastically increases performance. This is precisely what these are used for (without having to disable or hide the control): _GUICtrlListView_BeginUpdate() _GUICtrlListView_EndUpdate() Edited April 23, 2013 by wraithdu Link to comment Share on other sites More sharing options...
Brobbl Posted April 23, 2013 Share Posted April 23, 2013 (edited) Well I googled a lot about this problem when I expierienced this problem and I didnt find these.But thank you for your help anyway, looks very nice and may even be worth a change in my code Edited April 23, 2013 by Brobbl Link to comment Share on other sites More sharing options...
cramaboule Posted October 12, 2015 Share Posted October 12, 2015 (edited) Hi,Just a small error for calculating the average:Return $Ave / $i ; Send back the value, dividing total by # of numbers added together --> averageShould be:Return ($Ave / ($i-1)) ; Send back the value, dividing total by # of numbers added together --> averageCram...Edit: I had to edit because I am noob !!!! :-) Edited October 12, 2015 by cramaboule jvanegmond 1 My Autoit programs: MAC Address - - Delete Temp Files - - Ping Test - - Play Video with VLC full screen dual monitors - - Set IP - - Pics Converter - - AutoUpdater - - CPU Usage - - Ending Script Nicely - - GDI+ GUI crossfades (slide transitions) - - Beamer - - Search and Search in Files - - Silent Ninite Others: Export Icons into Dll - - My website Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2017 Share Posted April 19, 2017 Your base code for speed testing will be add to my frinds list! thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now