~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to doc/c-gc

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
We have implemented garbage collection of the c stack.  
 
3
Thus any new cons or other data type, may be safely left
 
4
on the c stack or in a register, without fear of lossage
 
5
due to garbage collection.  This enables us to write smaller
 
6
faster code.  We have implemented a scheme for putting 
 
7
frequently used variables, and those inside loops, into registers.
 
8
For example the compiled sloop.lsp file now has text size
 
9
48704, but had text size 53120 or 1.09 times larger.  
 
10
 
 
11
If functions are proclaimed to be of fixed number of args,
 
12
the code is also substantially better.  For example if you
 
13
have the code:
 
14
 
 
15
(proclaim '(function memb (t t) t))
 
16
(defun memb (a b)
 
17
   (sloop for v on b when (eq (car v) a) do (return v)))
 
18
 
 
19
 
 
20
 
 
21
If we consider calls where a is the 4'th element of b,
 
22
then memb runs  two times faster than before: On a sun 3-50
 
23
19.6 seconds for 1,000,000 iterations, as opposed to 39.6 seconds
 
24
without the new modifications to c-gc and the compiler.
 
25
 
 
26
 
 
27
(defun try (n a b) (sloop for i below n do (memb a b)))
 
28
 
 
29
Currently if the variable compiler::*c-gc* is not nil,
 
30
the compiler outputs code under the assumption that c-gc is working.
 
31
Very bad results would occur if such object code were loaded into a
 
32
kcl which did not examine the c stack.  Also if you are wishing
 
33
to produce C code for use in an implementation without c-gc
 
34
you should set *c-gc* to nil.
 
35
 
 
36
 
 
37
 
 
38
 
 
39