Skip to content

Conversation

@zhenlineo
Copy link
Contributor

The previous impl gives O(n) complexity because of index lookup in keys list. As the API of two Record#get methods are so similar, it is a valid assumption that the performance of two methods shall be the same.
This PR introduces a lookup map to use one extra small space to improve Record#get(String key) complexity from O(n) to O(1).

The previous impl gives O(n) complexity because of index lookup in keys list. As the API of two Record#get methods are so similar, it is a valid assumption that the performance of two methods shall be the same.
This PR introduces a lookup map to use one extra small space to improve `Record#get(String key)` complexity from O(n) to O(1).
@zhenlineo zhenlineo linked an issue Apr 9, 2020 that may be closed by this pull request
@zhenlineo zhenlineo requested a review from gjmwoods April 9, 2020 13:22
@zhenlineo zhenlineo merged commit cc08efb into neo4j:4.0 Apr 14, 2020
@zhenlineo zhenlineo deleted the 4.0-record-get-with-key branch April 14, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InternalRecord using List#indexOf()

2 participants