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

[Java] optimize MemoryBuffer.unsafeWritePositiveVarLong bytecode size #1465

Open
chaokunyang opened this issue Apr 4, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@chaokunyang
Copy link
Collaborator

chaokunyang commented Apr 4, 2024

Is your feature request related to a problem? Please describe.

The bytecode size of MemoryBuffer.unsafeWritePositiveVarLong is 466 bytes, which is too big for jvm jit inline.

image

Describe the solution you'd like

We can rewrite it using algorithms like I used in #1463

Additional context

Add any other context or screenshots about the feature request here.

@chaokunyang chaokunyang added enhancement New feature or request good first issue Good for newcomers labels Apr 4, 2024
chaokunyang pushed a commit that referenced this issue Apr 11, 2024
<!--
**Thanks for contributing to Fury.**

**If this is your first time opening a PR on fury, you can refer to
[CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).**

Contribution Checklist

- The **Apache Fury (incubating)** community has restrictions on the
naming of pr titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).

- Fury has a strong focus on performance. If the PR you submit will have
an impact on performance, please benchmark it first and provide the
benchmark result here.
-->

## Reduce unsafeWritePositiveVarLong bytecode size
Reduce bytecode size from 431 to 413.

<!-- Describe the purpose of this PR. -->


## Related issues
Through the calculation in advance to reduce memory
#1465 
<!--
Is there any related issue? Please attach here.

- #xxxx0
- #xxxx1
- #xxxx2
-->


## Does this PR introduce any user-facing change?

<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/incubator-fury/issues/new/choose)
describing the need to do so and update the document if necessary.
-->

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?


## Benchmark
pre
<img width="806" alt="image"
src="https://github.com/apache/incubator-fury/assets/46820719/6627e8ef-b681-46cb-9edd-66839d875459">

after
<img width="849" alt="image"
src="https://github.com/apache/incubator-fury/assets/46820719/ec97c0ed-3939-4149-981b-32957fd38f93">


<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant