[Top][All Lists]

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

Re: Guile OpenGL bindings

From: Mark H Weaver
Subject: Re: Guile OpenGL bindings
Date: Fri, 01 Feb 2013 10:10:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Javier Sancho <address@hidden> writes:
> Someone mentioned performance issues when using FFI, too.

That was me, and I regret emphasizing that.  In a couple of years, when
Guile has native compilation, it is likely that the FFI will be as fast
as C wrappers, maybe even a bit faster.

Anyway, as Knuth wrote, "We should forget about small efficiencies, say
about 97% of the time: premature optimization is the root of all evil",
and he was absolutely right.  Countless projects have been ruined by
premature optimization.

It's far more important to write the cleanest, simplest code that will
get the job done.  Only after determining the hotspots (by profiling)
should you optimize those bits.

Plus, as Daniel Hartwig <address@hidden> wrote:

> For modern GL programming without glBegin/End, Vertex/Color/Normal,
> etc. the performance impact of FFI should be negligable.  There are
> few GL calls compared to the volume of data that is passed.
> The real critical part will be how the user manipulates their vertex
> data, if this is done frequently on the scheme side.  Mapping (typed)
> bytevectors, or srfi-4 to gl arrays will help with that, and avoiding
> the implicit type conversions that some other bindings perform.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]