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

Performance regression with --gc:markandsweep #10271

rbehrends opened this issue Jan 11, 2019 · 1 comment

Performance regression with --gc:markandsweep #10271

rbehrends opened this issue Jan 11, 2019 · 1 comment


Copy link

@rbehrends rbehrends commented Jan 11, 2019

As a result of this commit, the GC can be triggered for every allocation in a series of small allocations if compiled with --gc:markandsweep, leading to massive overhead.


For example, on my machine the following code runs in 50ms with the default GC, but takes nearly 4 seconds with --gc:markandsweep.

const n = 1_000_000

type T =
  ref object
    val: int
    next: T

proc main =
  var t: T = nil
  for i in 1..n:
    t = T(val: i, next: t)

@Araq Araq closed this in 451377f Jan 13, 2019
narimiran added a commit that referenced this issue Jan 14, 2019
(cherry picked from commit 451377f)
Copy link

@timotheecour timotheecour commented Jan 14, 2019

maybe related to #10040

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

Successfully merging a pull request may close this issue.

None yet
3 participants