[
https://issues.apache.org/jira/browse/BEAM-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kenneth Knowles updated BEAM-10631:
-----------------------------------
Resolution: Fixed
Status: Resolved (was: Resolved)
Hello! Due to a bug in our Jira configuration, this issue had status:Resolved
but resolution:Unresolved.
I am bulk editing these issues to have resolution:Fixed
If a different resolution is appropriate, please change it. To do this, click
the "Resolve" button (you can do this even for closed issues) and set the
Resolution field to the right value.
> Performance of Schema#indexOf is broken
> ---------------------------------------
>
> Key: BEAM-10631
> URL: https://issues.apache.org/jira/browse/BEAM-10631
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Affects Versions: 2.21.0, 2.22.0
> Reporter: Gleb Kanterov
> Assignee: Gleb Kanterov
> Priority: P1
> Labels: Done
> Fix For: 2.24.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Schema#indexOf is broken between 2.21.0 and 2.23.0 (can't tag 2.23.0 yet).
> The regression was introduced in
> [apache/beam#10413|https://github.com/apache/beam/pull/10413/files#r464824602].
>
> {code:java}
> - if (index == null) {
> - throw new IllegalArgumentException(
> - String.format("Cannot find field %s in schema %s", fieldName,
> this));
> - }
> + Preconditions.checkArgument(
> + index != null, String.format("Cannot find field %s in schema %s",
> fieldName, this));
> {code}
> `Schema.indexOf` is on a critical path, and calling `this.toString()` was
> allocating a lot of small objects, that scaled badly with a number of fields
> and options in schema. That wasn't significantly noticeable in benchmarks
> that used schemas with few fields.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)