[
https://issues.apache.org/jira/browse/BEAM-14166?focusedWorklogId=747302&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-747302
]
ASF GitHub Bot logged work on BEAM-14166:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Mar/22 15:56
Start Date: 24/Mar/22 15:56
Worklog Time Spent: 10m
Work Description: mosche edited a comment on pull request #17172:
URL: https://github.com/apache/beam/pull/17172#issuecomment-1077772316
@reuvenlax certainly a valid question and I'm happy to discuss what's worth
caching.
Though, the key point here is, that there's already a cache in place for
array, iterable and map types. Processing for these is currently not ideal. For
instance, looking at an array field the following steps happen on `getValue`:
1) Invoke getter, the generated byte code wraps the array in a list
2) Then lazily transform the list elements (`Lists.transform`) and cache the
result
The problem is really on the 2nd access. Step 1) is repeated, but step 2)
uses the cache discarding all the work of step 1).
This PR mostly addresses some of the inconsistencies using the existing
cache and reduces the overhead of the cache by choosing better fitted data
structures to store cached values.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 747302)
Time Spent: 40m (was: 0.5h)
> Improvements to RowWithGetter
> -----------------------------
>
> Key: BEAM-14166
> URL: https://issues.apache.org/jira/browse/BEAM-14166
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Moritz Mack
> Assignee: Moritz Mack
> Priority: P2
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Various improvements to getValue(fieldIdx) in RowWithGetters mentioned
> [here|[https://github.com/apache/beam/pull/16947#discussion_r833602836]:]
> * Minimize memory overhead of cache using either a index lookup (array) or a
> single hash map if number of fields exceeds the initial hashmap capacity
> * The cache should be checked before calling a getter to avoid any
> potentially unnecessary conversion in the getter itself.
> * [Nested
> rows|https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/values/RowWithGetters.java#L111]
> should be cached, otherwise the cache of such nested rows can't be leveraged.
> * Handling of collections / maps / iterables can be significantly improved
> by simply skipping the transform in all cases where {{getValue}} for members
> is the [identity
> transform|https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/values/RowWithGetters.java#L142].
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)