Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mmueller2012
Copy link
Contributor

I noticed that parsing yaml documents with floats is quite slow when compiling for wasm with emscripten. It turns out that the calls to std::locale("C") that are used in convert<float> take more than 1ms each in emscripten. To fix this I replaced the creation of the locale with a call to std::locale::classic() which returns a static reference to an already initialized C locale (see documentation). This reduces the parsing time by 85% for me.

@jbeder jbeder merged commit 4fe2fb8 into jbeder:master Sep 17, 2025
31 checks passed
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