I've had to read a lot of mangled names in my life :(, but it's just a
slowdown to profiling and reporting. I supposed I can post-process all of
the names in the Chrome profile json dumps as a last resort. I was just
hoping for something more automagic for the long term.
I read some posts that the Chrome team is looking to implement displayName
recording (6 years after the request was first posted). I was hoping
Firefox would have a leg up on this, given their asm.js heritage. Safari
doesn't work either. Alon has a very nice lightweight demangler, so at
least that's better than the default stack traces out of the browsers.
Here's was the attempt to auto-demangle the names into displayName. This
would only work for a debug build, but I could imaging creating a file out
of the emscripten compiles/link to set the displayName from before
minification occurs.
<script>
(function() {
for (var name in window) {
var value = window[name];
if (value instanceof Function && /^_Z/.test(value.name)) {
var unmangled = demangle(value.name);
if (unmangled) {
value.displayName = unmangled;
}
}
}
})();
On Monday, January 26, 2015 at 6:03:38 PM UTC-8, Bruce Mitchener wrote:
>
> On Tue, Jan 27, 2015 at 8:45 AM, Alecazam <[email protected] <javascript:>>
> wrote:
>
>> Anyone had any luck profiling without mangled C++ names in any browser?
>> I tried setting the displayName on the functions to one demangled by
>> Emscripten's demangle call, but the profilers don't seem to even look at
>> this. I could also see setting demangled function names before
>> minification, so that optimized builds could be profiled with some
>> semblence of where time was going.
>>
>> Source maps have just never worked for me either. I'm assuming no one is
>> using them. With -g4 specified, the link generate 10 GB+ of data and slows
>> to a crawl (6+ minutes of hard SSD trashing). This would be a good
>> feature to get working (and not kill the build times). Debug builds seem
>> to build/link in almost no time. It seems like a lot of Emscripten dev is
>> just praying that I don't have to go into the raw asm.js.
>>
>
> You can learn pretty quickly to read mangled names to get the basics of
> what is going on. From there, c++filt on the command line will help you
> with some of the trickier things.
>
> I don't use source maps (they've never worked for me either).
>
> I do builds with varying -g levels and read the generated JS (un-minified
> and pretty-printed). It works out pretty well once you understand the
> basics.
>
> I'm working on a blog post series to cover a lot of the basics of working
> at this level ... I hope to post something by the end of the week.
>
> - Bruce
>
>
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.