Autoconf adventures with GtkPlugin (now it runs in Linux! :))
Andreas Raab
andreas.raab at gmx.de
Wed May 17 07:54:29 UTC 2006
goran at krampe.se wrote:
> Regarding FFI - I have only used FFI a little bit but from what I know
> and have heard:
>
> 1. It is pretty slow. Fine for infrequent calls but not too good when
> calling often.
> 2. We don't get away with only FFI since we need to do tricks on the
> C-side to get callbacks going. And probably other things might pop up
> too.
> 3. Due to #2 above a plugin givs us more freedom and abilities.
I'll make a casual comment here that there is more than just the "either
or" solution depending on your needs. In Croquet, for example, we use a
plugin to abstract from the details of creating 3D rendering surfaces
(which includes dealing with callbacks on some platforms) but *then* we
use FFI for all of the actual OpenGL calls. So a mixture of both can be
to your advantage if you don't want to go "all plugin".
And, interestingly enough, these FFI calls have *never* shown up in any
profiler traces we've looked at for optimization. The comments about
"FFI being slow" really have to be seen in the context of some last
millenium hardware. These days, we're making 500k FFI calls/sec easily
on mediocre hardware which is pretty darn reasonable for most uses ;-)
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|