www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19601] New: Running -profile=gc when no gc is logged leaves

https://issues.dlang.org/show_bug.cgi?id=19601

          Issue ID: 19601
           Summary: Running -profile=gc when no gc is logged leaves old
                    misleading file contents
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.burton jbmail.com

Rather minor issue but might be easy to fix if it's agreed it's a bug and worth
the effort.

Using the following option on dmd :-

  -profile=gc

When the resulting executable file is run it logs GC operations to the file
profilegc.log However if no GC operations occurs during the run, then any
previous contents of that file is left unchanged which is misleading as the
file does not accurately reflect the result of the profiling (which should be
an empty file)

This caused me a small amount of confusion when I was trying to eliminate the
gc operations from some inner loop code and was trying to understand the
results once I'd managed to eliminate all the GC operations.

I would expect that it you've requested a gc profile and there is nothing for
the log that an empty file is produces or some indication that there is no GC
(or even the file is removed).

--
Jan 21