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

Re: <text-field>, size, GDI context...



In article <38581ACD.E96D01E6@miqs.com>, Scott Ribe <sribe@miqs.com> wrote:

> I know that multimethod dispatch can be many times more expensive than a
> C++ virtual call. But I don't have a feel for how often this cost would
> be incurred in a GUI app that I might write in Dylan. So pardon me while
> I flail for a while...

Well, you can implement anything arbitrarily slowly, but it's obviously
possible to implement multimethod dispatch as a series of single argument
C++-style dispatches, with one dispatch per argument.  This will therefore
be slower than C++ dispatch but only a small constant factor.  And you can
probably do better than that if you try.

Apple's Object Pascal method dispatch used runtime table walking and was
quite a bit slower than C++ virtual functions.  I recall that the original
implementation in MPW was for a table per class, but that after a while
they introduced a linker that rewrote this to a table per function, where
possible, with some resulting speed improvement.

-- Bruce



Follow-Ups: References: