Bug 14955 – [D1] Add module profiling feature

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-24T14:22:00Z
Last change time
2015-10-11T14:06:26Z
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2015-08-24T14:22:20Z
Since the -profile switch by default generates a try/finally for every function which is generated this causes a major slowdown of the application and makes it hard to frequently do performance analysis or even do analysis on a specific set of functions. Instead one could profile a specific module via: $ dmd -profile=my.mod ... It's fairly easy to implement.
Comment #1 by bugzilla — 2015-08-27T21:25:44Z
You can also use separate compilation to achieve the same effect.
Comment #2 by public — 2015-08-28T02:01:26Z
Technically you can but separate compilation like that is very effort consuming to add to any non-trivial build system (if it doesn't support separate compilation from the very beginning). In our use case there is in-house makefile framework that handles most of low level details automatically and circumventing that is considerably more effort than just overriding DFLAGS in whole makefile. On the other hand, is there any reason why it is a bad idea (apart from general "minimize additions" concern)?
Comment #3 by andrej.mitrovich — 2015-08-28T05:53:51Z
(In reply to Walter Bright from comment #1) > You can also use separate compilation to achieve the same effect. Ah, I haven't thought of that. Unfortunately it would be time consuming for us to transfer to using separate compilation, whereas the implementation for this is very little code. Would you be against adding support for this only in D1? We can provide the implementation, of course.
Comment #4 by bugzilla — 2015-09-01T04:27:09Z
> On the other hand, is there any reason why it is a bad idea (apart from general "minimize additions" concern)? That's the only concern. > Would you be against adding support for this only in D1? Not at all. You're the only D1 customer, so what you need is the only thing that matters. > We can provide the implementation, of course. Sounds good!