Skip to content
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

Don't use util.format as it's superly duperly not performant #27

Open
SCdF opened this issue Apr 13, 2018 · 0 comments
Open

Don't use util.format as it's superly duperly not performant #27

SCdF opened this issue Apr 13, 2018 · 0 comments

Comments

@SCdF
Copy link

SCdF commented Apr 13, 2018

See the docs: https://nodejs.org/api/util.html#util_util_format_format_args

Please note that util.format() is a synchronous method that is mainly intended as a debugging tool. Some input values can have a significant performance overhead that can block the event loop. Use this function with care and never in a hot code path.

Using this function causes json2xml to be super duper slow with larger json structures. One that is ~70kb takes ~8 minutes to convert on my laptop. Switching a different library that same JS converted in milliseconds.

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

No branches or pull requests

1 participant