-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Cost of validator is prohibitive #28
Comments
Hi, thanks for the detailed report! I indeed haven’t cared much about creation performance until now and it seems like I was a bit too careful by using a public API that uses deep copy there. Just iterating over
Since the Opinions? |
That certainly seems to fix the most glaring performance issues I noticed with attrs. If |
This issue is a bit critical for us, is there something more I can do to make this fix appear in a next release ? |
(did not want to sound too pushy, if it is difficult to make it happen soon, we can fairly easily backport this in a bundled attr until a new official release) |
If you’d have pinged the PR yesterday (GH doesn’t notify me of new pushes…), I might have made a quick release today but now I’m packing up for PyCon JP and won’t be back until next Wednesday. I will try to find a minute to push it out tho. |
Have fun at PyCon JP. Looks like this year's location is near tsukuji market, perfect for great sushi before the conference |
Closed by #29 |
I noticed that creating instances of attr objects was expensive:
I see a factor of ~ 50x (0.8us vs 34 us) on my machine. A quick profiling shows that almost all the difference comes from the deepcopy in the
attr._make.fields
function.For non trivial classes with a few attributes, the construction cost quickly reaches the hundreds of us.
The text was updated successfully, but these errors were encountered: