Skip to content

Improve performance of startsWith and endsWith expressions #2973

@andygrove

Description

@andygrove

What is the problem the feature request solves?

CometStringExpressionBenchmark shows poor performance for startsWith and endsWith:

OpenJDK 64-Bit Server VM 11.0.22+7-LTS on Mac OS X 14.6.1
Apple M3 Max
startsWith:                               Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Spark                                                10             77          26          0.1        9567.7       1.0X
Comet (Scan)                                         10             73          31          0.1        9481.0       1.0X
Comet (Scan + Exec)                                  45             80          12          0.0       44128.0       0.2X

OpenJDK 64-Bit Server VM 11.0.22+7-LTS on Mac OS X 14.6.1
Apple M3 Max
endsWith:                                 Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Spark                                                 9             50          42          0.1        8817.6       1.0X
Comet (Scan)                                         12             85          24          0.1       11731.4       0.8X
Comet (Scan + Exec)                                  15             76          32          0.1       14880.7       0.6X

Describe the potential solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions