[squeak-dev] Re: Trying to load ALienOpenGL into 4.1 alpha...
Andreas Raab
andreas.raab at gmx.de
Tue Mar 23 04:21:40 UTC 2010
On 3/22/2010 7:27 PM, Lawson English wrote:
> Croquet OpenGL is dependent on all sorts of things. Have you managed to
> get Croquet working in a modernish version of Squeak/Pharo?
I can probably whip one up fairly easily. The actual dependencies are
rather minor - all you need to do is drop the positional argument
variants (we've thrown these out in our own images too) and load the FFI
first.
> Also, I was under the impression that Alien FFI was faster than the
> standard FFI.
Oh, dear. This is hearsay, right? I.e., neither you nor anyone who
claims it have ever ever run an actual benchmark, have you?
There is interesting out-of-context quote in the Alien documentation
that brings as one of the arguments for Alien something that I said
about the FFI, namely that the "FFI is slow ..." but unfortunately it
doesn't quote the other half of that statement which is "... when
compared to the Squeak plugin interface". That is undoubtedly true in
the context of a discussion that compares the FFI and the Squeak plugin
interface since the FFI has marshalling overhead that is not incurred by
a regular plugin. That said, the FFI isn't slow per se - in particular
not when compared with doing marshalling inside Squeak (as Alien does).
Put on top that people seem to use Alien in the most naive (e.g., slow)
way looking up the functions on each call, and I'd say the FFI will beat
Alien in *any* practical performance tests today (and for the
foreseeable future). Doesn't mean Alien can't be improved, but the next
time someone claims that "FFI is slow and Alien is fast" ask for the
benchmark they ran instead of taking the claim at face value :-)
The main reason for using Alien today is callbacks. There is still no
support for callbacks in the FFI so if you need callbacks Alien is your
choice. One of the things that I've got on my TODO list with Eliot is to
improve interoperability between Alien and the FFI. It should be
possible to pass Aliens straight into FFI calls at which point you could
have your cake and eat it, too.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|