1

I have a similar piece of code in 4 different technologies (Go, Node, .NET and Python), and all of them are CLI tools. I'd like to benchmark them against one another and record runtime as well as the peak memory working set. The time is trackable with the time command of git bash, but I can't seem to find anything that will return the peak working set.

I have tried process explorer, but once a process exits, it disappears. I'd like to do multiple runs and keep the peak memory usage of each run to calculate an average later, mostly automated. Is this possible with any tools, potentially even built-in ones? I am on Windows 10.

5
  • What makes you think peak working set size would be a good metric? If I only have 128 MB RAM, the maximum peak working set will be 128 MB. Think about it. – Thomas Weller Dec 30 '19 at 21:58
  • @ThomasWeller I am on a VM with 32 GB RAM and I want to know how much the memory usage peaked at. Is that unreasonable? Should I be looking at a different metric? – david1602 Jan 1 '20 at 5:16
  • Working set size depends on various things and is influenced by factors you can hardly control, e.g. whether the application has the focus or not or whether it makes use of multithreading or not. If you want to know about memory efficiency of the program, better look at private bytes. – Thomas Weller Jan 1 '20 at 12:11
  • Also be aware that garbage collected languages such as .NET may request more memory than actually needed, just "because they can", so the sheer availability of physical RAM may result in different behavior. – Thomas Weller Jan 1 '20 at 12:12
  • @ThomasWeller I see, so it's not easy as I hoped. Thanks for the info! – david1602 Jan 5 '20 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.