Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bitwise operators for faster Math functions #196

Open
IQAndreas opened this issue Dec 1, 2013 · 6 comments
Open

Use bitwise operators for faster Math functions #196

IQAndreas opened this issue Dec 1, 2013 · 6 comments

Comments

@IQAndreas
Copy link
Member

As brought up by @Dovyski in #142 (comment)

@mezkhalin
Copy link

If it's not a problem I am happy to take on this issue

@Dovyski
Copy link
Member

Dovyski commented Feb 2, 2014

Awesome! :) You can start working on this right now, if you want, but I think it's better if you could hold on until Andreas has organized FlxG/FlxU (issue #142).

@mezkhalin
Copy link

Wonderful! I'll wait until the reorganization then, could prove cumbersome otherwise ;)

@greysondn
Copy link

The comments give a page which may or may not be of use during this process:
http://graphics.stanford.edu/~seander/bithacks.html

It is important to bench the results to be sure it's actually doing good instead of just taking it at face value (and will have to be retested from time to time); I have found such things as I've searched them out to be hit-and-miss chiefly dependent on age. One of the comments there notes:

This was tested with the standalone flash player 9 on windows. but I assume that nowadays the results are out of date and differ greatly.

The simplest test for execution time is to wrap in getTimer() calls such that timeElapsed = timeNow - timeBefore; accuracy is varied by platform but generally is down to the millisecond level somewhat reliably for that test.

Once I have cleared my current docket of assurances here in flixelCommunity, I would be happy to assist in this process if needbe; however, I am considering those hung until the directory structure (and, by extension in AS3, API address for any given component) stabilizes, for various reasons.

Edit: Typos, silliness... I'm too emotive for this line of work...

@Dovyski
Copy link
Member

Dovyski commented Mar 6, 2014

That's a good observation, @greysondn A few bench tests won't hurt.

@Dovyski
Copy link
Member

Dovyski commented Apr 28, 2014

Faster sin function: http://guihaire.com/code/?p=520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants