What is Nostr?
Michael Grønager [ARCHIVE] /
npub15fm…lq6h
2023-06-07 02:48:48

Michael Grønager [ARCHIVE] on Nostr: 📅 Original date posted:2011-12-15 🗒️ Summary of this message: A request for ...

đź“… Original date posted:2011-12-15
🗒️ Summary of this message: A request for someone to update the CDataStream test table in the code, as the arguments for the custom stream are way off compared to stringstream.
đź“ť Original message:OK, I admit that this is *really* of little importance...

But could someone with commit rights please update the CDataStream test table in the code. The arguments for the custom stream are just way off (stringstream wins by factor 10-20!). On OS X (g++) I get:

Further, if you get(got) bad stringstream numbers on e.g. windows (dikumware had some issues several years ago) you can improve just by changing the default allocation chunk size. So... speed is not a reason for reimplementing stringstream. (And perhaps this can motivate someone to revert bitcoin to stringstream ;-)

Cheers,

Michael

PS: Could be fun to see the output on other OS'es !

serialize.h (with TESTCDATASTREAM defined, i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)):

CDataStream:
n=1000 0 seconds
n=2000 0 seconds
n=4000 0 seconds
n=8000 0 seconds
n=16000 0 seconds
n=32000 0 seconds
n=64000 1 seconds
n=128000 1 seconds
n=256000 2 seconds
n=512000 4 seconds
n=1024000 8 seconds
n=2048000 17 seconds
n=4096000 40 seconds
stringstream:
n=1000 0 seconds
n=2000 0 seconds
n=4000 0 seconds
n=8000 0 seconds
n=16000 0 seconds
n=32000 0 seconds
n=64000 0 seconds
n=128000 0 seconds
n=256000 0 seconds
n=512000 0 seconds
n=1024000 0 seconds
n=2048000 1 seconds
n=4096000 2 seconds
Author Public Key
npub15fmnxm546tg2sv0l7elusrvqsgezdzdg3m0flpml5fr2qf3f5slskxlq6h