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

Add memory "profile" (show heap RAM) #33

Open
icetbr opened this issue Jul 10, 2021 · 0 comments
Open

Add memory "profile" (show heap RAM) #33

icetbr opened this issue Jul 10, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@icetbr
Copy link

icetbr commented Jul 10, 2021

Hi, I'm opening this issue for

  • people searching for this kind of feature have an idea of how to do it
  • as suggestion of an entry in the README
  • bake it in the lib
  • collect ideas on how to improve my code

I would like to compare how much memory my solutions use. I don't know how reliable this is, but might be better then nothing.

This is how I'm doing it, it only works for a single run. There are many potential problems to this

  • GC timing vs time taken to run the test
  • if multiple test cases, I don't know how much you can trust the heap at that moment
        complete((summary) => {
            const used = process.memoryUsage().heapUsed / 1024 / 1024;
            console.log(`\nThe script uses approximately ${Math.round(used * 100) / 100} MB`);
        }),
@caderek caderek self-assigned this Oct 7, 2021
@caderek caderek added the enhancement New feature or request label Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants