Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var access so long #10

Open
muk-as opened this issue Dec 28, 2021 · 5 comments
Open

var access so long #10

muk-as opened this issue Dec 28, 2021 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@muk-as
Copy link

muk-as commented Dec 28, 2021

code for tests https://pastebin.com/iahENe7v
access to variable take 100x longer than to AutoItObject UDF
and 780x longer than to simple Variable

result:
Variable cycle 10k => 1.991 ms || _console_time
Variable one => 0.006 ms || _console_time

AutoItObject UDF FirstObj cycle 10k => 15.763 ms || _console_time
AutoItObject UDF FirstObj one => 0.008 ms || _console_time

AutoItObject UDF SecondObj cycle 10k => 15.696 ms || _console_time
AutoItObject UDF SecondObj one => 0.006 ms || _console_time

AutoItObject Internal cycle 10k => 1554.424 ms || _console_time
AutoItObject Internal one => 0.162 ms || _console_time

@muk-as
Copy link
Author

muk-as commented Dec 28, 2021

with this https://www.autoitscript.com/forum/topic/202519-idispatch-object-in-assembly/
IdispatchASM_compiled_example.au3

result:
IDispatchASM cycle 10k => 6.724 ms || _console_time
IDispatchASM one => 0.006 ms || _console_time

@genius257
Copy link
Owner

It is tricky to fix.
I plan to experiment with a hash-table implementation instead of the current linked list, and compare the speed to the current solution.
The main speed issue with my lib, vs other implementation, is the internal workings of the IDispatch interface is handled by AutoIt code, which is alot slower than most other languages.
I've had my eye on the ASM IDispatch for some time, but most of it cannot be used, when taking my custom hanling of getters, setters and other default "build in" object functions.
If you don't need the getter, setter logic, creating your own handler functions and overriding the defaults when calling the IDispatch method might help the speed of your objects somewhat.

I do indeed want to improve the speed, and are making small scripts to compare running time of different approaches to code that produces the same output, but where one solution might reduce the running time.
That being said, keeping my solution in the AutoIt3 language some first. features comes second and then finally speed third in my prioritization.

@genius257 genius257 added the enhancement New feature or request label Dec 31, 2021
@genius257
Copy link
Owner

Trying to implement the hash-table solution, i ran into some problems that i do not have the time for experimenting on currently.
I will try and reduce speed in other ways for now, and maybe return to research on better lookup methods, when i have more time available.

@muk-as
Copy link
Author

muk-as commented Jul 5, 2022

on last version a litttle better results
AutoItObject Internal cycle 10k => 913.47 ms || _console_time
AutoItObject Internal one => 0.105 ms || _console_time

@genius257
Copy link
Owner

With version 4.0.0 speed should be at least ~20% faster.
I currently can't see a good approach to make it faster for now.

@genius257 genius257 added the help wanted Extra attention is needed label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants