[futurebasic] Re: [FB] FB Core app and OSX Certification

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2004 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Tue, 2 Mar 2004 17:40:28 +1300
David Cox wrote:

> I have developed a working FB app for a company and their technical 
> guru has suggest my app be changed to be:
> 1)       Programmed as a core app rather than using scripting to lower 
> CPU usage
> 2)       Mac OSX certification.

The guru's suggestions are mumbo-jumbo.

However, an FB^3 app, even if not actually doing anything, tends to 
consume 0.5-2% of CPU time by receiving a stream of null events at 
2-tick intervals (30/s).
'-----
do
HandleEvents
until 0
'-----


Most programs do not need null events, and would benefit from a tweak:

'-----
poke long event - 8, 0xFFFFFFFF // no null events
do
HandleEvents
until 0
'-----

With this change, an idle app will consume no CPU time at all.

Of course this won't work if your app is polling from the event loop, 
or using animated cursors, or the FB 'on timer...' mechanism.  But you 
can often increase the default 2-tick interval between null events, for 
example:

poke long event - 8, 5 // null events every 5 ticks (12/s)


Robert P.