Skip to content

[Java] use varint for class id encoding to reduce space cost#945

Merged
chaokunyang merged 2 commits intoapache:mainfrom
chaokunyang:reduce_cost_of_writeclassinfo
Oct 5, 2023
Merged

[Java] use varint for class id encoding to reduce space cost#945
chaokunyang merged 2 commits intoapache:mainfrom
chaokunyang:reduce_cost_of_writeclassinfo

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented Oct 5, 2023

What do these changes do?

This PR use varint for class id encoding to reduce java class writing space cost.

Before this PR, class id will be written as 3 bytes:

| flag byte | two bytes short class id|

With this PR, class id will be written as 1~3 bytes, and for most common used jdk types such as String, class id will be written using 1 bytes, which is much more efficient.

Related issue number

Closes #944

Check code requirements

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

@chaokunyang chaokunyang changed the title [Java] use varint for class id read/write [Java] use varint for class id encoding to reduce space cost Oct 5, 2023
@chaokunyang chaokunyang merged commit 4b135c5 into apache:main Oct 5, 2023
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] use varint for class id to reduce space cost

1 participant