Skip to content

RDF::Graph existence test methods generate unnecessary work#452

Merged
gkellogg merged 1 commit intoruby-rdf:developfrom
doriantaylor:speed-up-rdf-graph
May 12, 2025
Merged

RDF::Graph existence test methods generate unnecessary work#452
gkellogg merged 1 commit intoruby-rdf:developfrom
doriantaylor:speed-up-rdf-graph

Conversation

@doriantaylor
Copy link
Copy Markdown
Contributor

Hi, just noticed a two-order-of-magnitude slowdown on RDF::Graph#subject? etc. vs the same operation on RDF::Repository, because it inherits those methods from RDF::Enumerable. I just popped in some short-circuited ones and the effect disappears.

Since I'm in here though, are there any other methods I should be short-circuiting?

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 91.731% (+0.01%) from 91.718%
when pulling 6b1b433 on doriantaylor:speed-up-rdf-graph
into f52e8cc on ruby-rdf:develop.

Copy link
Copy Markdown
Member

@gkellogg gkellogg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, there may be some other places in RDF::Graph, as it does have an odd relationship to RDF::Repository and the mixins.

@gkellogg gkellogg merged commit cae8390 into ruby-rdf:develop May 12, 2025
9 checks passed
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.

3 participants