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] fast object copy implementation using JIT codegen #1680

Open
chaokunyang opened this issue Jun 11, 2024 · 0 comments
Open

[Java] fast object copy implementation using JIT codegen #1680

chaokunyang opened this issue Jun 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chaokunyang
Copy link
Collaborator

chaokunyang commented Jun 11, 2024

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

In #1679 , the copy is implemented using loop and branch. We can optimize it by generate code to copy object attributes recusively.

Describe the solution you'd like

  • For JIT serializer, don't generate copy code in previous serializer builder. copy is not needed by all scenarios, generate code for copy will make the jit slower and use more metaspace.
  • Instead, we should generate a class which implement the copy interface and forward the copy to that class.

For example, we can add a copy forward implemetation in io.fury.builder.Generated.GeneratedSerializer:

    public Object copy(Object o) {
      Copy copier = this.copier;
      if (copier == null) {
        this.copier = copier = classResolver.getJITCopier(o.getClass());
      }
      return copier.copy(o);
    }

Additional context

#1679 #1014

@chaokunyang chaokunyang added the enhancement New feature or request label Jun 11, 2024
@chaokunyang chaokunyang changed the title [<Fury component: Protocol|Java|Python|C++|JavaScript|etc...>] [Java] fast object copy implementation using JIT codegen Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant