[ https://issues.apache.org/jira/browse/ARROW-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16364699#comment-16364699 ]
ASF GitHub Bot commented on ARROW-2144: --------------------------------------- trxcllnt commented on a change in pull request #1599: ARROW-2144: [JS] Don't repeat dictionary lookups in DataFrame ops URL: https://github.com/apache/arrow/pull/1599#discussion_r168296826 ########## File path: js/src/vector/nested.ts ########## @@ -40,6 +40,15 @@ export abstract class NestedView<T extends NestedType> implements View<T> { public toArray(): IterableArrayLike<T['TValue']> { return [...this]; } + public find(search: T['TValue']) { + let index = 0; + for (let value of this) { + if (value === search) { return index; } Review comment: @TheNeuralBit I saw the special-cased `every()` call in `FixedSizeListView`'s find method, so I suspect you're already aware of the question I have here: since `get(i)` on a NestedView returns a structured clone of the nested element, how do we make this work? I know in C++ they have visitors that compare vectors of the same type together, and that sounds like what we really need here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > [JS] Don't repeat dictionary lookups in DataFrame ops > ----------------------------------------------------- > > Key: ARROW-2144 > URL: https://issues.apache.org/jira/browse/ARROW-2144 > Project: Apache Arrow > Issue Type: Improvement > Components: JavaScript > Reporter: Brian Hulette > Priority: Major > Labels: pull-request-available > > Currently we repeat dictionary lookups every time we bind a new record batch > when doing an equality check in a DataFrame op > (https://github.com/apache/arrow/blob/master/js/src/predicate.ts#L143). > In most cases the dictionary won't be changing between record batches, so we > should remember these reverse dictionary lookups, either permanently, or at > least for the duration of the current operation. -- This message was sent by Atlassian JIRA (v7.6.3#76005)