Repository navigation
Hypot op #474
alexneufeld
started this conversation in
Show and tell
Hypot op
#474
Replies: 1 comment
|
Thanks for the report! I had done similar experiments, and came to a similar conclusion – it seems like it should help, but I didn't see any real change in practice. The JIT performance doesn't specifically surprise me, though: I think that the JIT would generate nigh-identical machine code for the manual (my implementation was at the tape level, and I just pushed the It may still be worthwhile for the GPU implementation, where tape space is at more of a premium... |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I noticed that$\sqrt(x^2+y^2)$ is a common idiom in SDFs.
The wikipedia page on Pythagorean addition has this fun quote:
In theory, adding a Hypot operator should make some instruction tapes shorter and therefore faster to compute. Example trees for the dreaded box sdf:
before:
after:
So I made a prototype branch with just enough code to test a JIT float-slice evaluator
The results are not promising, even for a favorable benchmark of nothing but hypotenuse calculations:
benchmark code
This was a just-for-fun experiment, but maybe also a useful datapoint. I had some fun poking at fidgets internals at least :)
All reactions