Skip to content
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

Memory metrics for Chrome using window.performance.memory #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sebadoom
Copy link

@sebadoom sebadoom commented Jan 7, 2016

As title says. Uses setInterval (is this OK?).

@axemclion
Copy link
Owner

@sebadoom Thanks a lot of the pull request. I had been exploring ways to get memory profile and I think this is perfect. Just a couple of comments on the code

MemoryProbe.prototype.start = function(browser) {
var me = this;
this.timerHandle = setInterval(function() {
browser.eval('window.performance.memory').then(function(res) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling eval with a time from webdriver usually results in an extra network call, since the webdriver would have to talk to selenium. This will require the extension to receive the "stringified" message, parse and execute it, increasing the impact of the test on the final data that we get.

Also note that when you collect memory with metrics like frames_per_sec, you may notice differences since this is additional javascript that is executed, and results in network calls. Could that be the reason you are getting some inconsistent results in your metrics ?

@axemclion
Copy link
Owner

Did you notice a lot of difference in other data when this was enabled, as opposed to having stopped this metric ? I was wondering if this code would add noise to the data that we finally collect.

@sebadoom
Copy link
Author

sebadoom commented Jan 9, 2016

TBH I haven't compared these results to the previous ones. Fortunately they are readily available in the benchmarks repo (https://github.com/auth0/blog-dombench). I will take a look when I have some time (probably tomorrow) and post my findings here.

@sebadoom
Copy link
Author

@axemclion have you had a chance to review my comments above?

@axemclion
Copy link
Owner

@sebadoom Sorry for the delay. I am currently experimenting to see if there is another way to get the same information that you get using window.performance.memory. I noticed that the timeline that we collect for metrics like frames_per_sec or paint seems to have information like jsHeapSize, etc. Do you think we could instead try to get the information from that ?

Uncommenting this line when running the tests gives you a file called perflogProbe.json, which is a large file that is the representation of the timeline. Do you think we could use that ? The data may also be more accurate, and similar to what the Chrome devtools shows.

@fc
Copy link

fc commented Dec 20, 2016

Any progress on this?

Also, it looks like we would need to add --enable-precise-memory-info to get more granular memory information.

http://peter.sh/experiments/chromium-command-line-switches/#enable-precise-memory-info

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.

None yet

3 participants