Issue #12180 has been updated by Yura Sokolov.


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.

----------------------------------------
Feature #12180: switch id_table.c variant
https://bugs.ruby-lang.org/issues/12180#change-62624

* Author: Yura Sokolov
* Status: Assigned
* Priority: Normal
* Assignee: Koichi Sasada
* Target version: 
----------------------------------------
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

- trunk:
`Requests per second:    27.79 [#/sec] (mean)`
- with switched implementation:
`Requests per second:    28.87 [#/sec] (mean)`

---Files--------------------------------
0001-id_table.c-switch-id_table-variant.patch (767 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>