/[cl-store]/cl-store/README
ViewVC logotype

Contents of /cl-store/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (hide annotations)
Fri Nov 26 14:35:36 2004 UTC (9 years, 4 months ago) by sross
Branch: MAIN
Changes since 1.12: +1 -1 lines
Added structure definition support for CMUCL
1 sross 1.4 README for Package CL-STORE.
2 sross 1.1 Author: Sean Ross
3     Homepage: http://www.common-lisp.net/project/cl-store/
4 sross 1.13 Version: 0.4.1
5 sross 1.1
6     0. About.
7     CL-STORE is an portable serialization package which
8     should give you the ability to store all common-lisp
9 sross 1.9 data types (well not all yet) into streams.
10 sross 1.10 See the cl-store manual (docs/cl-store.texi) for more in depth information.
11 sross 1.1
12 sross 1.10 1. Usage
13 sross 1.9 The main entry points are
14 sross 1.12 - [Method] cl-store:store (obj place &optional (backend *default-backend*)) i
15 sross 1.4 => obj
16 sross 1.7 Where place is a path designator or stream and
17     backend is one of the registered backends.
18 sross 1.4
19 sross 1.12 - [Method] cl-store:restore (place &optional (backend *default-backend*))
20 sross 1.9 => restored-objects
21 sross 1.4 Where place and backend is as above.
22 sross 1.1
23 sross 1.9 - [Macro] cl-store:multiple-value-store (values-form place &optional (backend *default-backend*))
24     => objects
25     Stores all the values returned by VALUES-FORM into place as per cl-store:store.
26    
27 sross 1.1 - cl-store:restore is setfable, which I think makes
28     for a great serialized hit counter.
29     eg. (incf (restore place))
30    
31 sross 1.9 NOTE.
32     All errors signalled within store and restore can
33     be handled by catching store-error and restore-error respectively.
34 sross 1.12
35     2. Optimizing.
36    
37     While cl-store is generally quickish it still has a tendency to
38     do a lot of consing. Thanks to profilers this has been pinned down
39     to the rehashing of the hash-tables which track object circularities.
40     From 0.4.0 cl-store has three new variables *store-hash-size*, *restore-hash-size*
41     and *check-for-circs*, proper usage of these new variables can greatly reduce
42     the consing (and time taken) when storing and restoring large objects.
43    
44     - *store-hash-size* and *restore-hash-size
45     At the beginning of storing and restoring an eq hash-table is created with a
46     default size of 1000 to track objects which have been (re)stored. On large objects however
47     the rehashing of these hash-tables imposes a severe drain on performance.
48     By binding these two variables to appropriately large values
49     about (100010 for a hash-table with 100000 int->string mappings) you
50     can obtain a decent performance improvement. This may require a bit
51     of fiddling to find the best tradeoff between rehashing and creating
52     a large hash-table.
53    
54     - *check-for-circs*
55     Binding this variable to nil when storing or restoring
56     an object inhibits all checks for circularities which gives a
57     severe boost to performance. The downside of this is that no
58     restored objects will be eq and attempting to store circular objects
59     will hang. The speed improvements are definitely worth it if you
60     know that there will be no circularities or shared references in
61     your data (eg spam-filter hash-tables).
62    
63 sross 1.1 Enjoy
64     Sean.

  ViewVC Help
Powered by ViewVC 1.1.5