Marc:
The tables implementation has special hash functions for these common tests:
eq?, eqv?, equal?, string=?, string-ci=?
The table access routines and the special has functions are defined in _system.scm.
The tests themselves are defined in the following:
_system.scm: eqv?, eq?, equal? _std.scm: string=?, string-ci=?
So tables that use string=? for a hash function have to do two extra intermodule calls per table lookup; that may be why string=? tables are currently noticeably slower than eq? tables.
Brad
Afficher les réponses par date
Moving all the string predicates from _std.scm to _system.scm (and the previous additions of (declare (not interrupts-enabled)) improved the speed of k-nucleotide on my ppc64 mac by about 15%:
43.511u 0.640s 0:44.69 98.7% 0+0k 0+3io 0pf+0w
to
36.893u 0.448s 0:37.45 99.6% 0+0k 0+0io 0pf+0w
The improvement is most noticeable for short strings of one or two characters; in k-nucleotide, for example, the times go from
4924 ms real time 4912 ms cpu time (4900 user, 12 system) no collections 2320 bytes allocated no minor faults no major faults
to
4019 ms real time 4016 ms cpu time (4010 user, 6 system) no collections 7632 bytes allocated no minor faults no major faults
for one-character strings in all-counts.
Brad