#vectors use spookyhash except when they don't
1 messages · Page 1 of 1 (latest)
literally the name of the algorithm
its not bad, its just slower than a less safe alternatives
ah I see
ie if you need 100k hashings per frame it can be an issue
I'm assuming you just read their released c# code to figure it out?
i see so you determined what it was based on the speed?
it is SpookyHash128() method in deep profiler
lmfao oh
literally or something
ok I'm going to see what float2 uses - or at least what it's called and how long it takes
I'll ask you when I get the results in ab idk 5 minutes, because if it takes less time that'd be great because I will be doing a bit of hashing and if it can shave off a millisecond or two combined with some other stuff that'd be great
hm, discard that
my tests were for v3 converted to v2(x,z)
raw v3 was slower, obviously, i made wrong conclusions
and i drop decimal places
i'll do both vector2 and float2
i convert each axis to short, get first/second byte, shove them into array of 4 bytes, then read array as int through memory marshal
yeah dont listen, i did that for domain specific task, this has little value outside of it
scrubbing through why can I not find it!?
yea ik im on frame 0 in that picture but still
yield return wait for seconds
hmm?
2 second offset before your ops start
heh
im sure it still took time, just was less than 0.01ms
check float3 and v3
so i replicated the test
and trying to find in which conditions a vector gets hashed with https://github.com/Unity-Technologies/UnityCsReference/blob/master/Runtime/Export/Hashing/HashUtilities.cs#L21
what version are you in
and what version is this in
I'm in 2022.3.7, is it possible it was changed?
were you bursting your code when you profiled it?
i mean if it was bursted it should have been way faster
thats probably why f2/f3 take longer to get hashcode cus it's meant to be bursted
vectors use spookyhash except when they don't
haha im so confused HashUtilities.QuantisedVectorHash() is what i saw a normal vector use
did you just call the .GetHashCode function?
also this