Jump to content

Recommended Posts

Posted

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?

Posted (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 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.
Posted (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 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
Posted

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

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...