Re: Caching in the dynamic database
"Richard A. O'Keefe" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Didn't Ken Bowen's Prolog implementation have some sort of software paging for compiled code? I have a vague idea that it swapped entire predicates, which would be a lot easier than swapping clauses. Is it possible to partition some tables so that whole- predicate swapping could be done instead of clause swapping? One thing that's old technology in Smalltalk is having two representations of compiled code: a really compact byte code with a byte code interpreter and native code; for top speed you use the native code, for debugging and trawling the code for cross references you use the byte code. And when memory gets tight, you throw away the native code. (The trick is to be able to map native code addresses back to byte code addresses, but that's a solved problem.) Back in the 80s SICStus Prolog had :- fast_code and :- compact_code directives so that you could chose which predicates to make small and which to make fast. Another idea that was tried for Smalltalk was swapping entire objects. Before that, back in the early 70s, the B6700 virtual memory system took arrays and procedures as units of swapping, even quite small ones. Before trying anything exotic, is there any possible refactoring of the existing data to take less memory to start with?