[C++-sig] Profiling object instantiation... a preliminary report
Ullrich Koethe
koethe at informatik.uni-hamburg.de
Thu Mar 21 20:46:32 CET 2002
David Abrahams wrote:
>
> <<But then, why wouldn't it be possible to place a function into the
> table
> that does the lookup in another table (that just contains time-critical
> functions with C++ linkage) instead of a dictionary? >>
>
> Yes. What makes you think you can do better than Python's highly-tuned
> dictionaries for this purpose?
>
I don't want to replace Python's mechanism for all functions - only a
fixed set of special functions will get special treatment. Since the set
is fixed, those function pointers can be stored in an array rather than
a hash table, so that lookup will be faster, no matter how clever the
hash is implemented.
slot for special function => forward to function array
slot for not so special function => forward to function dictionary
Whether the gain is worth the trouble is another question, though...
Ulli
--
________________________________________________________________
| |
| Ullrich Koethe Universität Hamburg / University of Hamburg |
| FB Informatik / Dept. of Informatics |
| AB Kognitive Systeme / Cognitive Systems Group |
| |
| Phone: +49 (0)40 42883-2573 Vogt-Koelln-Str. 30 |
| Fax: +49 (0)40 42883-2572 D - 22527 Hamburg |
| Email: u.koethe at computer.org Germany |
| koethe at informatik.uni-hamburg.de |
| WWW: http://kogs-www.informatik.uni-hamburg.de/~koethe/ |
|________________________________________________________________|
More information about the Cplusplus-sig
mailing list