You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/08/28 08:13:26 UTC

[PR] perf(transforms): avoid regexp matching in ParseTransform [iceberg-go]

fallintoplace opened a new pull request, #1931:
URL: https://github.com/apache/iceberg-go/pull/1931

   ## What
   
   - Avoid regexp matching in `ParseTransform`.
   - Dispatch common lowercase transforms directly.
   - Parse `bucket[...]` and `truncate[...]` with prefix, digit, and closing-bracket checks.
   - Keep mixed-case support and the existing unknown/error behavior.
   - Add edge-case coverage and a parser benchmark.
   
   ## Why
   
   `ParseTransform` used to lowercase every input and run two regexp matches before checking the six simple transforms. This adds avoidable work to a common metadata parsing path.
   
   ## Benchmark
   
   Apple M1 Pro. Median of 5 runs:
   
   ```text
   go test . -run '^$' -bench '^BenchmarkParseTransform$' -benchmem -count=5 -benchtime=300ms
   ```
   
   | Input | Before | After | Speedup | Allocations |
   | --- | ---: | ---: | ---: | ---: |
   | `identity` | 16.2 ns/op, 0 B | 3.60 ns/op, 0 B | 4.5x | 0 -> 0 |
   | `day` | 11.8 ns/op, 0 B | 3.03 ns/op, 0 B | 3.9x | 0 -> 0 |
   | `bucket[16]` | 106 ns/op, 32 B | 14.0 ns/op, 0 B | 7.6x | 1 -> 0 |
   | `truncate[8]` | 126 ns/op, 32 B | 16.0 ns/op, 0 B | 7.9x | 1 -> 0 |
   | `BuCkEt[16]` | 146 ns/op, 48 B | 92.4 ns/op, 16 B | 1.6x | 2 -> 1 |
   | `custom_transform[42]` | 89.1 ns/op, 16 B | 44.1 ns/op, 16 B | 2.0x | 1 -> 1 |
   
   ## Tests
   
   - `go test . -count=1`
   - `go vet .`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] perf(transforms): avoid regexp matching in ParseTransform [iceberg-go]

Posted by "laskoviymishka (via GitHub)" <gi...@apache.org>.
laskoviymishka merged PR #1931:
URL: https://github.com/apache/iceberg-go/pull/1931


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org