-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Strange performance hiccups in V8 with vsnprintf() #2805
Comments
It looks like all of the time is being spent in the first call to printf_core() inside MUSL_vfprintf(). Running chrome with
This is strange because I would think that printf_core() is receiving the exact same inputs every time, in which case the type information shouldn't be changing at all. Is this a known issue with emscripten output of certain functions? |
Oh, wow! I would recommend raising this on Chromium tracker and referring here. This is the first time I hear of a relatively small asm.js function getting constantly recompiled, although I haven't used the js debugging flags on Chrome in a long time to debug. Let's see what their developers say. |
Chromium issue added: https://code.google.com/p/chromium/issues/detail?id=415788. |
Side note, you can just call Another side note, building with |
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Compiling the following code:
with the command
emcc -O1 -fno-rtti -fno-exceptions temp.c -o temp.js
and opening the web page<script src="temp.js"></script>
in Chrome (stable and canary) gives the following console output:Calling vsnprintf(), even on an empty string, periodically causes delays of up to 175ms. This means that calling vsnprintf() anywhere in a rendering loop with
-O1
is catastrophic for performance. It's not an issue in Firefox, only in Chrome. This wasn't an issue with older versions of emscripten because vsnprintf() was implemented in JavaScript.The text was updated successfully, but these errors were encountered: