screeps-profiler icon indicating copy to clipboard operation
screeps-profiler copied to clipboard

[Feature] Profile Memory

Open RiftLurker opened this issue 7 years ago • 1 comments

It's currently not possible to profile Memory deserialization cost, because the Profiler accesses (and therefor deserializes) Memory when checking if it should be profiling.

This can be solved in one of the following ways:

  • Add an option to profile Memory deserialization
  • Provide a function wrapper that doesn't check if the profiler is enabled

RiftLurker avatar May 17 '17 07:05 RiftLurker

I've been meaning to add this by default, and probably log a warning if it thinks you might have accessed memory before enabling the profiler. This can be done pretty simply by timing access to Memory very early on in the profiler's logic, logging if that access takes < ~2ms.

gdborton avatar May 18 '17 20:05 gdborton