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

Closed
rbehrends opened this issue Jan 11, 2019 · 1 comment
Closed

Performance regression with --gc:markandsweep #10271

rbehrends opened this issue Jan 11, 2019 · 1 comment

Comments

@rbehrends
Copy link
Contributor

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.

Example

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)

main()
@Araq Araq closed this as completed in 451377f Jan 13, 2019
narimiran pushed a commit that referenced this issue Jan 14, 2019
(cherry picked from commit 451377f)
@timotheecour
Copy link
Member

maybe related to #10040

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

3 participants