You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/10/18 13:04:09 UTC
[GitHub] [camel] essobedo opened a new pull request, #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
essobedo opened a new pull request, #8570:
URL: https://github.com/apache/camel/pull/8570
Fix for https://issues.apache.org/jira/browse/CAMEL-16354
## Motivation
Using `Scanner` to use for splitting could potentially be optimized for more basic splitting by single char as we do for commas.
The Scanner creates a lot of object allocations with reg exp patterns and whatnot that is way overkill.
## Modifications:
* Fix warnings in `ObjectHelperTest`
* Add new tests to improve the code coverage of `ObjectHelper.createIterable`
* Improve the performance in case the separator is not a pattern
## Results:
```
# JMH version: 1.35
# VM version: JDK 11, OpenJDK 64-Bit Server VM, 11+28
# VM invoker: /usr/local/jdk-11/bin/java
# VM options: <none>
# Blackhole mode: full + dont-inline hint (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 5 iterations, 10 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
Benchmark (type) Mode Cnt Score Error Units
MyBenchmark.newSplitterWithSpecificSeparator TINY avgt 15 98.854 ± 0.592 ns/op
MyBenchmark.newSplitterWithSpecificSeparator SMALL avgt 15 321.351 ± 13.413 ns/op
MyBenchmark.newSplitterWithSpecificSeparator MEDIUM avgt 15 2905.660 ± 17.381 ns/op
MyBenchmark.newSplitterWithSpecificSeparator BIG avgt 15 28820.933 ± 81.483 ns/op
Benchmark (type) Mode Cnt Score Error Units
MyBenchmark.currentSplitterWithSpecificSeparator TINY avgt 15 1722.947 ± 7.436 ns/op
MyBenchmark.currentSplitterWithSpecificSeparator SMALL avgt 15 3795.835 ± 22.725 ns/op
MyBenchmark.currentSplitterWithSpecificSeparator MEDIUM avgt 15 29253.195 ± 118.111 ns/op
MyBenchmark.currentSplitterWithSpecificSeparator BIG avgt 15 281669.154 ± 4146.332 ns/op
```
Where:
- `TINY` has 3 tokens to extract
- `SMALL` has 10 tokens to extract
- `MEDIUM` has 100 tokens to extract
- `BIG` has 1000 tokens to extract
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282472025
:no_entry_sign: There are (likely) no components to be tested in this PR
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282506404
:no_entry_sign: There are (likely) no components to be tested in this PR
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282601922
:no_entry_sign: There are (likely) no components to be tested in this PR
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282467251
:no_entry_sign: There are (likely) no components to be tested in this PR
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282608174
Yeah this is great - the increased performance is great, and also with reduced object allocations as well.
Most use cases for splitting is new line or some basic delimiter chars. So many users can benefit from this.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] essobedo commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282517589
@davsclaus Is it what you had in mind when first created the ticket?
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282356972
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:warning: Please note that the changes on this PR may be **tested automatically**.
If necessary Apache Camel Committers may access logs and test results in the job summaries!
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282579128
:no_entry_sign: There are (likely) no components to be tested in this PR
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] github-actions[bot] commented on pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8570:
URL: https://github.com/apache/camel/pull/8570#issuecomment-1282575527
:no_entry_sign: There are (likely) no components to be tested in this PR
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] essobedo merged pull request #8570: CAMEL-16354: camel-core - Optimize Splitters using Scanner
Posted by GitBox <gi...@apache.org>.
essobedo merged PR #8570:
URL: https://github.com/apache/camel/pull/8570
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org