• Ken Raeburn's avatar
    Replace read_objects assoc list with two hash tables. · b9145563
    Ken Raeburn authored
    For larger input files with lots of shared data structures, an
    association list is too slow.
    * src/lread.c (read_objects_map, read_objects_completed): New
    variables, replacing read_objects.
    (readevalloop): Initialize them with hash tables before starting a
    top-level read, if they're not already empty hash tables, and reset
    them to Qnil afterwards if something was added to the hash tables.
    (read_internal_start): Likewise.
    (read1): Store first the placeholder and later the newly read object
    into read_objects_map under the specified object number.  If the new
    object can contain a reference to itself, store it in
    (substitute_objects_recurse): Check read_objects_completed instead of
    read_objects for the known possibly-recursive objects.
    (syms_of_lread): Update initializations.
lread.c 149 KB