[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Ideas for faster math in lua
- From: "Brandon Van Every" <bvanevery@...>
- Date: Thu, 14 Feb 2008 14:56:06 -0500
On Thu, Feb 14, 2008 at 1:55 PM, Jerome Vuarand
> Roberto Ierusalimschy wrote:
> >> I would like to be able to process lots of small mathematical objects
> >> (vector3 and quaternions) in a resource constrained environment
> >> (computer game), without having to pay the cost of new-ing and
> >> garbage collecting them. I.e. I would just like to reuse a pool of
> >> existing objects.
> > Did you meet performance problems or are you just anticipating them?
> I implemented such a geometric object system in my application too, and
> I met such performance problems. With a few hundred entities in my scene
> graph, each recomputing a few matrices in their update method from their
> position and orientation, it allocated several tens of megabytes of
> temporary data per second.
> I was confident that I could do most of my 3D/OpenGL stuff in Lua, but
> while it's fine for a few objects to demo some shaders, for a
> full-featured virtual world renderer Lua becomes the bottleneck.
So it seems that Lua isn't the be-all end-all language for 3D graphics
computation that people have been hoping for forever and anon. I've
been on that language quest for a good 3 years now. I would suggest
looking at Squirrel, as it was written by a game developer. I don't
yet know if it's particularly performance oriented, or if it just
desired to interface to C++ better and sees C++ as the vehicle for
mathematical heavy lifting.
If Squirrel ain't it, then nothing is. I'm about ready to start
writing my own language, having been through Python, OCaml, Bigloo
Scheme, and Chicken Scheme on this performance quest. But I'll
squeeze out the due diligence to see if Lua or Squirrel has the low
level math performance. Thanks for reminding me why I was on this
quest in the 1st place.
> On the other hand I didn't try adding new datatypes to the Lua VM. Did
> someone try that for such 3D math, and was that successful ?
Brandon Van Every