diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-26 22:32:06 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-26 22:32:06 +0000 |
commit | d3725a86dee7c80dba1e16110545ff69c4ad9e1d (patch) | |
tree | e453c7bc803be766bbdf361fe628aae8617e1379 /include | |
parent | 08414a6afa97f157503a6f8be800e87b71587f79 (diff) | |
download | ruby-d3725a86dee7c80dba1e16110545ff69c4ad9e1d.tar.gz |
st.c: use ccan linked-list (try 2)
This improves the bm_vm2_bighash benchmark significantly by
removing branches during insert, but slows down anything
requiring iteration with the more complex loop termination
checking.
Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash
benchmark.
* include/ruby/st.h (struct st_table): hide struct list_head
* st.c (struct st_table_entry): adjust struct
(head, tail): remove shortcut macros
(st_head): new wrapper function
(st_init_table_with_size): adjust to new struct and API
(st_clear): ditto
(add_direct): ditto
(unpack_entries): ditto
(rehash): ditto
(st_copy): ditto
(remove_entry): ditto
(st_shift): ditto
(st_foreach_check): ditto
(st_foreach): ditto
(get_keys): ditto
(get_values): ditto
(st_values_check): ditto
(st_reverse_foreach_check): ditto (unused)
(st_reverse_foreach): ditto (unused)
[ruby-core:69726] [Misc #10278]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/st.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/st.h b/include/ruby/st.h index b4fdf7e8ea..190bad2a35 100644 --- a/include/ruby/st.h +++ b/include/ruby/st.h @@ -86,7 +86,7 @@ struct st_table { union { struct { struct st_table_entry **bins; - struct st_table_entry *head, *tail; + void *private_list_head[2]; } big; struct { struct st_packed_entry *entries; |