You know decades ago people invented this little thing call #ifdef right?
Just use #ifdef _MSC_VER/#else/#endif around the inline assembly if you want to bypass MSVC.
Even simple crap like switching to --i instead of ++i, will reduce assembly instructions regardless of what optimization flags you use on the compiler.
Why the hell is Core still stuck on LevelDB anyway?
The same reason BDB hasn't ever been replaced, because even after a softtfork
and a hard fork, new wallets must still be backwards-compatible with already nonfunctional 2011 wallets.
Most CPU is running idle most of the time, and SSD is still expensive.
So just use RocksDB, or just toss in a lz4 lib, add an option in the config and let people with decent CPU enable compression and save 20G and more.
I just copied the entire bitcoind dir (blocks, index, exec, everything) onto a ZFS pool with lz4 compression enabled and at 256k record size it saved over 20G for me.
Works just fine, and ZFS isn't even known for its performance.
Doesn't matter how many life time people spent on it, when you see silly shit like sha256() twice, you know it's written by amateurs.
Here, your internal sha256 lib, the critical hashing function all encode/decode operation relies on, the one that hasn't been updated since 2014:
https://github.com/bitcoin/bitcoin/blob/master/src/crypto/sha256.cpp
SHA256 is one of the key pieces of Bitcoin operations, the blocks use it, the transactions use it, the addresses even use it twice.So what's your excuse for not making use of SSE/AVX/AVX2 and the Intel SHA extension? Aesthetics? Portability? Pfft.
There are mountains of accelerated SHA2 libs out there, like this one,
Supports Intel SHA extension, supports ARMv8, even has MVSC headers:
For AVX2, here is one from Intel themselves:
There is your 70% speed up for a single critical operation on your hot-path.
This isn't some advanced shit, that Intel patch was created in March 26, 2013, your sha256 lib was last updated in Dec 19, 2014, so the patch existed over a year before your last update. We have even faster stuff now using Intel SHA intrinsics.
QFT and mined for the gold.
It is very rare these days that someone outside the core team is so helpful to them as in this post. Most outside core would be just as happy to see core fade away instead of being so very helpful as TB is being here, albeit TB was masterfully trolled by GM into doing GM's job for him, it is just as likely that GM's ego or outside incentives will prevent him from taking any of this helpful advice to heart.
Most interesting here is that TB has found where Core team have added the Big-O Quadratic Sighash bug which is their big issue of why then need SegWit and can't scale.GM shoots Bitcoin in the leg, TB shows him the wound, the blood, the gunpowder marks on his hand and hands him the surgical kit.
GM sits there mocking him and shrugging.
Bitcoin's blood leaking out while GM stares around wondering why he doesn't get more love.