[OPNFLWPLUG-372] Replace all String.split() with guava's Splitter Created: 27/Feb/15 Updated: 27/Sep/21 Resolved: 15/Aug/17 |
|
| Status: | Resolved |
| Project: | OpenFlowPlugin |
| Component/s: | General |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Michal Rehak | Assignee: | Shuva Jyoti Kar |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Description |
|
String.split is slow and broken (https://code.google.com/p/guava-libraries/wiki/StringsExplained#Splitter). Guava provides reusable (= faster) and configurable (= not broken, works as configured) implementation. |
| Comments |
| Comment by Timotej Kubas [ 09/Mar/15 ] |
|
https://git.opendaylight.org/gerrit/#/c/16179/ |
| Comment by Abhijit Kumbhare [ 10/Nov/15 ] |
|
Michal, Any thoughts on this? Thanks, |
| Comment by Michal Rehak [ 10/Nov/15 ] |
|
This is technical depth and does not affect exposed API. As soon as we have settled API-freeze related changes I can finish this. |
| Comment by Shuva Jyoti Kar [ 28/May/16 ] |
|
Given that Guava's Splitter doesn't incur the overhead of regular expressions when you don't ask for it, and is very fast as a general rule and it is much more predictable than String.split(), this is indeed a nice enhancement. |
| Comment by Andrej Leitner [ 17/Aug/16 ] |
|
Patches were not merged and need to be rewritten, cancelling WFR status for now. |
| Comment by Shuva Jyoti Kar [ 17/Aug/16 ] |
|
Some of the patches were merged: https://git.opendaylight.org/gerrit/#/q/project:openflowplugin+message:2771+status:merged |
| Comment by Jozef Bacigal [ 02/Jun/17 ] |
|
Guava splitter is quicker just only the results it gives back. It is not creating a new string objects. So in long string maybe it will be quicker, but with short string with two or just few substrings it will be slower even when we create a new strings object anyway. So this enhancement is no needed anyway. Closing |
| Comment by Vratko Polak [ 15/Aug/17 ] |
|
> in long string maybe it will be quicker, Can we measure that? |