D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21070 - -profile=gc makes the program much slower
Summary: -profile=gc makes the program much slower
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-07-24 19:53 UTC by Tim
Modified: 2020-08-18 20:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tim 2020-07-24 19:53:53 UTC
When compiling a program with -profile=gc it becomes much slower.
GC.stats is called for every allocation,
but it collects more information, than is needed for 
-profile=gc. Replacing the call to GC.stats with a new function,
which only returns the needed information, makes the program fast again.

I will create a pull request later.
Comment 1 Dlang Bot 2020-07-24 20:41:59 UTC
@tim-dlang created dlang/druntime pull request #3164 "Fix issue 21070: -profile=gc makes the program much slower" fixing this issue:

- Fix issue 21070: -profile=gc makes the program much slower
  
  Replacing the call to GC.stats with a new function, which
  only returns the needed information, makes the program fast again.

https://github.com/dlang/druntime/pull/3164
Comment 2 Dlang Bot 2020-08-18 20:38:06 UTC
dlang/druntime pull request #3164 "Fix issue 21070: -profile=gc makes the program much slower" was merged into master:

- ba39c957f37861c1ea2e4fdf7bc40408a4ce1998 by Tim Schendekehl:
  Fix issue 21070: -profile=gc makes the program much slower
  
  Replacing the call to GC.stats with a new function, which
  only returns the needed information, makes the program fast again.

https://github.com/dlang/druntime/pull/3164