Jump to content
Sign in to follow this  
Valik

Speeding Up Function Lookups

Recommended Posts

I've moved it back to the static way and it was a few KB larger than initializing inside the constructor, so back to that method :huh2:

The current size is 198KB (90.5KB compressed).

That's a few KB larger than the previous version but there are many new (and small functions) that could account for that. Quick poll then on "do we keep the new method"? It _is_ a lot neater..

:D

Edited by Jon

Share this post


Link to post
Share on other sites

Well, I didn't like the case structure since the first time I saw it. It was too messy for me and required me to do more work than just simply telling AutoIt the name and parameters for my new functions, so I definitely would like to see this new stuff stay.

Share this post


Link to post
Share on other sites

If it still can work under VC6, I say go for it! Hmm, maybe I should try that compiler that Larry's using.


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

New thought! (Yeah, I get them every now and then)

Jon, setup the array in the FuncList constructor.

class CFuncList 
{
private:
   enum { List_Size = 88 }; // or how ever many functions there are
   CFuncEntry list[List_Size];  

public:
   CFuncList(void);
};

CFuncList::CFuncList(void)
{
    int i=0;

    list[i++]=CFuncEntry("abs", f_abs, 1, 1);
    list[i++]=CFuncEntry("adlibdisable", f_adlibdisable, 0, 0);
. . .
    list[i++]=CFuncEntry("winwaitnotactive", f_winwaitnotactive, 1, 3);
    ASSERT(i == List_Size);
}

Now we do not need a static initializer and the functions can be called from within the CFuncList directly. :D


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...