Skip to content

Conversation

bigmontz
Copy link
Contributor

@bigmontz bigmontz commented Nov 8, 2021

The buffer and utf-8 encoding implementation in browser was using the heap and text-encoding-utf-8 library respectively. This process was really slower than in nodejs. For example, a string with 85000 length was taking 180 seconds to serialize in the browser, the same string takes milliseconds to be serialised in nodejs.

This performance issue was resolved by using the libraries buffer and string_decoder, libraries which is already available in nodejs, also in browser. This substitution bring the serialisation of the 85000 length string to take only 350 ms when it's done in browser.

The text-encoding-utf-8 was removed from the project dependency in the process.

The buffer and utf-8 encoding implemetation in browser was using the heap and `text-encoding-utf-8` library respectively. This process was really slower than in nodejs. For example, a string with 85000 length was taking 180 seconds to serialize in the browser, the same string takes miliseconds to be serialized in nodejs.

This performance issue was resolved by using the libraries `buffer` and `string_decoder`, libraries which is already available in nodejs, also in browser. This substitution bring the serialization of the 85000 length string to take only 350 ms when it's done in browser.

The `text-encoding-utf-8` was removed from the project dependency in the process.
@bigmontz bigmontz linked an issue Nov 8, 2021 that may be closed by this pull request
Copy link
Member

@robsdedude robsdedude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ 🏃‍♀️

Copy link
Member

@robsdedude robsdedude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@bigmontz bigmontz merged commit 2d1e016 into neo4j:4.4 Nov 8, 2021
@bigmontz bigmontz deleted the 4.4-improve-performance-browser branch November 8, 2021 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace text-encoding-utf-8 with a new library that has license

2 participants