Skip to content

Commit 7238ee6

Browse files
authored
Make initial shape hash table bigger (#1120)
Even an empty script requires more than 16 entries in the hash table. Before this commit, executing an empty script caused the hash table to resize two times. Now, it's the proper size from the start and not resized at all.
1 parent 0a00011 commit 7238ee6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quickjs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4429,7 +4429,7 @@ static inline JSShapeProperty *get_shape_prop(JSShape *sh)
44294429

44304430
static int init_shape_hash(JSRuntime *rt)
44314431
{
4432-
rt->shape_hash_bits = 4; /* 16 shapes */
4432+
rt->shape_hash_bits = 6; /* 64 shapes */
44334433
rt->shape_hash_size = 1 << rt->shape_hash_bits;
44344434
rt->shape_hash_count = 0;
44354435
rt->shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *

0 commit comments

Comments
 (0)