Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Oj.load performance #680

Merged
merged 1 commit into from Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/oj/object.c
Expand Up @@ -70,6 +70,7 @@ static VALUE calc_hash_key(ParseInfo pi, Val kval, char k1) {
}
}
#endif
OBJ_FREEZE(rkey);
return rkey;
}

Expand Down
2 changes: 2 additions & 0 deletions ext/oj/strict.c
Expand Up @@ -44,6 +44,7 @@ VALUE oj_calc_hash_key(ParseInfo pi, Val parent) {
if (Yes == pi->options.sym_key) {
rkey = rb_str_intern(rkey);
}
OBJ_FREEZE(rkey);
return rkey;
}
VALUE *slot;
Expand All @@ -64,6 +65,7 @@ VALUE oj_calc_hash_key(ParseInfo pi, Val parent) {
rb_gc_register_address(slot);
}
}
OBJ_FREEZE(rkey);
return rkey;
}

Expand Down
1 change: 1 addition & 0 deletions ext/oj/wab.c
Expand Up @@ -318,6 +318,7 @@ static VALUE calc_hash_key(ParseInfo pi, Val parent) {
*slot = rkey;
rb_gc_register_address(slot);
}
OBJ_FREEZE(rkey);
return rkey;
}

Expand Down