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
Speed up EnumKey call #40433
Comments
This patch removes the RegQueryInfoKey call and The script below times python 2.3 5531 89.7130000591 start = time.time()
i = 0
try:
while 1:
_winreg.EnumKey(_winreg.HKEY_CLASSES_ROOT, i)
i += 1
except WindowsError:
pass
print i, time.time() - start |
Logged In: YES This looks good to me, but I think the buffer size is off by |
Logged In: YES I'm curious: Why did you replace RegEnumKey with |
Logged In: YES mmangino: Yes you're correct it should be 256 in both cases. Doh! I'll theller: The advantage of the latter is it returns the Length of the also the SDK says this.... Note This function is provided only for compatibility with |
Logged In: YES Also, please follow the Python style guide for C code, PEP-7. In particular:
|
Logged In: YES I think it's a good idea to get 16-bit Windows functions out It looks like this patch still needs some cleanup and a test |
Logged In: YES garth42, can you please indicate whether you are willing to |
Logged In: YES Attached a revised patch following coding style and adding winreg-enumkey.diff |
Logged In: YES Cleaned up and committed in rev. 42475. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: