
Performance regression when creating models
Reported by Martin Gamsjaeger (snusnu) | August 11th, 2010 @ 02:15 AM | in 1.0.2
I stumbled over Jordan's benchmarks in the IRC logs: http://gist.github.com/518333
Comments and changes to this ticket
-
Martin Gamsjaeger (snusnu) August 11th, 2010 @ 03:29 AM
Oh i should maybe just link the offending commit: http://github.com/datamapper/dm-core/commit/ad298724f2d88f8edd49a4d...
-
Dan Kubb (dkubb) August 17th, 2010 @ 03:39 PM
- Milestone set to 1.0.2
- State changed from unconfirmed to confirmed
- Assigned user set to Dan Kubb (dkubb)
- Milestone order changed from 196257 to 0
I believe I've fixed this with:
http://github.com/datamapper/dm-core/commit/c2d9af2ce93d1f639ad60a7...
I asked jpr5 to verify that it fixes the problem for him. I'll close this ticket once I hear back.
-
Jordan Ritter August 17th, 2010 @ 05:31 PM
Latest commits appear to help in the context of the previous synthetic benchmark I posted, but it doesn't completely solve our real-world performance degradation experience.
After digging some more, here's another gist: http://gist.github.com/532263
This contains an evolution of the old benchmark, and identifies (at least) one new problematic point: Enum. The declaration of Enum properties is slow, and if you enable the commented-out puts in the repro script, you'll see that it slows down geometrically. This in turn appears to impact the declaration of other properties, though not all (see script output for a subset).
The script compares the Enum problem between just before the problematic commit (c2d9af2c) and current edge (c34ba04). You'll see that, while the Enum issue still exists, it is much less pronounced before the commit in question.
-
Piotr Solnica (solnic) August 18th, 2010 @ 03:23 AM
It can be optimized by storing the created Enum classes in a hash that's indexed using flags. I'm gonna experiment with that and run your benchmarks.
-
Piotr Solnica (solnic) August 18th, 2010 @ 08:52 AM
It seems like it should work much faster now; Can you try grabbing dm-types from master and running the benchmarks again? Thanks
-
Jordan Ritter August 18th, 2010 @ 11:08 AM
Based on dkubb's latest commits up to 62ab004 (Updated gemspec), I see performance now slightly better than at e7b5f18 (Put the Inflector into our own namespace). Excellent.
From my benchmark however, it's still 5x slower relatively than v1.0.0.
I'll try piotr's changes now, together with latest edge.
-
Jordan Ritter August 18th, 2010 @ 11:20 AM
Well, this is great! Piotr's changes at dm-types 98593c07 combined with dkubb's at dm-core 62ab0044 make for excellent performance results, both real-world and benchmark. I've updated the gist at http://gist.github.com/532263 to reflect the benchmark results.
I'll run through some real-world regression testing today to make sure everything's still functional.
Thanks guys!
-
Piotr Solnica (solnic) August 27th, 2010 @ 02:24 PM
- State changed from confirmed to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »