Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments to GC page about tradeoffs in design and impl of GC (garbage collector) #4081

Open
dlangBugzillaToGithub opened this issue Feb 15, 2018 · 3 comments

Comments

@dlangBugzillaToGithub
Copy link

John Gabriele reported this on 2018-02-15T07:08:01Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=18441

CC List

  • Seb
  • Michael

Description

I regularly hear complaints online about D's GC being slow or not decent, but those complaints rarely include details.

I've twice seen Walter explain some tradeoffs that were made in the design and implementation of the D GC. [One was on the forum]. [Another on reddit], where he wrote:

"You can make a moving GC with D, it's called a "mostly copying" collector. The trick is to not move things that may have a pointer to them."

and

"Certain GCs instrument the generated code with write gates which notify the GC when memory writes are being made. GC-focused languages rely on this to make the GC better, at the cost of lower performance in the native code.

D has a GC, but is not a GC focused language. The performance cost of write gates is an unacceptable compromise in the context of D."

***

The [D GC page](https://dlang.org/spec/garbage.html) may need a section describing these tradeoffs that were made in the design and implementation of the GC so people can easily see why it is the way it is. That may help avoid regurgitated complaints of "it's too slow" and provide a link to point those folks to.

[One was on the forum]: https://forum.dlang.org/post/p5i3j9$1uv6$1@digitalmars.com

[Another on reddit]: https://www.reddit.com/r/programming/comments/7xih66/the_expressive_c17_coding_challenge_in_d/
@dlangBugzillaToGithub
Copy link
Author

michael commented on 2018-02-15T09:57:17Z

It would be great to have a page on the dlang website tackling the stigma associated with the garbage collector. We can demo some performance benchmarks, perhaps, as well as discuss things to keep in mind. Most importantly, use it to highlight all of the nice features it enables like dynamic arrays as a language feature etc.

@dlangBugzillaToGithub
Copy link
Author

dfj1esp02 commented on 2018-02-16T08:19:25Z

https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e GC questionnaire, may be interesting to fill.

@dlangBugzillaToGithub
Copy link
Author

greeenify commented on 2018-02-16T09:05:42Z

There is also this nice GC series: https://dlang.org/blog/the-gc-series/

We should probably link to it from the front page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant