V8 has a profiler in the developer's version of chrome, but it also does not run the demo. I opted to use V8 alone. This profiler records the stacks from c++ and JavaScript code. I ran ammo.js through V8.
Here is the log.
The log alone does not give useful information at a glance. After processing the log, I got this.
First thing I noticed was one function that is taking the most processing time.
v8::internal::HashTable<v8::internal::NumberDictionaryShape, unsigned int>::FindEntry(v8::internal::Isolate*, unsigned int)
The word NumberDictionaryShape was a clue to the problem. The ammo.js demo has to make many property calls to change the block's position as they fall or fly, and NumberDictionaryShape sounds like an abstract class of a physical object. One of Chrome's main optimizations was the avoidance of dictionary lookups. The slow speeds seemed to suggest that this is the case.
Now what?
No comments:
Post a Comment