Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPerformance is worse than terrible #277
Comments
This comment has been minimized.
This comment has been minimized.
vaffeine
commented
Sep 23, 2018
|
I took a quick look at the problem with callgrind. The first thing that caught my eye was a huge amount of allocations caused by in bson::OrderedDocument::clone(), and then the same amount of deallocations, when OrderedDocument is dropped. In case of your gist OrderedDocument::clone() is called 9046, which results in 243000 calls to both __rust__alloc and __rust_dealloc at the bottom of the call stack. |
This comment has been minimized.
This comment has been minimized.
inv2004
commented
Sep 24, 2018
•
|
Thank you, its s good point, because mongo_driver uses doc by ref also. Unfortunately, I do not think that these allocations is the main point, because initial problem was found in the code, which generates uniq doc's. Also, I did not make any special benchmarks, but I see that .find in mongo_driver is even much faster than mongodb. ~5k/1sec (native) vs ~15k/1sec (WSL) |
This comment has been minimized.
This comment has been minimized.
inv2004
commented
Oct 17, 2018
|
Would you like me to do another test without allocation? Regards, |
inv2004 commentedSep 23, 2018
•
edited
mongodb = "0.3.10"
rustc --version
rustc 1.30.0-nightly (4591a245c 2018-09-22)
mongod --version
db version v4.0.2
Rust:
https://gist.github.com/inv2004/87b49ee4217872d9260e13a09e6bf524
Go:
https://gist.github.com/inv2004/d8e397ee7d0553940b60dff7f3005540
---added---
mongo_driver:
real 0m0.583s