Skip to content

feat: simd negate and abs#19703

Open
clintropolis wants to merge 1 commit into
apache:masterfrom
clintropolis:simd-negate-abs
Open

feat: simd negate and abs#19703
clintropolis wants to merge 1 commit into
apache:masterfrom
clintropolis:simd-negate-abs

Conversation

@clintropolis

Copy link
Copy Markdown
Member

Description

opt-in jdk.incubator.vector specializations for negate and abs unary expressions. Benchmarks look pretty nice:

64,65: unary negate on a double column (companion to 15 which does long negate)
SELECT SUM(-double1) FROM expressions
SELECT SUM(-double4) FROM expressions
66,67: unary abs on long and double columns
SELECT SUM(ABS(long4)) FROM expressions
SELECT SUM(ABS(double1)) FROM expressions
68: unary abs of a binary subtraction (composes SIMD sub with SIMD abs)
SELECT SUM(ABS(long1 - long4)) FROM expressions
Benchmark                        (complexCompression)  (deferExpressionDimensions)  (jsonObjectStorageEncoding)  (query)  (rowsPerSegment)  (schemaType)  (storageType)  (stringEncoding)  (useVectorApi)  (vectorize)  Mode  Cnt   Score   Error  Units
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       64           1500000      explicit           MMAP              UTF8           false        force  avgt    5  16.052 ± 0.910  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       64           1500000      explicit           MMAP              UTF8            true        force  avgt    5   5.294 ± 0.283  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       65           1500000      explicit           MMAP              UTF8           false        force  avgt    5  13.288 ± 0.605  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       65           1500000      explicit           MMAP              UTF8            true        force  avgt    5   3.085 ± 0.312  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       66           1500000      explicit           MMAP              UTF8           false        force  avgt    5  10.602 ± 0.592  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       66           1500000      explicit           MMAP              UTF8            true        force  avgt    5   5.687 ± 0.427  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       67           1500000      explicit           MMAP              UTF8           false        force  avgt    5  15.691 ± 2.852  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       67           1500000      explicit           MMAP              UTF8            true        force  avgt    5   5.186 ± 0.267  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       68           1500000      explicit           MMAP              UTF8           false        force  avgt    5  15.786 ± 0.647  ms/op
SqlExpressionBenchmark.querySql                  NONE                 singleString                        SMILE       68           1500000      explicit           MMAP              UTF8            true        force  avgt    5  10.682 ± 0.454  ms/op

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.

Reviewed 11 of 11 changed files.


This is an automated review by Codex GPT-5.6-Sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants