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

[amibroker] Re: Question about JScript/VBScript & DLL's...


  • Date: Mon, 08 Mar 2010 15:50:51 -0000
  • From: "jooleanlogic" <jooleanl@xxxxxxxxxxx>
  • Subject: [amibroker] Re: Question about JScript/VBScript & DLL's...

PureBytes Links

Trading Reference Links

For loops and array access, yes there is a significant speed difference in C.

Just think of it this way Sid,
your afl loop in a dll will take about as long as any other inbuilt afl function does.
If an MA call on your machine takes a few milliseconds, then that's roughly as long as your afl loop in a dll will take, depending of course on what you're doing in that loop.

To give you an idea, on my computer, the following simple afl code takes about 200ms on half a million bars. The equivalent Cum(1) call takes about 5ms.

mycum = 0;
for (bar=1; bar<BarCount; bar++){
	mycum[bar] = mycum[bar-1] + 1;
}

Going by the Amibroker profiler, it's roughly 100ms for the loop itself and 40-50ms for each array access. In C, the loop itself is virtually a non event of a few milliseconds, freeing up a couple of hundred ms for your actual code inside the loop.
This is why you should always try and use the built in functions and array arithmetic operators where possible.

Jules.


--- In amibroker@xxxxxxxxxxxxxxx, "Rob" <sidhartha70@xxx> wrote:
>
> Hi,
> 
> Sorry if this is a silly question... but having come a long way with AFL and feeling like I can do pretty much everything I need to within AFL, I am now wondering about the use of JScipt/VBScript and DLL's...
> 
> In what circumstances would one use JScipt/VBScript or write a custom DLL...? What are the advantages to their use...?
> 
> If someone would be kind enough to just give me a brief outline I'd appreciate it...
> 
> TIA
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/