[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] How To Restore Formula Speed?



PureBytes Links

Trading Reference Links

Hello,

Use
AFL Editor,
Tools->Check and Profile
to find the bottleneck in your code. 

Most often people are
calling the same funciton over and over many times when
they should call it ONCE and store the result in variable.
This the most basic improvement can be applied to 99% of
formulas written and posted here to get a lot more speed.
The other thing is that you move all array function calls OUTSIDE
loops. That's second principle: *never* call array function
inside loop , unless you are doing something like iterating
through multiple symbols. But NEVER call array funcitons
inside per-bar loop.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "ondrej.uhlarik" <ona@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, May 11, 2008 2:44 PM
Subject: [amibroker] How To Restore Formula Speed?


> Hello,
> I have programed quite a complicated indicator in AFL. When I load it 
> in a pane it significantly slows down scrolling speed and reaction 
> speed in general. That I find very annoying, so I made a Toggle 
> parameter to switch between 2 modes: Basic (which does not show so much 
> but does not affect speed so much either) and Advanced (which shows 
> everything and affects speed a lot). Now the problem is as follows:
> I insert the indicator in a pane in the Basic mode and the speed is ok. 
> Then I switch to the Advanced mode and the speed gets worse. Then I 
> switch back to the Basic mode but the speed remains bad, i.e. the 
> original speed is not restored. It seems that the Advanced data are 
> still loaded in some memory cache and affect speed of the indicator 
> even if I switch back to the Basic mode. Is there any chance to clear 
> or reset the data loaded in memory (or whatever) without removing the 
> indicator from the pane and re-inserting it back?
> Thank you for your ideas, and please keep in mind that I am a beginner 
> in programing :)
> 
> 
> ------------------------------------
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> Yahoo! Groups Links
> 
> 
> 

------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/