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

dpd_object: shared cache vs. setattr() #10

Open
cshimmin opened this issue Feb 15, 2014 · 0 comments
Open

dpd_object: shared cache vs. setattr() #10

cshimmin opened this issue Feb 15, 2014 · 0 comments

Comments

@cshimmin
Copy link
Owner

As detailed in c63ae63, the new DPDObject copy semantics make use of a shared dictionary object to cache TTree lookups. This means less memory and less copying time for (variational) analyses which carry around multiple copies of the object, resulting in a significant speedup over the old copy semantics.

However, this method relies on a try/except dictionary lookup. In cases where the objects are not copied, or the copies are seldom used, this results in a lot of failed exceptions and is slower than the previous setattr() scheme.

In both cases, overriding the __copy__ method (which caused a lot of __getattr__ recursion) is already a considerable speedup!

TODO: research benefits of shared cache vs. setattr cache; and perhaps provide two implementations of DPDObject so the user can choose the appropriate one for each application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant