Hi

In Seaside we get a lot of performance gains out of
primitiveFindFirstInString. One thing that always annoyed me a bit is
that it's not as optimized as it could be.

The inclusionMap you give it are 256 consecutive boolean values (0 or
1). There is no need for this to be a 256 element ByteArray when each
element can only be 0 or 1. We could as well make it a 32 element
ByteArray and each byte holding eight bit values. Instead of using the
asciiValue to directly index into the inclusionMap we would use the top
five bits to index into the inclusionMap and the bottom 3 bits to "index
into the byte".

Did that make any sense?

Cheers
Philippe


Reply via email to