3 ms·
Thanks, that's interesting. My own main optimization problem is always reducing the memory usage of large in memory data sets. I found that languages like Java
by fauigerzigerk 17y ago
Thanks, that's interesting. My own main optimization problem is always reducing the memory usage of large in memory data sets. I found that languages like Java and Python, which don't support structured value types and use references/pointers everywhere, are basically unusable for my my purposes.
Now, I wonder whether I could use Lisp for what I do. One basic necessity would be to have a way to define a structure like this
struct s {
int32_t x;
int32_t y;
};
and then create an array of that type as struct s a[size], which uses exactly size * sizeof(s) bytes in memory. A further requirement would be to have a library of data structures (balanced trees, lists, hash tables) that support storing such structs directly without using pointers everywhere.
Do you have any idea whether that could work with SBCL?
- smanek 17y agoI think you can do that - although I'm not entirely certain how much overhead a struct (defstruct) has. Array allocation has no overhead, to the best of my knowledge (if you specify the element-type, etc). I usually don't code at that low level, but you might want to check out www.lrde.epita.fr/~didier/research/verna.06.imecs.pdf