[gambit-list] Strings, string tables, FFI

Alan Post alanpost at sunflowerriver.org
Wed Dec 29 13:36:37 EST 2010


On Wed, Dec 29, 2010 at 11:31:28AM -0600, mikel evins wrote:
> The application I'm working on marshals a large number of strings across the FFI boundary. Large enough, in fact, that I've periodically considered introducing some interning strategy to ensure that a given character sequence is marshaled across the FFI at most once. 
> 
> If you have any ideas that might make such a scheme easier to implement, I'd be interested in hearing them.
> 

My first though, in reading this, is that you want to intern the
longest repeated substring on each side.  A trie structure can
compute this sort of information, and your marshall protocol might
be something you could express as updates to a trie synced on both
sides, rather than marshalling strings.

If that is interesting enough where you'd like more detail, just ask
and I'll keep talking.  If it isn't applicable to your idea,
hopefully someone else will come up with something better!

-Alan
-- 
.i ko djuno fi le do sevzi



More information about the Gambit-list mailing list