[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Multiple instances or one global?
- From: "Eric Ries" <eries@...>
- Date: Thu, 20 Sep 2001 09:19:10 -0700
Keep in mind also that if you have any bindings to C++ functions/classes
(esp those generated by toLua) you will have additional overhead. We use
multiple Lua states in our codebase. We also autogenerate toLua bindings for
hundreds of classes in our codebase. We soon discovered that each Lua state
was taking up over 500k. This was, of course, unacceptable, and so we messed
around with Lua's guts so that we could have a shared globals and a shared
registry between all Lua states. But if we had designed for one Lua state at
the beginning, perhaps we could have avoided that work.
On the other hand, it's probably still worth the benefits of multiple states
(fault and namespace isolation).
> -----Original Message-----
> From: email@example.com
> [mailto:firstname.lastname@example.org]On Behalf Of Josh Jensen
> Sent: Wednesday, September 19, 2001 11:13 PM
> To: Multiple recipients of list
> Subject: RE: Multiple instances or one global?
> > > Approximately 20k a state and setup costs...
> > With float numbers and 32-bit VM instruction I'm seeing only
> > 11k per state.
> You're right. My number included the standard libraries. At that
> point, it is approximately 20k.