Hacker News new | past | comments | ask | show | jobs | submit login

Interesting:

...a single Python process using gevent and pymongo can copy a large MongoDB collection in half the time that mongodump (written in C++) takes, even when the MongoDB client and server are on the same machine.




I would guess this is for the reason posted in the article: the Python code is multithreaded (sort of, gevent) but the C++ code is only single threaded.


Sure, but that seems to suggest a meta-reason: the standard utility included with the package isn't asynchronous [sort of orthogonal to threadedness] because it would be a PITA to write an asynchronous utility in C++.


That's not true, I've had no trouble writing very fast threaded C++ programs with the mongo client.


1. That's not what I said.

2. I'm sure the Mongo devs would accept pull requests for mongodump.


1. > it would be a PITA to write an asynchronous utility in C++

2. Doubt it, and there's no reason for me to write one for them.


Asynchronous ≠ multithreaded. TFA actually tried both ways, measured the difference, and found async to be much faster.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: