XanzyX Posted September 29, 2018 Posted September 29, 2018 I wrote a code where I populated a one dimensional array of 250,000 elements. I have a For..Next Loop to search through that array and add key elements to another array. I found that the first 50,000 gets completes in about 20 minutes, 100,000 in an hour. If I leave the process run overnight, it barely gets to 200,000. I’ve tried writing the results to a file after 10,000 but that won’t work either. Is there any way to speed this up?
Developers Jos Posted September 29, 2018 Developers Posted September 29, 2018 3 minutes ago, XanzyX said: Is there any way to speed this up? Probably. Post the current code so we can test and make suggestions. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
jdelaney Posted September 29, 2018 Posted September 29, 2018 (edited) Convert to use of a database. Take everything out of memory. Compile and run 64bit so your process can hold more real time memory (or does that not actually add much, I don't forget if it's a ton, or only like an additional 1 MB) Edited September 29, 2018 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Puls3 Posted September 29, 2018 Posted September 29, 2018 (edited) Not exactly a solution and more of a workaround but you could have a few second wait at the top of the script and once the script has been running too long run itself and then exit. But this is a very primitive and crude solution. Edited December 12, 2018 by Puls3 Spelling No, I'm not making a bot, keylogger, password stealer, virus, or anything else malicious, there are over a million different reasons someone would ask for whatever I did. Yes, I need to figure out the answer to the exact question I asked because I have valid reasons as to why I'm not using the alternatives. No, I cannot prove I'm not doing anything malicious because this is a forum and that is impossible. Thank you AutoIt community for always accusing people of doing something evil, good day. - The Infamous Impulsive Puls3
Moderators Melba23 Posted September 29, 2018 Moderators Posted September 29, 2018 XanzyX, The symptoms you are seeing are usually the result of using ReDim to increase the size of an array. This is one of the slowest functions in AutoIt and should be avoided as much as possible. You might like to take a glance at the Recursion tutorial in the Wiki - the final example and the paragraph below it entitled "A little added extra" explain how to limit the use of ReDim to a minimum when dealing with arrays of unknown size. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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