Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Modify GC.stats to allow requesting specific stats #2193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mihails-strasuns-sociomantic
Copy link
Contributor

Relevant to #2155 and #1846 and potentially more future PRs. This should be a mostly backwards-compatible change
that enables adding more stats with less performance concerns.

Natural drawback is of course that it will only work until Stats has 64+ fields :) Alternative I have in mind is to define Optional type in druntime and use that for Stats fields - but that is quite more intrusive change.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @mihails-strasuns-sociomantic!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2193"

@mihails-strasuns-sociomantic
Copy link
Contributor Author

FYI @leandro-lucarella-sociomantic

@mihails-strasuns-sociomantic
Copy link
Contributor Author

(in the meanwhile I am trying to implement alternative to resurrect #2164)

@leandro-lucarella-sociomantic
Copy link
Contributor

As I said in #1846 (comment), I think the right approach is to enable/disable stats calculation globally instead of doing it at query-time, as we should aim to completely remove the heavy calculations when using gc_query(). Ideally it should just copy some pre-calculated stats and that's it.

Unfortunately I didn't have the time yet to try to move forward with this...

src/core/memory.d Outdated Show resolved Hide resolved
@thewilsonator thewilsonator self-assigned this Nov 9, 2018
@thewilsonator thewilsonator added the Needs Rebase needs a `git rebase` performed label Nov 9, 2018
@dlang-bot dlang-bot removed the Needs Rebase needs a `git rebase` performed label Nov 17, 2018
@rainers rainers added the GC garbage collector label Dec 24, 2018
@dlang-bot dlang-bot added Needs Rebase needs a `git rebase` performed Needs Work stalled labels May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
GC garbage collector Needs Rebase needs a `git rebase` performed Needs Work stalled
Projects
None yet
6 participants