Skip to content

Improve efficiency of drb ID hash using reference queues#2104

Closed
headius wants to merge 4 commits into
ruby:masterfrom
headius:drb_without_id2ref_3
Closed

Improve efficiency of drb ID hash using reference queues#2104
headius wants to merge 4 commits into
ruby:masterfrom
headius:drb_without_id2ref_3

Conversation

@headius

@headius headius commented Mar 26, 2019

Copy link
Copy Markdown
Contributor

This PR builds on #2102, which is for https://bugs.ruby-lang.org/issues/15711.

This version requires the "weakling" library, for its
implementation of weak reference queues. It improves on the
weakref-only implementation by reducing the periodic reference
scan to a queue poll, which should be a no-op when there are no
queued references.

In order for this implementation to work in CRuby, the weakref
library would need to support reference queues, ideally backed by
the CRuby GC to make them efficient.

headius added 3 commits March 19, 2019 11:15
This implementation must periodically "clean" stale references
out of the underlying Hash, which requires an O(n) search.
To reduce the chance of this search happening, it only runs when
inserting a new entry into the weak mapping. Stale entries that
are discovered while retrieving entries are deleted individually.
This version requires the "weakling" library, for its
implementation of weak reference queues. It improves on the
weakref-only implementation by reducing the periodic reference
scan to a queue poll, which should be a no-op when there are no
queued references.

In order for this implementation to work in CRuby, the weakref
library would need to support reference queues, ideally backed by
the CRuby GC to make them efficient.
@k0kubun
k0kubun changed the base branch from trunk to master August 15, 2019 17:18
@k0kubun
k0kubun requested a review from seki December 31, 2019 09:05
@nobu nobu closed this Mar 31, 2026
@hsbt

hsbt commented Mar 31, 2026

Copy link
Copy Markdown
Member

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.

4 participants