Comments (5)
The chief problem here was that the in-memory RDF::Graph
implementation relied on the rather inefficient generic default implementation of the RDF::Queryable#query
method (the #first_subject
, #first_literal
, etc methods all use #query
under the hood).
I've fixed this in changesets c4b54f2 and 38aa925 by optimizing the in-memory implementations of RDF::Graph#query
and RDF::Repository#query
specifically for their respective internal data structures.
This resulted in a 30x overall speed-up when running your test script on my laptop, with the entire script now consistently finishing in about 110 seconds (using Ruby 1.9.1).
Note that there are definitely lots of other low-hanging opportunities for optimization remaining, so in case something's still too slow for you, just let us know. At present there hasn't been that much work on the in-memory implementations, with any and all improvements implemented only in response to user demand. Our recent focus has been more on scalability than performance, with some of the recent API improvements (for enabling the Cassandra storage adapter to scale up to half a billion triples) perhaps even having somewhat adversely affected the performance of the default in-memory storages. These kinds of performance issues are easy enough to fix as long as somebody just lets us know about them - so many thanks for the detailed issue and benchmark script, I hope to see more of these.
I'll release a version 0.2.2 today which will include these optimizations.
from rdf.
I've now released version 0.2.2. Do let me know how it works out for you.
from rdf.
Great - 0.2.2 completed the test in 75s on my machine, which is a huge improvement. Thanks! Perhaps when I get some free time (haha) I'll be able to pitch in and contribute to the low-hanging fruit.
from rdf.
Guess we can close this issue now, and open up new ones for future performance reports.
from rdf.
OK, great; closing the issue, let's open new ones if/when need be.
from rdf.
Related Issues (20)
- Is it possible to configure deterministic serialisation? HOT 4
- Support arbitrary vocabs + more robust `expand_pname` HOT 3
- RDF::NTriples::Reader does not `require 'strscan'` HOT 3
- Ruby 2.7.1, URI.decode is obsolete
- bad behaviour in RDF::List HOT 7
- blank nodes reuse memory addresses, causing problems for persistent stores HOT 3
- Is there a "prettier" HOT 1
- Is there a more 'elegant' way to do this? HOT 3
- Strange "file missing" error with 3.1.14 release HOT 6
- Comparing two repositories HOT 2
- Verbose warnings on 2.7+ Ruby HOT 2
- 3.2.1 removes `RDF::Repository::Implementation::SerializedTransaction` HOT 5
- Is it possible to change the standard prefixes? HOT 7
- docmentation: how to create new vocabs, and langage-tagged strings in vocabs HOT 3
- Weird `require 'enumerator'` issue caused by this gem HOT 5
- change from DateTime < Literal to DateTime < Temporal breaks downstream customization HOT 5
- Invalid argument @ rb_sysopen - (Errno:EINVAL) when using local files on Windows HOT 10
- RDF::Vocabulary.find on RDF vocab returns RDF class HOT 5
- Ruby regexp warning: character class has duplicated range HOT 10
- Errno::EINVAL using `each_statement` with a LARGE, local NTriples file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdf.