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

Delegating proxy instantiation to Javassist #137

Merged
merged 1 commit into from
Sep 27, 2013

Conversation

garcia-jj
Copy link
Member

Since CDI have restriction that all managed classes have a default constructor, we don't need objenesis anymore. The best benefit is performance, because Objenesis have your own instantiators cache, and Javassist have another cache for instrumented classes. If Javassist is responsible to create instances, we don't need both caches.

But I don't know if reflection is more faster then Objenesis.

Internally, Javassist uses Java reflection to create instances.

@garcia-jj
Copy link
Member Author

I did some tests as logged here: https://gist.github.com/garcia-jj/6726261

Objenesis and reflection have the same performance when create instances calling default constructor.

garcia-jj added a commit that referenced this pull request Sep 27, 2013
Delegating proxy instantiation to Javassist
@garcia-jj garcia-jj merged commit bc4752b into master Sep 27, 2013
@garcia-jj garcia-jj deleted the ot-proxifier-without-jvmhacks branch September 27, 2013 13:14
} catch (Throwable throwable) {
throw new ProxyInvocationException(throwable);
}
class CustomHandler<T>
Copy link
Member

Choose a reason for hiding this comment

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

Didn't like this name... Since you've extracted a class, you should give a more meaningful name

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed by f56903d

@Turini Turini modified the milestone: 4.0.0-beta-1 Mar 6, 2014
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.

3 participants