lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


https://github.com/IonoclastBrigham/firth/blob/bootstrap/proto/listproto.lua

It's a bit of a mess, as one might expect from prototype code, but I can't even really do much to clean it up because I don't really understand what going on.

The first two versions, labeled "Hash-Linked" and "Index-Linked" were ideas that popped into my head at like 4 in the morning. They seem somewhat impractical overall (and most definitely leak memory), but I was curious if potential cache benefits might make pursuing one or both worth while. "Traditional" is a lisp-style linked list based on pairs where the second element is the next node table. And "Array-Tables" is just list-style manipulators wrapped around a lua array table for reference.

Of particular note, "Traditional" claims to use less memory and run faster if it comes before the others. Scratching my head on that one. Heap fragmentation? Rogue collector disobeying my commands? Did I cross the particle streams somewhere and open a portal to Gozer?

On Thu, May 28, 2015 at 5:19 PM, Tim Hill <drtimhill@gmail.com> wrote:

> On May 28, 2015, at 1:01 PM, Brigham Toskin <brighamtoskin@gmail.com> wrote:
>
> Hey all.
>
> I've been prototyping several different implementations of lisp-style linked lists. To get an idea of their performance characteristics, I wrote a series of braindead but probably indicative micro benchmarks.
>
> Now, because I'm trying to get a feel for how the manipulations themselves perform in isolation, I am passing "stop" to collectgarbage() between tests, collecting my data, then using the "restart" command and running two full passes of the gc to clean up before the next test.
>
>
> Thoughts? Am I approaching my measurements completely wrong?
>
> --
> Brigham Toskin

Can you post sample code?

—Tim





--
Brigham Toskin