Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Performance JPA Date: Fri, 20 Nov 2015 09:04:44 +0100 Organization: Decebal Computing Lines: 32 Message-ID: <8737w114gz.fsf@Equus.decebal.nl> References: <87lhagkcsh.fsf@Equus.decebal.nl> <563763d9$0$23727$e4fe514c@news.xs4all.nl> <87d1vrk20x.fsf@Equus.decebal.nl> <87ziyvhs0r.fsf@Equus.decebal.nl> <87mvuui2ws.fsf@Equus.decebal.nl> <87si4e49ja.fsf@Equus.decebal.nl> <8737wc425d.fsf@Equus.decebal.nl> <87pozf3f7b.fsf@Equus.decebal.nl> <87egfu2w6a.fsf@Equus.decebal.nl> <5645b14a$0$23858$e4fe514c@news.xs4all.nl> <87a8qi2oxy.fsf@Equus.decebal.nl> <5645d95c$0$23742$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="10391"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IycZcsoR2dqj24UhFtKjlaygVFVLnIYc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:lrUE8Ol8Dl1WMfgIeZmlsgOUNtM= sha1:RvsKpsq+3Zg6Cz8RQGUyhXtlrUs= Xref: csiph.com comp.lang.java.programmer:33146 On Friday 13 Nov 2015 13:36 CET, silvio@internet.com wrote: > On 11/13/2015 11:06 AM, Cecil Westerhof wrote: >> >> Well at the moment the performance is about the same. When the >> relations are fetched in one call instead one by one as it is done >> in JDBC I would expect to see a speed improvement. Is of-course >> depending how big the sets to be retrieved are and the percentage >> of the queries where sets are retrieved. >> > > Don't forget JPA will use JDBC in the end so it can by definition > never be faster than plain JDBC. The ORM can outsmart the JDBC > programmer but that should raise questions about his ability. But to > be fair it is not at all uncommon that poor JDBC code replaced by > ORM code results in a better system. The opposite is just also not > uncommon. It all depends on the quality of the old JDBC code and how > good a fit the ORM is. True in principal, but it is a bit like: Java code will at the lowest level be executed as machine code instructions, so it is better to program in assembler. ;-) Also I understood that JPA uses caching which could speed things up. But anyway: the performance is about the same while the code is a lot cleaner. So mission accomplished. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof