summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-02-05 17:27:24 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-02-06 22:07:11 +0900
commitd52f46da4571c7c44954b15f85a00d74ab86f7f3 (patch)
treec2976cd0b2689c2218fea2410064f67ad4c4f044 /include/mruby.h
parent905fef2669f4dd0efb71205219872d9fb4b135b6 (diff)
downloadmruby-d52f46da4571c7c44954b15f85a00d74ab86f7f3.tar.gz
mruby-d52f46da4571c7c44954b15f85a00d74ab86f7f3.zip
Implement symbol hash table to boost `find_symbol`.
In 4174e02, we removed the symbol hash table from `mrb_state` but `find_symbol` was too slow with linear search. My performance estimation was wrong. So we implemented a new compact hash table for symbols.
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 7fe2330be..2f2d98677 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -240,6 +240,7 @@ typedef struct mrb_state {
mrb_sym symidx;
struct symbol_name *symtbl; /* symbol table */
+ mrb_sym symhash[256];
size_t symcapa;
#ifdef MRB_ENABLE_DEBUG_HOOK