Reputation: 16967
I'm running performance test to compare different canvas rendering schemes in Chrome. Time profiling is straightforward enough but I'm also trying to compare memory performance. By running Chrome with the --enable-memory-info
I have access to performance.memory.usedJSHeapSize
to observe memory usage before and after a run.
The problem is that the garbage collector may run. It's easy to see that that happened because the change in memory usage is negative, but there's no information about how much garbage was collected, so I can't infer the memory usage. Is there some programmatic access to knowing what the gc is up to?
Perhaps better, all the information I need is in the Timeline tab of the developer tools. Programmatic access to that would be excellent; my only option is to eyeball it and I want to do things quantitatively, not by eyeballing. This is all running on a computer after all. Is there programmatic access to that?
(BTW I could monitor memory inside the tight loop I'm perf testing, and maybe that's the best I can do, but I'm concerned that that itself will affect performance, and it would mean pasting code into a bunch of places.)
Upvotes: 0
Views: 632
Reputation: 14119
There is a protocol which is used for interactions between Chrome DevTools and the inspected page. https://developers.google.com/chrome-developer-tools/docs/protocol/tot/index
You can use it and do whatever you want. As example you can do evals in context of the page or even record timeline.
Upvotes: 1