It has been found by the original poster and others (see comments) that the ArraySeq constructor call to Class.getComponentType is a performance hotspot in calls to RestFn.invoke(). The array's component type is cached in the ct field and later used to call into Reflector.prepRet() which currently handles Boolean canonicalization. However, this path is only used for primitive arrays; all subclasses of Object are handled by alternate code in every method. The ArraySeq.create() methods (the real entry point) now shunt all primitive array support to supporting variants (ArraySeq_boolean, etc).
Approach: Remove the vestigial support for primitive arrays in the ArraySeq class. This includes removing the ct and oa fields in ArraySeq and changing the existing array field to an Object as well as removing the calls to Class.getComponentType.
Removing this code also exposed the missing ArraySeq_short (the only primitive array type not covered) which has been added.
Performance: This is a simple test that leans on partial application which internally uses ArraySeq:
On my machine, I found these (best time of 20 runs):
which is about a 10% improvement (about what I've seen in other ad hoc tests as well).
Screened by: Alex Miller