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 usage tests #205

Open
nolanlawson opened this issue Oct 7, 2019 · 2 comments
Open

Memory usage tests #205

nolanlawson opened this issue Oct 7, 2019 · 2 comments

Comments

@nolanlawson
Copy link
Contributor

It would be convenient if Best could measure not only CPU time, but also memory usage. I can envision two types of tests here:

  1. Memory leaks – e.g. take a snapshot, repeat some action n times, take another snapshot, diff the two
  2. Absolute memory usage – e.g. take a snapshot at a point in time (maybe after a GC+delay) and report it
@nolanlawson
Copy link
Contributor Author

Details:

  1. For the leak scenario, I envision taking two heapsnapshot files and comparing them, because that's the most convenient way to figure out what actually leaked
  2. Fo the absolute memory usage scenario, I envision just adding the Chrome/Puppeteer flag that allows precise memory stats and then use window.performance.memory.

@nolanlawson
Copy link
Contributor Author

Just talked with @diervo, conclusions:

  • adding the ability to automatically run 1 iteration of each benchmark and measure the memory before/after (using special Chrome flag to expose precise memory) is reasonable
  • users can create their own leak tests by writing a test where it allocates a bunch of stuff and then de-allocates, so it would expect the diff to be ~0
  • putting chrome in precise memory mode should not affect CPU perf
  • memoryLeakIterations could default to 1
  • might call it a "measure"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant