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

Features/reduce gc pressure, massive speed improvements in benchmark (if Bullet.enable) #42

Merged
merged 21 commits into from
May 28, 2011

Conversation

riffraff
Copy link
Contributor

This branch makes a few changes to reduce object allocation, uses a Set in Registry::Base so that we can avoid uniq calls all the time, moves flatten in a different position so it's not processing all the registry all the time and uses a direct hash access instead of iterating on a hash. Plus a couple spurious fixes.

I also merged and updated performance/benchmark.rb so it enables bullet and uses profiletools.rb.
From my investigation it resulted that bullet code was not being invoked otherwise.
All tests still passing on 1.8 and 1.9, (osx, linux).

Result for 1.8.7, standard code benchmark (profiling enabled)

 Start benchmarking...
                                                                             user     system      total        real
 Querying & Iterating 1000 Posts with 10000 Comments and 100 Users     405.980000   0.440000 406.420000 (406.522312)

1.8.7, my branch

 Start benchmarking...
                                                                             user     system      total        real
 Querying & Iterating 1000 Posts with 10000 Comments and 100 Users       3.290000   0.030000   3.320000 (  3.369753)

On ruby 1.9.3, no perftools (no 1.9.2 at hand sorry), standard code

Start benchmarking...
                                                                        user     system      total        real
Querying & Iterating 1000 Posts with 10000 Comments and 100 Users     ^[[B305.490000   1.630000 307.120000 (306.878098)

my branch

Start benchmarking...
                                                                            user     system      total        real
Querying & Iterating 1000 Posts with 10000 Comments and 100 Users       3.250000   0.050000   3.300000 (  3.300147)

I don't understand why some things were done in such a way, so this may break something else.

@flyerhzm
Copy link
Owner

Thanks man, I will try it this weekend.

flyerhzm added a commit that referenced this pull request May 28, 2011
Features/reduce gc pressure, massive speed improvements in benchmark (if Bullet.enable)
@flyerhzm flyerhzm merged commit 46b0af4 into flyerhzm:master May 28, 2011
flyerhzm added a commit that referenced this pull request Jun 1, 2013
Features/reduce gc pressure, massive speed improvements in benchmark (if Bullet.enable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants