-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(javascript): Refactor & Compress Long (#1313)
## Refactor the code generator 1. Currently, JavaScript can only register a Object by Type.object, because the generator is too simple 2. Primitive generator of types like string、number can't be inlined in the holder collection, which cause necessary polymorphic that affect the performance ## Enhancement performance 1. Currently, Buffer.latin1Slice would transfer from native code generated by JIT to v8 runtime, This has a significant impact on performance, so we use String.fromCharCode to create little string when the string length is less than 15. It is a magic number, but I have tested it and it works fine. ## Improve When useSliceString is disabled, the performance of deserialization improves by 100%. It is 3 times faster than native JSON and twice as fast as protobuf. When useSliceString is enabled, the performance of deserialization improves by 30%. It is 5 times faster than native JSON and 3 times faster than protobuf. ### Before: #### Disable useSliceString ![image](https://github.com/apache/incubator-fury/assets/16490211/83278ece-0eba-4aa5-81a5-e2806bfd1997) #### Enable useSliceString ![image](https://github.com/apache/incubator-fury/assets/16490211/abaeb420-274a-4aae-b432-750e96061668) ### After: #### Disable useSliceString ![image](https://github.com/apache/incubator-fury/assets/16490211/2d0e1d3f-e3e4-432e-8b20-8d934b848a76) #### Enable useSliceString ![image](https://github.com/apache/incubator-fury/assets/16490211/a9939cbf-cede-4a1d-8720-ac0f04a3abd6)
- Loading branch information
1 parent
f49e662
commit 44cfbb7
Showing
50 changed files
with
2,885 additions
and
1,292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.