Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve
JsString
performance (#2042)
It changes the following: - The current `JsString` implementation has a lot of duplicate heap allocations. For static strings, `JsString` only needs to store the index of `CONSTANTS_ARRAY`. ~~I let `JsString` can store pointer to heap or static area. The two are distinguished by the first bit. (This implementation is rough, maybe we should put flag into `Inner`, like [arcstr](https://github.com/thomcc/arcstr/blob/70ba2fac19d3efe8d2e0231daaf74f9987c04b8a/src/arc_str.rs#L751-L757))~~ - I also added more string constants, which are always used.
- Loading branch information