Skip to content

Conversation

@jrevels
Copy link
Member

@jrevels jrevels commented Sep 28, 2016

If a benchmark is "slow" (e.g. doesn't require multiple evaluations per sample to overcome timer error) then it's likely worth it to run GC between samples (a feature which is normally turned off by default).

This PR originally sought to make GC behavior more stable when running many benchmarks in succession by finding more conditions in which GC should be manually triggered. However, it turns out that gc() only triggers a single sweep, meaning that young objects don't get freed (just marked, I'm guessing). Doing multiple sweeps every time we manually trigger GC does a much better job of freeing stale objects leftover from previous benchmarks.

This PR replaces manual calls to gc() with calls to gcscrub = (gc(); gc(); gc(); gc()). Four sweeps might be overkill, but I'm unsure of how many "marking levels" exist between object youth and object freeing in a general case.

Thanks to @vchuravy for suggesting I play around with using multiple sweeps.

…is more effective at "resetting" state than a single sweep
@jrevels jrevels changed the title auto-enable gcsample for slower benchmarks Trigger multiple GC sweeps between samples/trials instead of a single sweep Sep 29, 2016
@jrevels jrevels merged commit ce011cd into master Sep 30, 2016
@jrevels jrevels deleted the jr/gcsample branch September 30, 2016 12:22
jrevels referenced this pull request in JuliaLang/julia Oct 1, 2016
jrevels referenced this pull request in JuliaLang/julia Oct 4, 2016
* Make application/julia a text MIME

* Use trait instead of istextmime

* Add a @pure annotation

* Run genstdlib

* Move deprecation to deprecated.jl

* Use boolean instead of traits

* Fix deprecated @textmime

* Fix @textmime depwarn message

* Undo accidental re-helpdbification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants