-
Notifications
You must be signed in to change notification settings - Fork 22
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
Improve cache in getproperty for GAPFuncsType #123
Comments
Of course it might be useful to benchmark the various approaches. Code which needs optimal performance should also copy the function out, i.e. |
So one argument for keeping the cache as-is, which I overlooked before, is that each GAP object is wrapped into a Julia |
Well, technically we could overload the The caching is of course done for speedup only, but you are right, it is potentially dangerous. I would suggest the following:
What do you think? |
Sounds good to me. One more remark, though: all the other "convenience" wrappers for GAP functionality from within Julia are now in |
That cache is problematic, because it will become out of date if the identifier is changed on the GAP side.
This problem could be avoided, while still retaining most of the performance gain (which in turn I believe mostly stems from avoiding to convert a jl_symbol into a GAP string object), if instead of caching the function pointer, we cached the GAP GVar (an plain UInt value). Then that GVar value can be used to efficiently retrieve the currently assigned value, if any.
This cache of GVar values then could also be used in other places that want to give access to gap global variables.
The text was updated successfully, but these errors were encountered: