On Tue, Feb 06, 2018 at 09:44:16PM +0000, Ralph Doncaster via Digitalmars-d wrote: [...] > Although I'm new to D, I do know crypto quite well, and especially > sha3/keccak. One reason I considered porting was to see if dmd outputs > better code than gcc. On x86_64 with the xmm registers there is enough room > for 1600 bits of the keccak state to be stored in registers, but gcc 5.4 > will still use RAM for the state. It stays in L1, but storing all the state > in registers should be much faster as it would avoid a lot of mov > instructions loading parts of the state into registers.
Don't have high expectations of dmd's codegen. If you're looking for highly-optimized codegen, you want to be using ldc or gdc instead. In my own projects, I routinely find that executables produced by dmd are about 30-50% slower than executables produced by gdc or ldc. What dmd is very good at is lightning fast compilation, and also having the latest and greatest D features, being the reference compiler and all that. However, it's optimizer leaves much to be desired. For performance-sensitive code, my recommendation is, don't even bother with dmd. That's not to say that dmd codegen is bad; it's pretty decent for your average non-performance-sensitive GUI app. But it doesn't hold a candle to gdc/ldc, especially when it comes to loop optimizations. T -- Дерево держится корнями, а человек - друзьями.