A few things:

- The little ARM in the iPad 3 is nothing compared to your desktop. Not only is 
it not as fast, it doesn't have the memory bandwidth. Also, an iPad 4 will be 
twice as fast.
- make sure you're running optimized code. You can set optimization flags on 
individual files (that's what I do in our compute-heavy code, so I can run 
debug releases for the UI but leave the computation optimized).
- Find a way to compute less. Algorithmic optimizations are key here. Maybe a 
larger step size?
- Can you break up the work into multiple tasks? That will allow you to 
parallelize the work. At the very least, make sure you're doing it on a 
separate dispatch queue/NSOperationQueue so it doesn't block your main UI.

On Aug 7, 2013, at 13:50 , Trygve Inda <[email protected]> wrote:

> I have an app that is running slow. I have narrowed it down to several
> functions which are trig-intensive (used to calculate the position of the
> moon at a given moment and more specifically to calculate rise/set times).
> 
> To calculate the position and rise/set times for a month on average,
> requires:
> 
> 300 trig functions for position
> 24 points in time to find the correct set of three points
> 30 days
>  2 events
> 
> Total of 432,000 trig functions (mostly sin and cos)
> 
> On my iPad 3, this takes about 3 seconds, and on my desktop (2.3GHz
> Quad-core i7) it is nearly instantaneous.
> 
> I am using doubles (not floats).
> 
> What can I do to speed this up?
> 
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to [email protected]


-- 
Rick




_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to