Login  Register

Contributing to VoyageMongo (improving insertion/updating speed)

Posted by Holger Freyther on Jul 23, 2015; 10:22am
URL: https://forum.world.st/Contributing-to-VoyageMongo-improving-insertion-updating-speed-tp4838806.html

Hi,

I wanted to benchmark some look-ups with VoyageMongo and tried to insert
some dummy objects and it was quite slow (pharo takes 99% CPU and mongo
is idle). Using the nice profiler i noticed that VOMongoRepository>>#newVersion
calls UUIDGenerator new makeSeed which will take quite long.


  [UUIDGenerator new makeSeed] bench '96.9 per second.’

I am running this on OSX so it will end up in >>#makeUnixSeed which will open
/dev/urandom. I needed cryptographic random numbers in another project and
used NativeBoost to call into libcrypto of OpenSSL and use the RAND_bytes
function to get them.


 [ (RAND rand: 4) asInteger ] bench '588,000 per second.’


The quality of the random numbers should be comparable and now I wonder how
I can help integrating such a change.

From my point of view I can either patch Voyage-Mongo-Core to be able to
use other random number sources. Or I could add another “seed” source to
the UUIDGenerator. What would be the preferred approach and how to move
forward? Is NativeBoost something one could rely on in upcoming Pharo versions?

For a simple insertion of a class with a couple (~5) fields the insertion time for
1000 items goes from ~10s to ~250ms.

How can I move this forward?

        holger