[Openmcl-devel] Re: Hemlock performance investigation

Andrew P. Lentvorski, Jr. bsder at mail.allcaps.org
Fri Aug 27 00:35:18 UTC 2004


On Aug 26, 2004, at 2:39 PM, Gary Byers wrote:

> characterAtIndex: is supposed to be a primitive, relatively low-cost
> operation.  The FFI callback overhead doesn't seem to be significant;
> the cost of determining that SELF was an ObjC instance does.  When I
> tried metering this with Shark (a step that still requires trying to
> look up the lisp functions associated with an address range manually),
> I saw that the busiest function was CCL::BIGNUM-COMPARE.  These calls
> came from code which compared the address of a possible ObjC pointer
> to the addresses of known ObjC library data segments (that might
> contain NSStrings); all of these addresses were represented as
> integers, and all happened to be bignums.

Just a side question: What's the O() of that lookup?  Compare being
the busiest function almost always indicates a bad algorithm/data
structure.

If that is a linear lookup, simply changing the data structure which
holds the known ObjC library data segments to a tree or hash would
be a big win.

If that's not possible, then caching the results of previous lookups
and then validating on a hit (or flushing on a miss) should also get
a significant gain.

-a




More information about the Openmcl-devel mailing list