gannan08 / rdf-canonize-rs

Please see https://github.com/digitalbazaar/rdf-canonize-rs
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bench and slow operation #3

Open mattcollier opened 3 years ago

mattcollier commented 3 years ago

First, I want to make sure you're aware of this branch and its capabilities:

https://github.com/gannan08/rdf-canonize-rust/blob/1d2b3b250c3efc7a2e4e5043115b107dfb489a35/benches/README.md#L11-L12

Secondly, by adding timers and an accumulator, I have discovered that 2/3 of the time spent doing test044_canonize is in this one function:

https://github.com/gannan08/rdf-canonize-rust/blob/1d2b3b250c3efc7a2e4e5043115b107dfb489a35/src/urdna2015.rs#L302-L303

Presently, total runtime is approx 3ms for that test, and 1.95ms of that time is spent in create_hash_to_related.

The amazing thing is, that 24 hours ago a test iteration was 9-10ms!

I've been journaling progress here: https://app.gitbook.com/@digitalbazaar/s/rust/v/master/rdf-canonize-optimizations

mattcollier commented 3 years ago

Another day, another millisecond! Well done!

https://app.gitbook.com/@digitalbazaar/s/rust/v/master/rdf-canonize-optimizations

# 20201227 9:28A main#fe6b20720b786d9c69c3c8f0ed024c756c2832bc

running 1 test
test tests::bench044_canonize ... bench:   2,969,265 ns/iter (+/- 59,469)

# 20201228 main#843a4c0f881df48bc6aedcd3c9f057ea24dde730 reduce cloning overhead

running 1 test
test tests::bench044_canonize ... bench:   2,029,147 ns/iter (+/- 48,274)