Re: [luabind] Performance luabind vs. SWIG
Brought to you by:
arvidn,
daniel_wallin
From: Bjorn T. M. <Bjo...@mi...> - 2009-11-30 09:42:58
|
I've worked on several teams within my company that have rejected LuaBind on reasons of performance, so it would be terribly handy if these benchmarks were made part of the public source, or at least made available in some way. That way, at least there'd be a counter-argument when the, by now a-priori, reasoning goes that "LuaBind is too slow". If nothing else, it would give us a shared metric to talk about ("why is LuaBind faster/slower here? Why does/doesn't it matter?") LuaBind has by far the nicest syntax but cleanliness/syntax just doesn't matter when you cannot afford to lose FPS. Thanks, Bjorn -----Original Message----- From: Daniel Wallin [mailto:da...@bo...] Sent: 28 November 2009 22:02 To: lua...@li... Subject: Re: [luabind] Performance luabind vs. SWIG Sebastian Wolff wrote: > This is quite astonishing since I thought that template magic may be > able to speed up things. I did not use any special -D's, luabind was > used as provided by my vendor (opensuse x64). > > I only wanted the list you know this. Maybe someone picks it up to > finde some room for improvement in luabind. Things have improved a lot for 0.9. On my system, for your benchmark, I get: SWIG 7.3s luabind 0.8.1 14.5s luabind 0.9 10.5s I haven't looked to closely at the differences, but here are some things that probably contributes: 1. luabind does more than SWIG when dispatching operators. SWIG basically just stuffs a function directly in the metatable, luabind has an extra level of indirection here. 2. luabind does more than SWIG when constructing an object. It mostly comes from having a more complex object system. Doing: x = Someclass() will just drop right into the construction function in SWIG. With luabind we get one, at least, extra level of indirection because construction of the object holder is separated from initialization. In theory, at least, we could complicate the implementation to eliminate this when directly constructing an instance of a C++ class. I'm inclined not though, because I want to keep the implementation reasonably clean. Although this particular case shows quite a difference between luabind and SWIG, I believe in general the differences are much smaller. I keep my own benchmark suite, which shows luabind 0.9 being equal to SWIG in most cases. -- Daniel Wallin BoostPro Computing http://www.boostpro.com ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ luabind-user mailing list lua...@li... https://lists.sourceforge.net/lists/listinfo/luabind-user |