Skip to content

IGNITE-21063 Optimize memory usage in optimized marshaller#2950

Merged
ibessonov merged 6 commits intoapache:mainfrom
gridgain:ignite-21063
Dec 13, 2023
Merged

IGNITE-21063 Optimize memory usage in optimized marshaller#2950
ibessonov merged 6 commits intoapache:mainfrom
gridgain:ignite-21063

Conversation

@ibessonov
Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/IGNITE-21063

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
}

if (size.get() < capacity && size.getAndIncrement() < capacity) {
return ByteBuffer.allocate(DEFAULT_BUFFER_SIZE).order(OptimizedMarshaller.ORDER);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a little unclear to me that it should create a buffer with a default size, can it be passed as an argument?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be, but why would I over-complicate things. Maybe default size should be a parameter in the constructor, but do we really need that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do it through the method, the constructor is a little worse, at your discretion.

Signed-off-by: ibessonov <bessonov.ip@gmail.com>
Signed-off-by: ibessonov <bessonov.ip@gmail.com>
@ibessonov ibessonov merged commit 7620cb8 into apache:main Dec 13, 2023
@ibessonov ibessonov deleted the ignite-21063 branch December 13, 2023 13:38
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.

2 participants