Skip to content

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

@icetbr

Description

@icetbr

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`);
        }),

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions