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] Implement jit serialization for object #250

Merged
merged 7 commits into from
May 16, 2023

Conversation

chaokunyang
Copy link
Collaborator

@chaokunyang chaokunyang commented May 16, 2023

What do these changes do?

This PR implements jit serialization for custom object type.

In order to improve jit-compile and inline, serialization code should be spilt groups to avoid huge/big methods.
With meta context share enabled and compatible mode, this serializer will take all non-inner final types as non-final, so that fury can write class definition when write class info for those types.

We took stats for some fields with reference enabled, and split methods based on those metrics. If reference is disabled, the split methods will be small and jit-inline still applies. We don't take stats for disabled reference to reduce complexities: Following stats are for reference only, and it's not precise.

  • compiled code for writing every primitive is 22/21 bytes.
  • compiled code for write/read every boxed primitive is 38/35 bytes.
  • compiled code for write/read every boxed primitive with ref_tracking is 40/81 bytes.
  • compiled code for write/read every final field on average is 41/82 bytes.
  • compiled code for write/read every List on average is 191/201 bytes.
  • compiled code for write/read every List with boxed ref_tracking on average is 194/240 bytes.
  • compiled code for write/read every List on average is 196/238 bytes.
  • compiled code for write/read every Map<boxed, boxed> on average is 270/196 bytes.
  • compiled code for write/read every Map<boxed, boxed> with boxed ref_tracking on average is 266/296 bytes.
  • compiled code for write/read every Map<final, final> on average is 268/292 bytes.
  • compiled code for write/read every non-final field on average is 41/75 bytes.
    Split heuristics based on previous code stats. If code stats changes, split heuristics should update too.

Related issue number

Closes #237

Check code requirements

  • tests added / passed (if needed)
  • Ensure all linting tests pass, see here for how to run them

@chaokunyang chaokunyang merged commit 2b6cca0 into main May 16, 2023
2 of 5 checks passed
@chaokunyang chaokunyang deleted the jit_object_serializer branch May 16, 2023 07:36
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.

[Java] generate serializer for object serialization
1 participant