Improve MAKE-LOAD-FORM-SAVING-SLOTS on STRUCTURE-OBJECT.
- use simpler code than SLOT-SETTER-LAMBDA-FORM.
- use a trick based on :SB-JUST-DUMP-IT-NORMALLY if it can be
shown to have identical behavior to a user's MAKE-LOAD-FORM.
This occurs when and only when the user's code is
MAKE-LOAD-FORM-SAVING-SLOTS for all slots.
A consequence of the second point is that the first only matters
when a :SLOT-NAMES argument excludes some slots. Creating large trees
of constant data, such as needed by cl-protobufs, by setting a single
variable to a structure computed through macros expanding to
(DEFVAR *A-BIG-SCHEMA* #S(SCHEMA ....)) now compiles in a fraction of
the time it used to. [The downloadable version of cl-protobufs
uses STANDARD-OBJECT, making this patch inapplicable though]
A test comprised of one DEFVAR initialized to '#.(COMPUTE-THINGS)
where COMPUTE-THINGS returned a list of 10,000 instances of a
structure of 6 slots was sped up thusly:
Test | Fasl size | Compile | Load
------------------|------------|------------|--------
baseline | 17,504 KB | 83 sec | .26 sec
simplified sexprs | 16,311 KB | 45 sec | .17 sec
FOP-based dumping | 1,858 KB | 0.26 sec | .02 sec