Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How to Measure Code Snippet Performance?

Name: Anonymous 2019-08-19 22:49

Name: Anonymous 2019-08-20 5:46

virus

Name: Anonymous 2019-08-20 6:44

>>2
where?

Name: Anonymous 2019-08-20 8:19

The CPU of typical contemporary x86 laptop can do around 17,253,000,000 square roots per second (with SQRTSD instruction). For comparison, the display has 4,096,000 pixels. Given that we can sqrt as much as we want - it isn't any more costly than other basic arithmetic operations.

Name: Anonymous 2019-08-20 8:44

>>4
If you're doing SQRTs at this rate something is wrong with your code.

Name: Anonymous 2019-08-20 8:47

>>5
Sqrts are used for light calculation and distance in general. Also sqrt can be used for sRGB gamma compression, if you don't have fast pow(x,1/2.2)

Name: Anonymous 2019-08-20 9:02

>>6
It sounds like you're deliberately avoiding using the GPU for some reason

Name: Anonymous 2019-08-20 11:56

>>7
I'm too lazy to learn OpenGL.

Name: Anonymous 2019-08-20 14:09

>>8
You can use OpenCL(GPU compute) to compute the sqrts.
https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/sqrt.html

Name: Anonymous 2019-08-20 19:39

>>9
Of course,if someone calculates 17 billion sqrts per seconds, a GPU will be faster, but in one indie game its unlikely that very much of it occurs(maybe a few thousands sqrts?), so CPU will be faster because of lower latency.

Name: Anonymous 2019-08-20 21:30

>>9
The trick is that you don't need sqrts in abstract space, you need sqrts in context of other computations.

Name: Anonymous 2019-08-21 3:33

>>11
8 to 16bit floats can have a sqrt lookup table that is faster.16bits x 32k entries=64kbytes.

Name: Anonymous 2019-08-29 11:23

SQUARE MY ENIX

Name: Anonymous 2019-08-29 11:40

>>12
64kbytes LUT would trash the cache.

Name: Anonymous 2019-08-29 13:29

and I can't run it on my Commodore 64

Name: Anonymous 2019-08-29 21:17

What loungeramming language is this?

Name: Anonymous 2019-09-06 16:32

>>6
It sounds like you're deliberately avoiding using the GPU for some reason
That's because your ``encouraging'' me to use you're GPU when the CPU is fast enough for your're sqrts.

Name: Anonymous 2019-09-07 2:52

I recall that sqrt's can be avoided entirely by managing all computation in distance squared units(bit more complex than that)

Name: Anonymous 2019-09-08 16:54

You call this code?

Where's .travis.yml? Where's the tests/? Where's your badges and stars? Where's package.json?

Name: Anonymous 2019-09-08 17:46

>>19
left as an exercise to a reader.

Name: Anonymous 2019-09-08 17:50

>>18
That is what Norman J. Wildberger proposes in his rational trigonometry lectures, which is similar to Wolfram's ideas of physics. But you do need sqrt for non-theoretic work to normalize the vector.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List