pchampin / sophia_rs

Sophia: a Rust toolkit for RDF and Linked Data
Other
210 stars 23 forks source link

Loading FastGraph more than 10 times faster in release builds than with cargo run #120

Closed KonradHoeffner closed 1 year ago

KonradHoeffner commented 1 year ago

I get really strange results when I load a 3.6 GB N-Triples file with 16 million triples into a FastGraph:

When I just use "cargo run" it takes nearly 5 minutes (548s, 552s in two runs on an Intel Core i9 12900k with a Samsung 980 Pro 1TB). However when using "cargo build --release", it takes only 44-47s, which is a speedup of more than a factor of 10. Is that expected behaviour and a problem with Rust itself or is that something that could be fixed in Sophia itself?

Tpt commented 1 year ago

cargo run by defaults compiles to debug mode without optimizations. You should run cargo run --release to run in release mode.

KonradHoeffner commented 1 year ago

@Tpt: Thanks, that worked! However I am still wondering if that large of a difference is normal or if that points to some kind of fixable problem. I know that release is faster than debug mode but I thought it would be much less than 10 times as fast.

KonradHoeffner commented 1 year ago

Oh I just read at https://nnethercote.github.io/perf-book/build-configuration.html that this is normal, so my question is answered. Thanks again! I will close this issue.