switch id_table.c variant
Currently used variant is 'binary search in small table + hash for large tables'.
But for contemporary CPU it may be better to do linear scan for small tables.
It is already implemented in
id_table.c and numbered as 35.
Tested with simple Redmine installation on Intel Haswell i7-4770 CPU @ 3.40GHz
Requests per second: 27.79 [#/sec] (mean)
- with switched implementation:
Requests per second: 28.87 [#/sec] (mean)
#3 [ruby-core:74362] Updated by funny_falcon (Yura Sokolov) over 1 year ago
I just install Redmine - the same software that powers bugs.ruby-lang.org ,
then add several test issues, and bench it with 'apache benchmark':
ab -n 1000 -c 10 http://localhost:3000/projects/general/issues
general is a name of test project)
#4 [ruby-core:74387] Updated by funny_falcon (Yura Sokolov) over 1 year ago
In other words, big web applications are too big for global method cache, and too polymorphic for inline cache.
So general method lookup is inevitable.
With current choice for id_table implementation (34) it takes about 4.5-6%CPU.
With implementation 22 it takes just 2.5-3% CPU.
#6 [ruby-core:78045] Updated by ko1 (Koichi Sasada) 9 months ago
I measured them like st_table:
And ffalcon's 22 implementation is best. We need to switch to it.
Naruse-san, can I switch it now?
#11 [ruby-core:79200] Updated by funny_falcon (Yura Sokolov) 6 months ago
Excuse me for not reacting on discussion.
I forgot to turn on mail notifications for this issue.
can you make a table more small with a few entries?
It could be 25% smaller for any size (on x86_64) at cost of second memory lookup
if key and value stored in separate arrays. It should be measured.
Single pointer still could be used as with "USE_CALC_VALUES".
ko1, will you just switch id or remove other implementations?
if first, I may prepare patch for current source, otherwise I will wait for commit.
And do you have a commit permission?
No I haven't. And I doubt I should have.
#13 Updated by ko1 (Koichi Sasada) 6 months ago
- Status changed from Assigned to Closed