New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various modules: stringify and parse json is slow #11399
Comments
Reopening as we've had some success with the klona library we plan to commit |
Cc @bbaresic |
JSON.parse + JSON.stringify used to be the fastest way to deep clone objects. Apparently it still is. We are probably deep cloning when it's not needed, but it's often not trivial to verify when it isn't, and I don't think it makes sense to go after the most responsible way to do it. In general premature optimization is a bad idea, it should be focused on known (= measured) bottlenecks. |
https://github.com/search?q=repo%3Aprebid%2FPrebid.js+json.parse%28json.stringify+path%3A%2F%5Emodules%5C%2F%2F&type=code is used by 17 modules. Several of these patterns can be improved similar to this example: InteractiveAdvertisingBureau/iabtcf-es#446
The text was updated successfully, but these errors were encountered: