Hmm, you need to take multiple things into account to compare it fairly:

1. as Andy mentionned extended persistence context do way more than what
you compare to so remove the extended and use something which scales like
@ApplicationScoped @Transactional or @Singleton @ConcurrencyManagement(BEAN)
2. you are using JPA with bean validation so maybe deactivate this layer
too - we can enhance it on master



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-06-20 8:53 GMT+02:00 Andy Gumbrecht <agumbre...@tomitribe.com>:

> So just at a super quick glance - Before we start to anything else.
>
> You should modify the code to use the same (identical) random data for both
> tests.
> Add hibernate.jdbc.batch_size = 25 to your persistence.xml properties
> Never use @Stateful unless you really understand why you should, i.e. use
> @Stateless for your JpaMovies
> Use entityManager#find rather than a query
>
> Hope this is a quick insight, but I'd also be interested to see the results
> on just these few changes.
>
> Andy.
>
> On 20 June 2017 at 05:31, Laird Nelson <ljnel...@gmail.com> wrote:
>
> > Have you sat down for a good long reading session with
> > http://java-persistence-performance.blogspot.com/?  I found that site
> > invaluable.
> >
> > Best,
> > Laird
> > --
> > http://about.me/lairdnelson
> >
> > On Mon, Jun 19, 2017 at 8:22 PM sgjava <sgj...@gmail.com> wrote:
> >
> > > I just built a project to compare JPA+Hibernate to a DBUtils
> > > implementation.
> > > DBUtils is a lot faster by a large margin. Can anyone tell me if they
> > have
> > > tuned JPA to perform better? I used TomEE 7.0.4-SNAPSHOT. I could live
> > with
> > > maybe a 10% difference, but I'm talking about 10 to 10 times slower!
> > >
> > > https://github.com/sgjava/jpavsdbutils
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://tomee-openejb.979440.n4.nabble.com/JPA-vs-DBUtils-
> tp4681918.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
>   Andy Gumbrecht
>   https://twitter.com/AndyGeeDe
>   http://www.tomitribe.com
>

Reply via email to