[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT 2 clone-on-write for tables
- From: Mike Pall <mikelu-1101@...>
- Date: Wed, 19 Jan 2011 20:05:01 +0100
Alexander Gladysh wrote:
> On Wed, Jan 19, 2011 at 21:46, Tony Finch <email@example.com> wrote:
> > You can do that with a proxy table. Point __index at the table to be
> > cloned, and when __newindex is called, copy everything to the proxy.
> Thank you. As I noted in my original post, I'm aware of that solution.
> My question is about LJ2 optimizations.
Well, this is at the wrong level for a compiler optimization. How
could it do better than that? It would have to do exactly the same
things behind the curtains. It's not the compiler's business to
handle stuff you can do at the user level with similar efficiency.
[And I'm pretty sure it doesn't pay off either way. Rethink the
whole thing and find easier ways to do what you're really trying
to achieve. This sounds a lot like architecture astronautics.]