Skip to content

Instantly share code, notes, and snippets.

@funny-falcon
Created December 27, 2011 08:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save funny-falcon/1523093 to your computer and use it in GitHub Desktop.
Testing Redmine with hash patch
Test of Redmine issues/issue pages with ruby patched by `compact hash` patch.
I choose this pages cause Issue model have 23 fields and User model hash 17 fields.
Benchmark env:
Ubuntu 11.04 32bit, rvm, AthlonX2 @2000GHz
export RUBY_GC_MALLOC_LIMIT=60000000
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_FREE_MIN=500000
export RAILS_ENV=production
server command:
passenger start --max-pool-size 1 >/dev/null
test script
runbench () {
siege -b -c 5 -t 2S "$1" 1>/dev/null 2>/dev/null
sleep 1
siege -b -c 5 -t 20S "$1" 1>/dev/null
}
runbench 'http://localhost:3000/projects/work-flow/issues?set_filter=1&f[]=&c[]=tracker&c[]=status&c[]=priority&c[]=subject&c[]=assigned_to&c[]=updated_on&c[]=done_ratio&group_by='
runbench 'http://localhost:3000/issues/35'
(I've cleared filter on issues page to have 25 shown issues)
results (pages per second):
version: issues: issue:
master 4.55 12.31
func 4.55 12.61
0 4.50 12.41
3 4.60 12.46
6 4.65 12.81
9 4.70 13.01
12 4.70 12.96
18 4.60 12.96
22 4.65 13.31
32 4.75 13.41
42 4.70 13.26
where:
`master` - is a stock 1.9.3 master branch
`func` - only `functions instead of macros` patch
(note: ruby 1.9.3 compiles with gcc -03 - this is by default, as I could understand)
`[:digit:]` - value of environment variable RUBY_MAX_PACKED_HASH with packed hashes.
So that it seems that 9 is a more safe value than 12 for packed hash size.
But greatest performance improvement with RUBY_MAX_PACKED_HASH=32 - perhaps cause it covers all Redmine's models sizes.
There is performance decrease with using RUBY_MAX_PACKED_HASH=0 compared to `func` patch.
@funny-falcon
Copy link
Author

Redmine Issues page

Redmine Issue page

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