]> git.kaiwu.me - njs.git/commit
Refactored working with built-in strings, symbols and small integers.
authorVadim Zhestikov <v.zhestikov@f5.com>
Thu, 29 Aug 2024 05:03:14 +0000 (22:03 -0700)
committerVadimZhestikov <108960056+VadimZhestikov@users.noreply.github.com>
Wed, 30 Apr 2025 01:49:03 +0000 (18:49 -0700)
commitb28e50b1952d8788485e0f6c6126320702add1d3
tree507005cac87b26b29d87a97b155661f6c7b25264
parent6a0826429142d3ad509c7dede5ad301d23dffce4
Refactored working with built-in strings, symbols and small integers.

- Implemented atom IDs for strings, symbols and small numbers, enabling
  equality checks via ID comparison
- Optimized string operations for faster property lookups and comparisons
- Removed short string inlining from njs_value_t structure

Performance improvements (arewefastyet/benchmarks/v8-v7 benchmark):
- Richards: +57% (631 → 989)
- Crypto: +7% (1445 → 1551)
- RayTrace: +37% (562 → 772)
- NavierStokes: +20% (2062 → 2465)
- Overall score: +29% (1014 → 1307)

In collaboration with Dmitry Volyntsev.
70 files changed:
auto/sources
external/njs_crypto_module.c
external/njs_fs_module.c
external/njs_query_string_module.c
external/njs_shell.c
external/njs_webcrypto_module.c
external/njs_xml_module.c
external/njs_zlib_module.c
nginx/ngx_http_js_module.c
nginx/ngx_js.c
nginx/ngx_js.h
nginx/ngx_js_fetch.c
nginx/ngx_js_shared_dict.c
nginx/ngx_js_shared_dict.h
nginx/ngx_stream_js_module.c
src/njs.h
src/njs_array.c
src/njs_array_buffer.c
src/njs_async.c
src/njs_atom.c [new file with mode: 0644]
src/njs_atom.h [new file with mode: 0644]
src/njs_atom_defs.h [new file with mode: 0644]
src/njs_boolean.c
src/njs_buffer.c
src/njs_buffer.h
src/njs_builtin.c
src/njs_date.c
src/njs_encoding.c
src/njs_error.c
src/njs_extern.c
src/njs_flathsh.c
src/njs_flathsh.h
src/njs_function.c
src/njs_function.h
src/njs_generator.c
src/njs_iterator.c
src/njs_json.c
src/njs_lexer.c
src/njs_lexer.h
src/njs_lexer_tables.h [deleted file]
src/njs_main.h
src/njs_math.c
src/njs_module.c
src/njs_number.c
src/njs_number.h
src/njs_object.c
src/njs_object.h
src/njs_object_hash.h [deleted file]
src/njs_object_prop.c
src/njs_object_prop_declare.h
src/njs_parser.c
src/njs_parser.h
src/njs_promise.c
src/njs_regexp.c
src/njs_scope.c
src/njs_string.c
src/njs_string.h
src/njs_symbol.c
src/njs_typed_array.c
src/njs_value.c
src/njs_value.h
src/njs_value_conversion.h
src/njs_variable.c
src/njs_variable.h
src/njs_vm.c
src/njs_vm.h
src/njs_vmcode.c
src/test/njs_benchmark.c
src/test/njs_externals_test.c
src/test/njs_unit_test.c