Skip to content

Inaccurate or unclear example in tutorial documentation #486

Open
@daveagill

Description

@daveagill

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Inaccurate or unclear example in tutorial documentation · Issue #486 · OpenHFT/Chronicle-Map