Skip to content

Conversation

@rochdev
Copy link
Member

@rochdev rochdev commented Aug 4, 2021

What does this PR do?

Lazy load protobuf so that it is not loaded when not needed.

Motivation

After the changes introduced in #16, protobuf is now by far the biggest contributor to the load time of the library. Lazy loading it only when needed reduces the loading time by ~5x. This has the downside however to potentially be loading protobuf during a request at runtime, which could introduce latency for the first request while the library is loading. The proper way to handle this would be to split sketches-js in multiple packages, so that it is known at install time whether protobuf will be used. This however means a much bigger change, but if it's a possibility then it should be favoured over this PR.

@rochdev
Copy link
Member Author

rochdev commented Aug 8, 2022

Superseded by #19

@rochdev rochdev closed this Aug 8, 2022
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.

2 participants