[Openmcl-devel] back to coding and optimizing
Hamilton Link
hamlink at cs.unm.edu
Fri Feb 25 11:00:17 PST 2005
Hey Gary (or alternatively anyone else who wants to chew on this), I
have some software that's way numerically intensive, and I was thinking
about writing a C function or several to take consing and tag-bit
manipulation within a set of operations down to zip, or close.
What this would entail, I suspect, is storing a lot of data as raw
memory blocks (real-valued multidimensional arrays, actually), passing
them around and doing memory management with them with lisp or by hand
and doing some C operations on them behind the scenes. Most of the
operations are going to be block+block->block or block->block, and only
very rarely will I need to look at the actual numbers in the blocks
from lisp.
So... question: how close can I come to just allocating uvectors and
passing them into C functions? And actually for that matter how close
to that do big honkin' vectors with the type of their contents declared
as short float get me? I assume at least that the latter stores stuff
without tags and takes care of tagging/untagging through svref -- but
if I got my hands on the raw vector underneath then C would not have
tags to worry about.
The other question is, what's the best way to make the GCer play nice
with C? Stack-allocate copies of all my uvectors? I would guess that
copying these things about would be chunky but it might not be toooo
bad... the alternative would be to malloc them, and have lisp only deal
with their macptrs, right? In which case I have to free them by hand,
which might also not be toooo bad and would I presume be somewhat
faster.
I know conversations along these lines have floated around the list
before, so I'll go check the archive too.
h
More information about the Openmcl-devel
mailing list