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

optimize sparql.Bindings #1192

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Conversation

FlorianLudwig
Copy link
Contributor

@FlorianLudwig FlorianLudwig commented Oct 23, 2020

This improves performance 13% on the rdflib-benchmark with the default (memory) store and a store size of 4k.

Moving straight to collections.ChainMap was considered but

  1. Bindings behaves differently when one key is in multiple dicts, as they are iterated over multiple times and also counted on __len__ multiple times
  2. The API is a bit different, increasing the changes size

I do think that the differences for __len__ and __iter__ are unintentional / bugs. If so, I would rework this MR to fix those.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 75.434% when pulling 5574acc on FlorianLudwig:sparql-speedup into dde9db8 on RDFLib:master.

@coveralls
Copy link

coveralls commented Oct 23, 2020

Coverage Status

Coverage remained the same at 75.477% when pulling 07bc739 on FlorianLudwig:sparql-speedup into 6c294aa on RDFLib:master.

@nicholascar
Copy link
Member

Test passing and this has been here for a while so I'll merge

@nicholascar nicholascar merged commit e366457 into RDFLib:master Mar 5, 2021
@white-gecko white-gecko added this to the rdflib 6.0.0 milestone Mar 22, 2021
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