Author Topic: Own Apis Declarations  (Read 2818 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Own Apis Declarations
« on: August 06, 2014, 09:36:33 AM »
Deleted!
« Last Edit: March 12, 2015, 10:51:55 AM by Peter »

Mike Lobanovsky

  • Guest
Re: Own Apis Declarations
« Reply #1 on: August 06, 2014, 11:24:52 AM »
Peter,

I would suggest

Code: [Select]
............
sn = sin(0.8 * f) * 160-x+160
cs = cos(1.2 * f) * 100-y+100
c2 = sqr(sn*sn + cs*cs)
............

to make it run ultimately fast. Oxygen doesn't have an optimizer to rearrange the code in such a way automatically. By the way, the language from which you took this snippet literally doesn't have any such optimization either.

Mike Lobanovsky

  • Guest
Re: Own Apis Declarations
« Reply #2 on: August 06, 2014, 01:04:43 PM »
Sure.

But something is telling me the code came all the way from there. :)

Lua doesn't have code optimization to fix these expressions so such coding style would be a speed killer for its interpretative environment. We're just not seeing this here thanks to the underlying JIT assembly. But the lag is there anyway.

Mike Lobanovsky

  • Guest
Re: Own Apis Declarations
« Reply #3 on: August 06, 2014, 01:43:33 PM »
Why Peter, thanks! :)

I am simply not registered at that forum and I cannot criticize Cybermonkey directly. This is why it's you who is the object of my trolling, simply because you didn't look at his careless implementation at a critical angle.

Please don't get angry with me. I am all for cleaner and faster code and not after you personally. I would have chased your friend Aurel with similar criticisms had it been his submission and not yours. :)

Mike Lobanovsky

  • Guest
Re: Own Apis Declarations
« Reply #4 on: August 06, 2014, 02:15:56 PM »
So, either your way or no way again?

Well, well... Happy coding! :-X