Hello,
I developed a scripting engine that has many builtin functions, so far to call any function code just went into a if .. else if .. else if
wall checking the name but I would like to develop a more efficient solution.
Shoul I use a hashmap with strings as keys and pointers as values. How could I do it by using an STL map?
EDIT: Another point that came into my mind: of course using a map will force compiler not to inline functions but my unefficient approach didn't have any overhead generated by the necessity of function calls, it just executes code.
So I wonder if the overhead generated by the function call will be anyway better than having a if..else
chain.. otherwise I could minimize the number of comparisons by checking a character at time (will be longer but faster).