Ok. The new voxel rendering algorithm performs 1.4 times faster. Not much, but voxel models can also be split into 16-bit chunks, which locally use only 16-bit addressing. That should speedup the algorithm further, if the bottleneck is with the memory bandwidth.
I've also discovered that GCC's __builtin_popcount is slower than a lookup table, since it branches into subroutine __popcountdi2. Why GCC doesnt use the x86 popcnt opcode? No idea. No idea. But it probably would be easier to answer why Stallman molests little children.
Name:
Anonymous2020-10-06 9:11
For a long time I have been using a hashtable library made by other people. It had its drawbacks. In particular I have to acknowledge the original authors in the credits of my software, and its hash function is far from being perfect.
For example, here is their hash Bernstein function applied to the various modifications of the string "hello": 0f8fff15: hallo 0f908b76: hbllo 0f9117d7: hcllo 0f91a438: hdllo 0f923099: hello 0f92bcfa: hfllo 0f93495b: hgllo 0f93d5bc: hhllo 0f94621d: hillo 0f94ee7e: hjllo 0f957adf: hkllo 0f960740: hlllo 0f9693a1: hmllo 0f972002: hnllo 0f97ac63: hollo 0f9838c4: hpllo 0f98c525: hqllo 0f995186: hrllo 0f99dde7: hsllo 0f9a6a48: htllo 0f9af6a9: hullo 0f9b830a: hvllo 0f9c0f6b: hwllo 0f9c9bcc: hxllo 0f9d27ee: hyll0 0f9d27ef: hyll1 0f9d27f0: hyll2 0f9d27f1: hyll3 0f9d27f2: hyll4 0f9d27f3: hyll5 0f9d27f4: hyll6 0f9d27f5: hyll7 0f9d27f6: hyll8 0f9d282d: hyllo
Obviously the hash code is patterned and these paterns depend heavily on the input string. That is important since in real life we almost always have a house addresses differing in just a single letter or program identifiers, like var1, var2, var3, so such hash wont work with real world data. There is also this Jenkins hash, it is far better and works with real life data, but a bit more expensive and still has patterns recognizable by naked eye without any statistical analyzis. So I have devised my own hash function based on several 8-bit tables. It can be further improved indefinitely by adding more tables: