JockoDundee Posted November 25, 2020 Share Posted November 25, 2020 It’s true that _IsPressed(“01”) is significantly sped up when a dll is specified as a second optional argument, which is especially beneficial when called in a loop repeatedly. Yet, other UDF functions typically have no such parameter. Is that because there is little benefit, or because they keep any dlls cached statically? Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Nine Posted November 25, 2020 Share Posted November 25, 2020 Not sure we should call it significant. I tested both with $hDLL (coming from DllOpen) and the usual "user32.dll" and it shows that with the handle it is close to 25% faster after 5000 calls. Not bad if you look only at the percentage. But the fact is that it's only 13ms faster. Divided by 5000 it is a gain of 0.0026ms per call (not really significant IMO). On the other hand, it doesn't hurt to specify it. Recently we tested DllCall using an handle and without. There was only few ms between both. Maybe @pixelsearch can confirm cause I can't seem to find the thread. There was a nice explanation from M23 too. Anyway, the conclusion was that there is not much of an advantage to open DLL especially if it is a largely used DLL. JockoDundee 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 25, 2020 Moderators Share Posted November 25, 2020 Hi, The thread and post mentioned by Nine: M23 JockoDundee and Nine 2 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 Link to comment Share on other sites More sharing options...
JockoDundee Posted November 26, 2020 Author Share Posted November 26, 2020 Yes, I agree after running a few tests, only a very modest benefit from using a pre-opened dll. One other question though, if anyone has insight. The underscore indicates that _IsPressed is not part of the core language, is that correct? Does that mean it wasn’t in the original language, or? Ok, I lied, one other question about dlls, quite a number of solutions posted in this forum seem to rely on DllOpen and DllCall and setting up structs correctly to get stuff in and out of them. But once somebody works out how to call the dll function properly, is there a way for them to just put a wrapper on it and add it to the collection? Is that what the WinApi stuff is? Thanks in advance. Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
boom221 Posted November 26, 2020 Share Posted November 26, 2020 You can look for yourself. They are in the Include folder of your AutoIT installation. But yeah, they are wrappers around dllcalls so that we can live in the matrix of cute function calls. TheDcoder 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 26, 2020 Moderators Share Posted November 26, 2020 JockoDundee, Quote The underscore indicates that _IsPressed is not part of the core language, is that correct? Does that mean it wasn’t in the original language, or? Core AutoIt functions do not have a leading underscore (e.g. FileReadToArray) while those that do (e.g. _FileReadToArray) are written in pure AutoIt and can be found in the standard UDF libraries - look in the "Include" folder of your AutoIt installation. You might also come across functions with a double leading underscore - these are by convention "Internal Use Only" functions within a UDF. Meddle with them at your peril! Quote just put a wrapper on it and add it to the collection? Is that what the WinApi stuff is? That is entirely correct - the "_WinAPI_*" functions are syntactic sugar for various API calls and were originally an external library managed by the author. They were added to the standard includes some time ago as they were proving such a useful addition to general AutoIt programming. If you were to produce some nice API/DLL call wrapper functions then the place to put them is into the "Examples" section where they can be peer-reviewed by the community. If they are considered really useful then they may be taken into the standard includes, but as that means that the small number of people who manage this ever-expanding package have to take over the task of integrating all the various functions with any new version of the AutoIt core or Windows release this does not happen that often. 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 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