%vector-widetag-and-n-bits is slow

Bug #902533 reported by 3b
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

sb-impl::%vector-widetag-and-n-bits has special cases for BIT, CHARACTER, BASE-CHAR and T arrays, but all other types go through a linear search calling SUBTYPEP, which is fairly slow. It would be nice to have either more special cases, (unsigned-byte 8) in particular, or a faster search for types like (u-b 8) that can be matched exactly.

Most obvious place it shows up is current implementation of SUBSEQ, but discussion in #sbcl suggested it shouldn't be calling %v-w-a-n-b anyway, so that will get a separate bug.

Also ran into it in ironclad, which was doing something like
(let ((length (some-function))
      (make-array length ...)))
which didn't trigger the MAKE-ARRAY transforms since nothing was known about the type of LENGTH.

It also looks like something in the compiler ends up calling it, but probably not enough to slow things down noticeably (something like 6700 calls compiling hunchentoot and dependencies from scratch for example).

Tags: optimization
Revision history for this message
Stas Boukarev (stassats) wrote :

This was fixed some time ago.

Changed in sbcl:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.