Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate or unclear example in tutorial documentation #486

Open
daveagill opened this issue Jul 18, 2023 · 0 comments
Open

Inaccurate or unclear example in tutorial documentation #486

daveagill opened this issue Jul 18, 2023 · 0 comments
Labels

Comments

@daveagill
Copy link

daveagill commented Jul 18, 2023

There is some potential misinformation in an example from the tutorial titled "Working with an entry within a context"

The example has this line of code and proceeding comment:

PostalCodeRange range = entry.value().get();
// Access the off-heap memory directly, by calling range
// object getters.
// This is very rewarding, when the value has a lot of fields
// and expensive to copy to heap all of them, when you need to access
// just a few fields.

The comment seems to suggest that invoking getters would only deserialize the relevant part of the object from the off-heap storage.

However from poking around the source it seems to me that entry.value() returns a CompiledMapQueryContext$EntryValueBytesData (which I have confirmed in a pet project) and the get() method deserializes the entire value into a cached object. Really no different from calling getUsing() and passing in your own object.

My belief is the comment is simply incorrect. But looking for confirmation?

@tgd tgd added the review label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants