[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hash Table Collisions (n.runs-SA-2011.004)
- From: Miles Bader <miles@...>
- Date: Sat, 07 Jan 2012 12:29:42 +0900
Roberto Ierusalimschy <roberto@inf.puc-rio.br> writes:
> That change also would improve a little the manipulation of large
> strings inside Lua, and even opens the door for the implementation of
> "external strings" (large strings where the buffer is outside Lua, for
> instance in ROM).
I would _love_ to have non-interned long Lua strings where the string
contents lived in a separate buffer (accessed via a pointer in the Lua
value I guess), so I could just mmap a file and create a Lua "string
pointer" from it (very quickly) -- rather than doing what I currently
do, which is mmap the file and copy the entire contents with
lua_pushlstring.... (a lot faster than Lua read("*a"), but still not as
fast as it could be)
If such a "external contents string" type were added to Lua, it would be
helpful to have an explicit "gc" callback as part of the Lua object,
which would get called when the Lua object was freed, and could free the
separate string buffer.
-Miles
--
"Suppose we've chosen the wrong god. Every time we go to church we're
just making him madder and madder." -- Homer Simpson
- References:
- Re: Hash Table Collisions (n.runs-SA-2011.004), Vladimir Protasov
- Re: Hash Table Collisions (n.runs-SA-2011.004), Leo Razoumov
- Re: Hash Table Collisions (n.runs-SA-2011.004), Vladimir Protasov
- Re: Hash Table Collisions (n.runs-SA-2011.004), Miles Bader
- Re: Hash Table Collisions (n.runs-SA-2011.004), Ashwin Hirschi
- Re: Hash Table Collisions (n.runs-SA-2011.004), Miles Bader
- Re: Hash Table Collisions (n.runs-SA-2011.004), David Kolf
- Re: Hash Table Collisions (n.runs-SA-2011.004), Miles Bader
- Re: Hash Table Collisions (n.runs-SA-2011.004), Alexander Gladysh
- Re: Hash Table Collisions (n.runs-SA-2011.004), Roberto Ierusalimschy
- Re: Hash Table Collisions (n.runs-SA-2011.004), Roberto Ierusalimschy