oscoin / osrank-rs

A pre-alpha osrank implementation in Rust.
http://oscoin.io/
3 stars 3 forks source link

Play with benchmarking code: remove the need for extra csv files #27

Closed adinapoli-mndc closed 5 years ago

adinapoli-mndc commented 5 years ago

This is an experiment to get back into Rust after my holidays. I have piggybacked on my review of #21 and played with removing the need for the extra .csv files, but building a Vec<u8> in memory. It's a bit laborious but it can be done, and probably code-golfed by some more experienced Rust programmer.

Screenshot 2019-08-20 at 09 35 05

The advantage is that we don't need those extra files anymore, the cons is obviously that initialisation is slower due to the fact we now need to keep potentially-large file(s) in memory.

@MeBrei , if you decide you like this and want to merge it, we might want to completely erase those .csv files from the Git history, by rewriting history. Not a huge problem per se, but if they were big, it might be worth a shot πŸ˜‰

Let me know what you think!

ps. it looks like there were a bunch of lint warnings caught by my editor in the bench file -- it might be a good idea for you to spent a bit of time configuring your editor such that it runs cargo-fmt automatically and warns you about linting stuff, so that working on the repo is a tag more conflict-friendly. Not urgent though! πŸ˜„