Friday, February 9, 2007

Hibernate: tune up Named Query initialization time

Our application uses Hibernate with many named queries.
Whenever I start up jboss, parsing the named queries is one of the time consuming initialization process.

I read a post on hibernate JIRA regarding preparing named query.
It says, instead of writing named queries in mapping files, creating named-query-only-files gives faster startup.

So, I tried it.

Hiberante3 & Jboss4
Num of NamedQuery: 405

Named queries exist within entity mapping(our current status):


start up time
1.
2m:33s:301ms
2.
2m:15s:737ms
3.
2m:25s:113ms
4.
2m:15s:753ms
5.
2m: 1s:706ms
6.
2m: 2s:941ms
7.
2m:19s:722ms
8.
2m: 8s:769ms
9.
2m:18s:473ms
10.
2m:14s: 82ms
AVG
2m:15s:633ms


Moved approximately half of named query to a query-only-file.
(moving all queries takes time, so I just slacked…)



start up time
1.
1m:52s:300ms
2.
2m: 7s:191ms
3.
2m:11s:566ms
4.
2m: 7s:581ms
5.
1m:51s:799ms
6.
2m:19s:613ms
7.
1m:49s:612ms
8.
2m: :675ms
9.
1m:58s: 50ms
10.
2m:10s:675ms
AVG
2m: 2s:951ms


::Result::
Average start up time : 2m:15s:633ms => 2m: 2s:951ms


Well, start-up time varies. But surely it makes startup faster.
If I move all named-queries to a couple of query-only-files, we will gain more performance.

2 comments:

Anonymous said...

Can anyone recommend the well-priced Software Deployment system for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central it automation
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

[url=http://seghan.ru/go.php?sid=35][img]http://i066.radikal.ru/1001/38/f22daff34e6d.jpg[/img][/url]












[url=http://tioozua.connection24.de/sitemap.html]buy cigarette loads [/url]
buy capri cigarettes online buy smokeless cigarettes where to buy cigarettes in spokane
[url=http://mlwqdwu.xn--baldmglichst-8ib.de/]cigarette holders where to buy [/url]
buy cigarette packs how can i order jezebel cigarettes american spirits cigarettes buy
[url=http://deuaexj.naheliegend.de/sitemap.html]buying cigarette tobacco [/url]
buy cigarettes herbal pa buying kentucky best cigarettes cigarettes discount buying shopping
[url=http://uvfaquc.akzentuiert.de/sitemap.html]buy cigarettes in prague [/url]
buy cigaretts on line cheapest gas station to buy cigarettes buying cigarettes online scam
[url=http://uvfaquc.akzentuiert.de/sitemap.html]where to buy wave cigaretts [/url]
buy merit cigarettes buy player cigarettes sundance cigarettes buy online
[url=http://tyouhca.xn--geglckt-q2a.de/]buying cheap cigarettes in the usa [/url]
buying cigarettes from abroad davidoff cigarettes buy online buy wholesale cigarettes in illinois
[url=http://vjzvmeu.il.gp/]buy joe's slim cigarette in gig [/url]
buy cigarettes greek buy huanghelou cigarettes order clove cigarettes online
[url=http://vonzura.misslich.de/]order discount cigarettes online [/url]
buying cigarettes for minors safest place to buy cigarettes online buy usa gold cigarettes online
[url=http://vonzura.misslich.de/]buy herbal cigarettes online [/url]
buy electronic cigarette europe cigarette roller buy buy value pride cigarettes
[url=http://vjzvmeu.il.gp/]buy misty cigarettes online [/url]
cheap cigarettes buy cigarettes online where to buy american spirit cigarettes buy seneca cigarettes on line