You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Patrick T <so...@hotmail.com> on 2008/03/28 20:55:23 UTC

Slow JPA

Hello Everyone,

I'm just wondering if anyone else is finding JPA slower than simple jdbc
implementations. I have tried setting up some of the attributes to Lazy
fetch and I still find it to be extremely slow. This is causing my web pages
to load in the upwards of 10 seconds. I have tried running the PCEnhancer
and still takes a long time to fetch data. Does anyone have any suggestions
to speed it up? Thanks.

Patrick
-- 
View this message in context: http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


RE: Slow JPA

Posted by Christiaan <ch...@hotmail.com>.

Brill Pappin wrote:
> 
> I've just been doing some work tonight, and am finding that begin() ->
> commit() transactions take longer and longer (in my case I have a very
> large
> update that is broken down into chunks). I haven't traced the problem yet
> 
> 

I was triggered by this remark, since I had the same kind of performance
drop over multi-transactions. This was addressed in
http://issues.apache.org/jira/browse/OPENJPA-439 which should be in the 1.1
branch, not the 1.0 (though I see in a later post of you some other project
is also experiencing this with 1.1). I am still experiencing the performance
drop when using flush() instead of multiple commits:
http://issues.apache.org/jira/browse/OPENJPA-342

Also, our product is handling tens of thousands of objects (persisting /
retrieving) at a quite acceptable performance (I am using Kodo though which
has some additional features), so things should not be noticably slower just
because you are using an orm. It takes some tuning though, for instance, I
had some good experience in setting a small fetch batch size in
FetchConfiguration when iterating over large result sets.

kind regards,
Christiaan 
-- 
View this message in context: http://www.nabble.com/Slow-JPA-tp16360845p16850220.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Slow JPA

Posted by Alexander MacLennan <al...@gmail.com>.
Cool!

I'll give it a go on the weekend

thanks for the tips

cheers

Alex

On Thu, Apr 24, 2008 at 5:43 AM, Jeremy Bauer <te...@gmail.com> wrote:

> Hi Alexander,
>
> You could try taking advantage of SQL statement batching by enabling it on
> the dictionary.  Batching is currently only enabled by default for DB2 and
> Oracle providers but may work for postgres if the JDBC driver and
> dictionary supports it.  Check out the docs on statement batching here:
>
> http://openjpa.apache.org/builds/1.1.0-SNAPSHOT/docs/ref_guide_dbsetup_stmtbatch.html
>
> If it works, you'll likely need to do a bit of tuning to get the best
> performance for your application.
>
> -Jeremy
>
> On 4/22/08, Alexander MacLennan <al...@gmail.com> wrote:
> >
> > Hi,
> >
> > Its taking quite a long time in my code to store 3d model graphs to a
> > postgresql 8.3 backed db
> >
> > I am generating large data sets.. so I would expect it not to be
> > super-quick
> >
> > The data is being loaded in a loop, for each 3d model.. generate
> features
> > and store both the features and the model
> >
> > At the end of each loop iteration I persist the objects.. is there a
> > smarter
> > way of doing it so the commit speeds up?
> >
> > I have a Q9450, lots of memory and the db is sitting on a pair of
> > (mirrored)
> > 76GB WD Raptors ( there goes my scholarship money ).
> >
> > I'm using java6
> >
> > cheers
> >
> > Alex
> >
> >
> > On Fri, Apr 4, 2008 at 11:18 PM, Patrick Linskey <pl...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > Are you calling merge() or persist() a lot? There's a known
> > > inefficiency in 1.1.0-SNAPSHOT (not 1.0) with merging right now.
> > >
> > > Also, what does the generated SQL look like in your examples?
> > >
> > > -Patrick
> > >
> > > On Fri, Apr 4, 2008 at 7:55 AM, Brill Pappin <br...@pappin.ca> wrote:
> > > > We were using 1.0 in this project, but its showing up in another
> > > >  project using 1.1.
> > > >
> > > >  I really *want* to use ojpa but I don't have time to mess around
> and
> > > >  the problem is significant.
> > > >  There seem to be other inefficiencies as well that don't seem to
> need
> > > >  to be there.
> > > >
> > > >  Not sure what we're going to do about it though, all the ORM
> > > >  frameworks are going through some sort of growing pain at the
> moment
> > > >  and I can't say I'm happy with any of them.
> > > >
> > > >  - Brill Pappin
> > > >
> > > >
> > > >
> > > >  On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <
> soberdrunk22@hotmail.com>
> > > wrote:
> > > >  >
> > > >  >  My issue is even just fetching the entities. Despite of changing
> > > >  >  relationships to LAZY fetch, I find that querying the DB takes a
> > > really long
> > > >  >  time. I have experienced the commit issue as well,but I've
> worked
> > > around
> > > >  >  that by being careful on what I cascade through different
> > entities.
> > > >  >
> > > >  >
> > > >  >
> > > >  >  Brill Pappin wrote:
> > > >  >  >
> > > >  >  > As a rule you can expect *any* orm framework to be slower than
> > > simple
> > > >  >  > JDBC,
> > > >  >  > there is simply more to do... What you gain from it is ease of
> > > maintenance
> > > >  >  > and implementation which will save you time later (often a lot
> > of
> > > time).
> > > >  >  > As with anything, you need to weigh the benefits of any
> solution
> > > over
> > > >  >  > another but in my experience most applications don't require
> > such
> > > high
> > > >  >  > throughput that anyone would notice a couple of milliseconds
> > saved
> > > here
> > > >  >  > and
> > > >  >  > there... Of course it'll depend on what your doing :)
> > > >  >  >
> > > >  >  > However...
> > > >  >  >
> > > >  >  > I've just been doing some work tonight, and am finding that
> > > begin() ->
> > > >  >  > commit() transactions take longer and longer (in my case I
> have
> > a
> > > very
> > > >  >  > large
> > > >  >  > update that is broken down into chunks). I haven't traced the
> > > problem yet
> > > >  >  > and it may be configuration related, however the time grows
> > > exponentially.
> > > >  >  > Does that sound like the same problem you are having?
> > > >  >  >
> > > >  >  > - Brill
> > > >  >  >
> > > >  >  > -----Original Message-----
> > > >  >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]
> > > >  >  > Sent: Friday, March 28, 2008 3:55 PM
> > > >  >  > To: users@openjpa.apache.org
> > > >  >  > Subject: Slow JPA
> > > >  >  >
> > > >  >  >
> > > >  >  > Hello Everyone,
> > > >  >  >
> > > >  >  > I'm just wondering if anyone else is finding JPA slower than
> > > simple jdbc
> > > >  >  > implementations. I have tried setting up some of the
> attributes
> > to
> > > Lazy
> > > >  >  > fetch and I still find it to be extremely slow. This is
> causing
> > my
> > > web
> > > >  >  > pages
> > > >  >  > to load in the upwards of 10 seconds. I have tried running the
> > > PCEnhancer
> > > >  >  > and still takes a long time to fetch data. Does anyone have
> any
> > > >  >  > suggestions
> > > >  >  > to speed it up? Thanks.
> > > >  >  >
> > > >  >  > Patrick
> > > >  >  > --
> > > >  >  > View this message in context:
> > > >  >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> > > >  >  > Sent from the OpenJPA Users mailing list archive at
> Nabble.com.
> > > >  >  >
> > > >  >  >
> > > >  >  >
> > > >  >
> > > >  >  --
> > > >  >  View this message in context:
> > > http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
> > > >  >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
> > > >  >
> > > >  >
> > > >
> > >
> > >
> > >
> > > --
> > > Patrick Linskey
> > > 202 669 5907
> > >
> >
>

Re: Slow JPA

Posted by Jeremy Bauer <te...@gmail.com>.
Hi Alexander,

You could try taking advantage of SQL statement batching by enabling it on
the dictionary.  Batching is currently only enabled by default for DB2 and
Oracle providers but may work for postgres if the JDBC driver and
dictionary supports it.  Check out the docs on statement batching here:
http://openjpa.apache.org/builds/1.1.0-SNAPSHOT/docs/ref_guide_dbsetup_stmtbatch.html

If it works, you'll likely need to do a bit of tuning to get the best
performance for your application.

-Jeremy

On 4/22/08, Alexander MacLennan <al...@gmail.com> wrote:
>
> Hi,
>
> Its taking quite a long time in my code to store 3d model graphs to a
> postgresql 8.3 backed db
>
> I am generating large data sets.. so I would expect it not to be
> super-quick
>
> The data is being loaded in a loop, for each 3d model.. generate features
> and store both the features and the model
>
> At the end of each loop iteration I persist the objects.. is there a
> smarter
> way of doing it so the commit speeds up?
>
> I have a Q9450, lots of memory and the db is sitting on a pair of
> (mirrored)
> 76GB WD Raptors ( there goes my scholarship money ).
>
> I'm using java6
>
> cheers
>
> Alex
>
>
> On Fri, Apr 4, 2008 at 11:18 PM, Patrick Linskey <pl...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Are you calling merge() or persist() a lot? There's a known
> > inefficiency in 1.1.0-SNAPSHOT (not 1.0) with merging right now.
> >
> > Also, what does the generated SQL look like in your examples?
> >
> > -Patrick
> >
> > On Fri, Apr 4, 2008 at 7:55 AM, Brill Pappin <br...@pappin.ca> wrote:
> > > We were using 1.0 in this project, but its showing up in another
> > >  project using 1.1.
> > >
> > >  I really *want* to use ojpa but I don't have time to mess around and
> > >  the problem is significant.
> > >  There seem to be other inefficiencies as well that don't seem to need
> > >  to be there.
> > >
> > >  Not sure what we're going to do about it though, all the ORM
> > >  frameworks are going through some sort of growing pain at the moment
> > >  and I can't say I'm happy with any of them.
> > >
> > >  - Brill Pappin
> > >
> > >
> > >
> > >  On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <so...@hotmail.com>
> > wrote:
> > >  >
> > >  >  My issue is even just fetching the entities. Despite of changing
> > >  >  relationships to LAZY fetch, I find that querying the DB takes a
> > really long
> > >  >  time. I have experienced the commit issue as well,but I've worked
> > around
> > >  >  that by being careful on what I cascade through different
> entities.
> > >  >
> > >  >
> > >  >
> > >  >  Brill Pappin wrote:
> > >  >  >
> > >  >  > As a rule you can expect *any* orm framework to be slower than
> > simple
> > >  >  > JDBC,
> > >  >  > there is simply more to do... What you gain from it is ease of
> > maintenance
> > >  >  > and implementation which will save you time later (often a lot
> of
> > time).
> > >  >  > As with anything, you need to weigh the benefits of any solution
> > over
> > >  >  > another but in my experience most applications don't require
> such
> > high
> > >  >  > throughput that anyone would notice a couple of milliseconds
> saved
> > here
> > >  >  > and
> > >  >  > there... Of course it'll depend on what your doing :)
> > >  >  >
> > >  >  > However...
> > >  >  >
> > >  >  > I've just been doing some work tonight, and am finding that
> > begin() ->
> > >  >  > commit() transactions take longer and longer (in my case I have
> a
> > very
> > >  >  > large
> > >  >  > update that is broken down into chunks). I haven't traced the
> > problem yet
> > >  >  > and it may be configuration related, however the time grows
> > exponentially.
> > >  >  > Does that sound like the same problem you are having?
> > >  >  >
> > >  >  > - Brill
> > >  >  >
> > >  >  > -----Original Message-----
> > >  >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]
> > >  >  > Sent: Friday, March 28, 2008 3:55 PM
> > >  >  > To: users@openjpa.apache.org
> > >  >  > Subject: Slow JPA
> > >  >  >
> > >  >  >
> > >  >  > Hello Everyone,
> > >  >  >
> > >  >  > I'm just wondering if anyone else is finding JPA slower than
> > simple jdbc
> > >  >  > implementations. I have tried setting up some of the attributes
> to
> > Lazy
> > >  >  > fetch and I still find it to be extremely slow. This is causing
> my
> > web
> > >  >  > pages
> > >  >  > to load in the upwards of 10 seconds. I have tried running the
> > PCEnhancer
> > >  >  > and still takes a long time to fetch data. Does anyone have any
> > >  >  > suggestions
> > >  >  > to speed it up? Thanks.
> > >  >  >
> > >  >  > Patrick
> > >  >  > --
> > >  >  > View this message in context:
> > >  >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> > >  >  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> > >  >  >
> > >  >  >
> > >  >  >
> > >  >
> > >  >  --
> > >  >  View this message in context:
> > http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
> > >  >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
> > >  >
> > >  >
> > >
> >
> >
> >
> > --
> > Patrick Linskey
> > 202 669 5907
> >
>

RE: Slow JPA

Posted by Brill Pappin <br...@pappin.ca>.
We had the same problem, but right now your in a better position to help the
developers debug the issue.
It's clearly an expected usage that's not working quite right.

- Brill 

-----Original Message-----
From: Alexander MacLennan [mailto:alex.maclennan@gmail.com] 
Sent: Tuesday, April 22, 2008 11:51 PM
To: users@openjpa.apache.org
Subject: Re: Slow JPA

Hi,

Its taking quite a long time in my code to store 3d model graphs to a
postgresql 8.3 backed db

I am generating large data sets.. so I would expect it not to be super-quick

The data is being loaded in a loop, for each 3d model.. generate features
and store both the features and the model

At the end of each loop iteration I persist the objects.. is there a smarter
way of doing it so the commit speeds up?

I have a Q9450, lots of memory and the db is sitting on a pair of (mirrored)
76GB WD Raptors ( there goes my scholarship money ).

I'm using java6

cheers

Alex


On Fri, Apr 4, 2008 at 11:18 PM, Patrick Linskey <pl...@gmail.com> wrote:

> Hi,
>
> Are you calling merge() or persist() a lot? There's a known 
> inefficiency in 1.1.0-SNAPSHOT (not 1.0) with merging right now.
>
> Also, what does the generated SQL look like in your examples?
>
> -Patrick
>
> On Fri, Apr 4, 2008 at 7:55 AM, Brill Pappin <br...@pappin.ca> wrote:
> > We were using 1.0 in this project, but its showing up in another  
> > project using 1.1.
> >
> >  I really *want* to use ojpa but I don't have time to mess around 
> > and  the problem is significant.
> >  There seem to be other inefficiencies as well that don't seem to 
> > need  to be there.
> >
> >  Not sure what we're going to do about it though, all the ORM  
> > frameworks are going through some sort of growing pain at the moment  
> > and I can't say I'm happy with any of them.
> >
> >  - Brill Pappin
> >
> >
> >
> >  On Fri, Apr 4, 2008 at 10:44 AM, Patrick T 
> > <so...@hotmail.com>
> wrote:
> >  >
> >  >  My issue is even just fetching the entities. Despite of changing  
> > >  relationships to LAZY fetch, I find that querying the DB takes a
> really long
> >  >  time. I have experienced the commit issue as well,but I've 
> > worked
> around
> >  >  that by being careful on what I cascade through different entities.
> >  >
> >  >
> >  >
> >  >  Brill Pappin wrote:
> >  >  >
> >  >  > As a rule you can expect *any* orm framework to be slower than
> simple
> >  >  > JDBC,
> >  >  > there is simply more to do... What you gain from it is ease of
> maintenance
> >  >  > and implementation which will save you time later (often a lot 
> > of
> time).
> >  >  > As with anything, you need to weigh the benefits of any 
> > solution
> over
> >  >  > another but in my experience most applications don't require 
> > such
> high
> >  >  > throughput that anyone would notice a couple of milliseconds 
> > saved
> here
> >  >  > and
> >  >  > there... Of course it'll depend on what your doing :)  >  >  >  
> > > However...
> >  >  >
> >  >  > I've just been doing some work tonight, and am finding that
> begin() ->
> >  >  > commit() transactions take longer and longer (in my case I 
> > have a
> very
> >  >  > large
> >  >  > update that is broken down into chunks). I haven't traced the
> problem yet
> >  >  > and it may be configuration related, however the time grows
> exponentially.
> >  >  > Does that sound like the same problem you are having?
> >  >  >
> >  >  > - Brill
> >  >  >
> >  >  > -----Original Message-----
> >  >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]  >  > Sent: 
> > Friday, March 28, 2008 3:55 PM  >  > To: users@openjpa.apache.org  >  
> > > Subject: Slow JPA  >  >  >  >  >  > Hello Everyone,  >  >  >  > 
> > I'm just wondering if anyone else is finding JPA slower than
> simple jdbc
> >  >  > implementations. I have tried setting up some of the 
> > attributes to
> Lazy
> >  >  > fetch and I still find it to be extremely slow. This is 
> > causing my
> web
> >  >  > pages
> >  >  > to load in the upwards of 10 seconds. I have tried running the
> PCEnhancer
> >  >  > and still takes a long time to fetch data. Does anyone have 
> > any  >  > suggestions  >  > to speed it up? Thanks.
> >  >  >
> >  >  > Patrick
> >  >  > --
> >  >  > View this message in context:
> >  >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> >  >  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >  >  >
> >  >  >
> >  >  >
> >  >
> >  >  --
> >  >  View this message in context:
> http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
> >  >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >  >
> >  >
> >
>
>
>
> --
> Patrick Linskey
> 202 669 5907
>


Re: Slow JPA

Posted by Alexander MacLennan <al...@gmail.com>.
Hi,

Its taking quite a long time in my code to store 3d model graphs to a
postgresql 8.3 backed db

I am generating large data sets.. so I would expect it not to be super-quick

The data is being loaded in a loop, for each 3d model.. generate features
and store both the features and the model

At the end of each loop iteration I persist the objects.. is there a smarter
way of doing it so the commit speeds up?

I have a Q9450, lots of memory and the db is sitting on a pair of (mirrored)
76GB WD Raptors ( there goes my scholarship money ).

I'm using java6

cheers

Alex


On Fri, Apr 4, 2008 at 11:18 PM, Patrick Linskey <pl...@gmail.com> wrote:

> Hi,
>
> Are you calling merge() or persist() a lot? There's a known
> inefficiency in 1.1.0-SNAPSHOT (not 1.0) with merging right now.
>
> Also, what does the generated SQL look like in your examples?
>
> -Patrick
>
> On Fri, Apr 4, 2008 at 7:55 AM, Brill Pappin <br...@pappin.ca> wrote:
> > We were using 1.0 in this project, but its showing up in another
> >  project using 1.1.
> >
> >  I really *want* to use ojpa but I don't have time to mess around and
> >  the problem is significant.
> >  There seem to be other inefficiencies as well that don't seem to need
> >  to be there.
> >
> >  Not sure what we're going to do about it though, all the ORM
> >  frameworks are going through some sort of growing pain at the moment
> >  and I can't say I'm happy with any of them.
> >
> >  - Brill Pappin
> >
> >
> >
> >  On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <so...@hotmail.com>
> wrote:
> >  >
> >  >  My issue is even just fetching the entities. Despite of changing
> >  >  relationships to LAZY fetch, I find that querying the DB takes a
> really long
> >  >  time. I have experienced the commit issue as well,but I've worked
> around
> >  >  that by being careful on what I cascade through different entities.
> >  >
> >  >
> >  >
> >  >  Brill Pappin wrote:
> >  >  >
> >  >  > As a rule you can expect *any* orm framework to be slower than
> simple
> >  >  > JDBC,
> >  >  > there is simply more to do... What you gain from it is ease of
> maintenance
> >  >  > and implementation which will save you time later (often a lot of
> time).
> >  >  > As with anything, you need to weigh the benefits of any solution
> over
> >  >  > another but in my experience most applications don't require such
> high
> >  >  > throughput that anyone would notice a couple of milliseconds saved
> here
> >  >  > and
> >  >  > there... Of course it'll depend on what your doing :)
> >  >  >
> >  >  > However...
> >  >  >
> >  >  > I've just been doing some work tonight, and am finding that
> begin() ->
> >  >  > commit() transactions take longer and longer (in my case I have a
> very
> >  >  > large
> >  >  > update that is broken down into chunks). I haven't traced the
> problem yet
> >  >  > and it may be configuration related, however the time grows
> exponentially.
> >  >  > Does that sound like the same problem you are having?
> >  >  >
> >  >  > - Brill
> >  >  >
> >  >  > -----Original Message-----
> >  >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]
> >  >  > Sent: Friday, March 28, 2008 3:55 PM
> >  >  > To: users@openjpa.apache.org
> >  >  > Subject: Slow JPA
> >  >  >
> >  >  >
> >  >  > Hello Everyone,
> >  >  >
> >  >  > I'm just wondering if anyone else is finding JPA slower than
> simple jdbc
> >  >  > implementations. I have tried setting up some of the attributes to
> Lazy
> >  >  > fetch and I still find it to be extremely slow. This is causing my
> web
> >  >  > pages
> >  >  > to load in the upwards of 10 seconds. I have tried running the
> PCEnhancer
> >  >  > and still takes a long time to fetch data. Does anyone have any
> >  >  > suggestions
> >  >  > to speed it up? Thanks.
> >  >  >
> >  >  > Patrick
> >  >  > --
> >  >  > View this message in context:
> >  >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> >  >  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >  >  >
> >  >  >
> >  >  >
> >  >
> >  >  --
> >  >  View this message in context:
> http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
> >  >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >  >
> >  >
> >
>
>
>
> --
> Patrick Linskey
> 202 669 5907
>

Re: Slow JPA

Posted by Patrick Linskey <pl...@gmail.com>.
Hi,

Are you calling merge() or persist() a lot? There's a known
inefficiency in 1.1.0-SNAPSHOT (not 1.0) with merging right now.

Also, what does the generated SQL look like in your examples?

-Patrick

On Fri, Apr 4, 2008 at 7:55 AM, Brill Pappin <br...@pappin.ca> wrote:
> We were using 1.0 in this project, but its showing up in another
>  project using 1.1.
>
>  I really *want* to use ojpa but I don't have time to mess around and
>  the problem is significant.
>  There seem to be other inefficiencies as well that don't seem to need
>  to be there.
>
>  Not sure what we're going to do about it though, all the ORM
>  frameworks are going through some sort of growing pain at the moment
>  and I can't say I'm happy with any of them.
>
>  - Brill Pappin
>
>
>
>  On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <so...@hotmail.com> wrote:
>  >
>  >  My issue is even just fetching the entities. Despite of changing
>  >  relationships to LAZY fetch, I find that querying the DB takes a really long
>  >  time. I have experienced the commit issue as well,but I've worked around
>  >  that by being careful on what I cascade through different entities.
>  >
>  >
>  >
>  >  Brill Pappin wrote:
>  >  >
>  >  > As a rule you can expect *any* orm framework to be slower than simple
>  >  > JDBC,
>  >  > there is simply more to do... What you gain from it is ease of maintenance
>  >  > and implementation which will save you time later (often a lot of time).
>  >  > As with anything, you need to weigh the benefits of any solution over
>  >  > another but in my experience most applications don't require such high
>  >  > throughput that anyone would notice a couple of milliseconds saved here
>  >  > and
>  >  > there... Of course it'll depend on what your doing :)
>  >  >
>  >  > However...
>  >  >
>  >  > I've just been doing some work tonight, and am finding that begin() ->
>  >  > commit() transactions take longer and longer (in my case I have a very
>  >  > large
>  >  > update that is broken down into chunks). I haven't traced the problem yet
>  >  > and it may be configuration related, however the time grows exponentially.
>  >  > Does that sound like the same problem you are having?
>  >  >
>  >  > - Brill
>  >  >
>  >  > -----Original Message-----
>  >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]
>  >  > Sent: Friday, March 28, 2008 3:55 PM
>  >  > To: users@openjpa.apache.org
>  >  > Subject: Slow JPA
>  >  >
>  >  >
>  >  > Hello Everyone,
>  >  >
>  >  > I'm just wondering if anyone else is finding JPA slower than simple jdbc
>  >  > implementations. I have tried setting up some of the attributes to Lazy
>  >  > fetch and I still find it to be extremely slow. This is causing my web
>  >  > pages
>  >  > to load in the upwards of 10 seconds. I have tried running the PCEnhancer
>  >  > and still takes a long time to fetch data. Does anyone have any
>  >  > suggestions
>  >  > to speed it up? Thanks.
>  >  >
>  >  > Patrick
>  >  > --
>  >  > View this message in context:
>  >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
>  >  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
>  >  >
>  >  >
>  >  >
>  >
>  >  --
>  >  View this message in context: http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
>  >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
>  >
>  >
>



-- 
Patrick Linskey
202 669 5907

RE: Slow JPA

Posted by Brill Pappin <br...@pappin.ca>.
 We don't have time to run it through YourKit and try to trace the issues,
but my partner and I feel strongly that if we want something good, we can
pitch in to help get it fixed. To that end, we'll attempt to provide some
sample code that can reproduce the specific problem we were having.

Not sure exactly when, but we'll drop in an issue in JIRA when we get to it.

- Brill Pappin

-----Original Message-----
From: Kevin Sutter [mailto:kwsutter@gmail.com] 
Sent: Friday, April 04, 2008 11:22 AM
To: users@openjpa.apache.org
Subject: Re: Slow JPA

Brill and others,
Thanks for the feedback.  As one of the notes indicated, any orm framework
is going to be slower than straight JDBC, but it shouldn't be significant.
Understanding and controlling what entities get fetched (lazy vs eager) is
an excellent first step.  It sounds like you are already investigating that.
If the standard JPA lazy vs eager annotations are not granular enough for
your usage, then you may want to take a look at OpenJPA's FetchPlans and
FetchGroups (
http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_fetch).

We are constantly looking at the performance of OpenJPA and attempting to
improve it.  One of the changes that Patrick recently introduced was
removing the JDK 4 requirement for some of our "kernel" modules.
Surprisingly, this "little change" helped the performance of our benchmarks.
This was introduced in the 1.1.0 branch of OpenJPA.

If you can provide more details on your specific scenarios (database, sql,
entity definitions and interactions, etc), maybe we can help pinpoint the
areas of concern.  Our goal is to have OpenJPA be the best performing JPA
implementation available, so we would appreciate the feedback.

Thanks,
Kevin

On Fri, Apr 4, 2008 at 9:55 AM, Brill Pappin <br...@pappin.ca> wrote:

> We were using 1.0 in this project, but its showing up in another 
> project using 1.1.
>
> I really *want* to use ojpa but I don't have time to mess around and 
> the problem is significant.
> There seem to be other inefficiencies as well that don't seem to need 
> to be there.
>
> Not sure what we're going to do about it though, all the ORM 
> frameworks are going through some sort of growing pain at the moment 
> and I can't say I'm happy with any of them.
>
> - Brill Pappin
>
> On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <so...@hotmail.com>
> wrote:
> >
> >  My issue is even just fetching the entities. Despite of changing  
> > relationships to LAZY fetch, I find that querying the DB takes a 
> > really
> long
> >  time. I have experienced the commit issue as well,but I've worked
> around
> >  that by being careful on what I cascade through different entities.
> >
> >
> >
> >  Brill Pappin wrote:
> >  >
> >  > As a rule you can expect *any* orm framework to be slower than 
> > simple  > JDBC,  > there is simply more to do... What you gain from 
> > it is ease of
> maintenance
> >  > and implementation which will save you time later (often a lot of
> time).
> >  > As with anything, you need to weigh the benefits of any solution 
> > over  > another but in my experience most applications don't require 
> > such
> high
> >  > throughput that anyone would notice a couple of milliseconds 
> > saved
> here
> >  > and
> >  > there... Of course it'll depend on what your doing :)  >  > 
> > However...
> >  >
> >  > I've just been doing some work tonight, and am finding that 
> > begin()
> ->
> >  > commit() transactions take longer and longer (in my case I have a
> very
> >  > large
> >  > update that is broken down into chunks). I haven't traced the 
> > problem
> yet
> >  > and it may be configuration related, however the time grows
> exponentially.
> >  > Does that sound like the same problem you are having?
> >  >
> >  > - Brill
> >  >
> >  > -----Original Message-----
> >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]  > Sent: 
> > Friday, March 28, 2008 3:55 PM  > To: users@openjpa.apache.org  > 
> > Subject: Slow JPA  >  >  > Hello Everyone,  >  > I'm just wondering 
> > if anyone else is finding JPA slower than simple
> jdbc
> >  > implementations. I have tried setting up some of the attributes 
> > to
> Lazy
> >  > fetch and I still find it to be extremely slow. This is causing 
> > my
> web
> >  > pages
> >  > to load in the upwards of 10 seconds. I have tried running the
> PCEnhancer
> >  > and still takes a long time to fetch data. Does anyone have any  
> > > suggestions  > to speed it up? Thanks.
> >  >
> >  > Patrick
> >  > --
> >  > View this message in context:
> >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> >  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >  >
> >  >
> >  >
> >
> >  --
> >  View this message in context:
> http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
> >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >
> >
>


Re: Slow JPA

Posted by Kevin Sutter <kw...@gmail.com>.
Brill and others,
Thanks for the feedback.  As one of the notes indicated, any orm framework
is going to be slower than straight JDBC, but it shouldn't be significant.
Understanding and controlling what entities get fetched (lazy vs eager) is
an excellent first step.  It sounds like you are already investigating
that.  If the standard JPA lazy vs eager annotations are not granular enough
for your usage, then you may want to take a look at OpenJPA's FetchPlans and
FetchGroups (
http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_fetch).

We are constantly looking at the performance of OpenJPA and attempting to
improve it.  One of the changes that Patrick recently introduced was
removing the JDK 4 requirement for some of our "kernel" modules.
Surprisingly, this "little change" helped the performance of our
benchmarks.  This was introduced in the 1.1.0 branch of OpenJPA.

If you can provide more details on your specific scenarios (database, sql,
entity definitions and interactions, etc), maybe we can help pinpoint the
areas of concern.  Our goal is to have OpenJPA be the best performing JPA
implementation available, so we would appreciate the feedback.

Thanks,
Kevin

On Fri, Apr 4, 2008 at 9:55 AM, Brill Pappin <br...@pappin.ca> wrote:

> We were using 1.0 in this project, but its showing up in another
> project using 1.1.
>
> I really *want* to use ojpa but I don't have time to mess around and
> the problem is significant.
> There seem to be other inefficiencies as well that don't seem to need
> to be there.
>
> Not sure what we're going to do about it though, all the ORM
> frameworks are going through some sort of growing pain at the moment
> and I can't say I'm happy with any of them.
>
> - Brill Pappin
>
> On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <so...@hotmail.com>
> wrote:
> >
> >  My issue is even just fetching the entities. Despite of changing
> >  relationships to LAZY fetch, I find that querying the DB takes a really
> long
> >  time. I have experienced the commit issue as well,but I've worked
> around
> >  that by being careful on what I cascade through different entities.
> >
> >
> >
> >  Brill Pappin wrote:
> >  >
> >  > As a rule you can expect *any* orm framework to be slower than simple
> >  > JDBC,
> >  > there is simply more to do... What you gain from it is ease of
> maintenance
> >  > and implementation which will save you time later (often a lot of
> time).
> >  > As with anything, you need to weigh the benefits of any solution over
> >  > another but in my experience most applications don't require such
> high
> >  > throughput that anyone would notice a couple of milliseconds saved
> here
> >  > and
> >  > there... Of course it'll depend on what your doing :)
> >  >
> >  > However...
> >  >
> >  > I've just been doing some work tonight, and am finding that begin()
> ->
> >  > commit() transactions take longer and longer (in my case I have a
> very
> >  > large
> >  > update that is broken down into chunks). I haven't traced the problem
> yet
> >  > and it may be configuration related, however the time grows
> exponentially.
> >  > Does that sound like the same problem you are having?
> >  >
> >  > - Brill
> >  >
> >  > -----Original Message-----
> >  > From: Patrick T [mailto:soberdrunk22@hotmail.com]
> >  > Sent: Friday, March 28, 2008 3:55 PM
> >  > To: users@openjpa.apache.org
> >  > Subject: Slow JPA
> >  >
> >  >
> >  > Hello Everyone,
> >  >
> >  > I'm just wondering if anyone else is finding JPA slower than simple
> jdbc
> >  > implementations. I have tried setting up some of the attributes to
> Lazy
> >  > fetch and I still find it to be extremely slow. This is causing my
> web
> >  > pages
> >  > to load in the upwards of 10 seconds. I have tried running the
> PCEnhancer
> >  > and still takes a long time to fetch data. Does anyone have any
> >  > suggestions
> >  > to speed it up? Thanks.
> >  >
> >  > Patrick
> >  > --
> >  > View this message in context:
> >  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> >  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >  >
> >  >
> >  >
> >
> >  --
> >  View this message in context:
> http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
> >  Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >
> >
>

Re: Slow JPA

Posted by Brill Pappin <br...@pappin.ca>.
We were using 1.0 in this project, but its showing up in another
project using 1.1.

I really *want* to use ojpa but I don't have time to mess around and
the problem is significant.
There seem to be other inefficiencies as well that don't seem to need
to be there.

Not sure what we're going to do about it though, all the ORM
frameworks are going through some sort of growing pain at the moment
and I can't say I'm happy with any of them.

- Brill Pappin

On Fri, Apr 4, 2008 at 10:44 AM, Patrick T <so...@hotmail.com> wrote:
>
>  My issue is even just fetching the entities. Despite of changing
>  relationships to LAZY fetch, I find that querying the DB takes a really long
>  time. I have experienced the commit issue as well,but I've worked around
>  that by being careful on what I cascade through different entities.
>
>
>
>  Brill Pappin wrote:
>  >
>  > As a rule you can expect *any* orm framework to be slower than simple
>  > JDBC,
>  > there is simply more to do... What you gain from it is ease of maintenance
>  > and implementation which will save you time later (often a lot of time).
>  > As with anything, you need to weigh the benefits of any solution over
>  > another but in my experience most applications don't require such high
>  > throughput that anyone would notice a couple of milliseconds saved here
>  > and
>  > there... Of course it'll depend on what your doing :)
>  >
>  > However...
>  >
>  > I've just been doing some work tonight, and am finding that begin() ->
>  > commit() transactions take longer and longer (in my case I have a very
>  > large
>  > update that is broken down into chunks). I haven't traced the problem yet
>  > and it may be configuration related, however the time grows exponentially.
>  > Does that sound like the same problem you are having?
>  >
>  > - Brill
>  >
>  > -----Original Message-----
>  > From: Patrick T [mailto:soberdrunk22@hotmail.com]
>  > Sent: Friday, March 28, 2008 3:55 PM
>  > To: users@openjpa.apache.org
>  > Subject: Slow JPA
>  >
>  >
>  > Hello Everyone,
>  >
>  > I'm just wondering if anyone else is finding JPA slower than simple jdbc
>  > implementations. I have tried setting up some of the attributes to Lazy
>  > fetch and I still find it to be extremely slow. This is causing my web
>  > pages
>  > to load in the upwards of 10 seconds. I have tried running the PCEnhancer
>  > and still takes a long time to fetch data. Does anyone have any
>  > suggestions
>  > to speed it up? Thanks.
>  >
>  > Patrick
>  > --
>  > View this message in context:
>  > http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
>  > Sent from the OpenJPA Users mailing list archive at Nabble.com.
>  >
>  >
>  >
>
>  --
>  View this message in context: http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
>  Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>

RE: Slow JPA

Posted by Patrick T <so...@hotmail.com>.
My issue is even just fetching the entities. Despite of changing
relationships to LAZY fetch, I find that querying the DB takes a really long
time. I have experienced the commit issue as well,but I've worked around
that by being careful on what I cascade through different entities.



Brill Pappin wrote:
> 
> As a rule you can expect *any* orm framework to be slower than simple
> JDBC,
> there is simply more to do... What you gain from it is ease of maintenance
> and implementation which will save you time later (often a lot of time).
> As with anything, you need to weigh the benefits of any solution over
> another but in my experience most applications don't require such high
> throughput that anyone would notice a couple of milliseconds saved here
> and
> there... Of course it'll depend on what your doing :)
> 
> However...
> 
> I've just been doing some work tonight, and am finding that begin() ->
> commit() transactions take longer and longer (in my case I have a very
> large
> update that is broken down into chunks). I haven't traced the problem yet
> and it may be configuration related, however the time grows exponentially.
> Does that sound like the same problem you are having?
> 
> - Brill
> 
> -----Original Message-----
> From: Patrick T [mailto:soberdrunk22@hotmail.com] 
> Sent: Friday, March 28, 2008 3:55 PM
> To: users@openjpa.apache.org
> Subject: Slow JPA
> 
> 
> Hello Everyone,
> 
> I'm just wondering if anyone else is finding JPA slower than simple jdbc
> implementations. I have tried setting up some of the attributes to Lazy
> fetch and I still find it to be extremely slow. This is causing my web
> pages
> to load in the upwards of 10 seconds. I have tried running the PCEnhancer
> and still takes a long time to fetch data. Does anyone have any
> suggestions
> to speed it up? Thanks.
> 
> Patrick
> --
> View this message in context:
> http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Slow-JPA-tp16360845p16491755.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


RE: Slow JPA

Posted by Brill Pappin <br...@pappin.ca>.
As a rule you can expect *any* orm framework to be slower than simple JDBC,
there is simply more to do... What you gain from it is ease of maintenance
and implementation which will save you time later (often a lot of time).
As with anything, you need to weigh the benefits of any solution over
another but in my experience most applications don't require such high
throughput that anyone would notice a couple of milliseconds saved here and
there... Of course it'll depend on what your doing :)

However...

I've just been doing some work tonight, and am finding that begin() ->
commit() transactions take longer and longer (in my case I have a very large
update that is broken down into chunks). I haven't traced the problem yet
and it may be configuration related, however the time grows exponentially.
Does that sound like the same problem you are having?

- Brill

-----Original Message-----
From: Patrick T [mailto:soberdrunk22@hotmail.com] 
Sent: Friday, March 28, 2008 3:55 PM
To: users@openjpa.apache.org
Subject: Slow JPA


Hello Everyone,

I'm just wondering if anyone else is finding JPA slower than simple jdbc
implementations. I have tried setting up some of the attributes to Lazy
fetch and I still find it to be extremely slow. This is causing my web pages
to load in the upwards of 10 seconds. I have tried running the PCEnhancer
and still takes a long time to fetch data. Does anyone have any suggestions
to speed it up? Thanks.

Patrick
--
View this message in context:
http://www.nabble.com/Slow-JPA-tp16360845p16360845.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.