-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Huge performance hit compared to raw jdbc
PostPosted: Sat Oct 01, 2005 8:59 am 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
Hi all,

We studied many frameworks for the database layer of our architecture and choosed hibernate. The application is a really large, clustered e-commerce system that must cope with HUGE amounts of traffic. To make things even worse, the traffic comes in bursts at certain times.

So one of our main points why we decided to go with hibernate was that it should be quite efficient.

I'm also working on another project (just a little hobby project of mine) and I use hibernate there as well. I have benchmarked some things and this got me quite worried. Please explain am I doing something wrog here (I'm not total newbie) or is hibernate really this slow.

I have the following database table:
Code:
create table words (
        id integer unsigned not null auto_increment,
        word varchar(128) not null unique,
        primary key(id)
);
alter table words add index(word);


I use the following HQL query to query this table (also contains my benchmarking code)

Code:
                cat.debug("3A!!: "+(System.currentTimeMillis() - now));
                Word word = (Word) session.createQuery("from Word where word=?").setString(0, wordString).uniqueResult();
                cat.debug("3A??: "+(System.currentTimeMillis() - now));


I get the following lines into debug:

Code:
2005-10-01 15:42:44,545 [Feeder] DEBUG 3A!!: 19744
Hibernate: select word0_.id as id, word0_.word as word8_ from words word0_ where word0_.word=?
2005-10-01 15:42:44,671 [Feeder] DEBUG 3A??: 19870


That's 150 milliseconds! That's really, really bad performance for this query.

when queried at database level, I get the following time (this is exactly the same query that hibernate generates)

Code:
mysql> select word0_.id as id, word0_.word as word8_ from words word0_ where word0_.word='http';
+----+--------+
| id | word8_ |
+----+--------+
| 67 | http   |
+----+--------+
1 row in set (0.00 sec)


It's below 10 milliseconds!

What I'm asking is that is single object query performance really this low, why it is so low and or do I have to configure something in order to get good performance?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:17 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You are not comparing "raw JDBC", you are comparing remote and local execution of a query.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 9:56 am 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
Apologises for that, I tried to edit the post to correct the error on title, unfortunately I didn't find edit post link anywhere.

Below are the jdbc and hibernate results in milliseconds.

Code:
                now = System.currentTimeMillis();
                cat.debug("HIBERNATE "+(System.currentTimeMillis() - now));
                Word word = (Word) session.createQuery("from Word where word=?").setString(0, wordString).uniqueResult();
                cat.debug("/HIBERNATE "+(System.currentTimeMillis() - now));
                if(word != null)
                    cat.debug(word.getWord());

                cat.debug("/HIBER2 "+(System.currentTimeMillis() - now));


Code:
                now = System.currentTimeMillis();
                cat.debug("JDBC "+(System.currentTimeMillis() - now));
                ResultSet rs = s.executeQuery("select id, word from words where word='"+wordString+"'");
                cat.debug("/JDBC "+(System.currentTimeMillis() - now));

                if(rs.next())
                    cat.debug(rs.getString("word"));

                cat.debug("/JDBC2 "+(System.currentTimeMillis() - now));


And here are some results:

Code:
2005-10-01 16:53:07,966 [Feeder] DEBUG HIBERNATE 0
2005-10-01 16:53:08,253 [Feeder] DEBUG /HIBERNATE 287
2005-10-01 16:53:08,254 [Feeder] DEBUG possible
2005-10-01 16:53:08,255 [Feeder] DEBUG /HIBER2 289
2005-10-01 16:53:08,350 [Feeder] DEBUG JDBC 0
2005-10-01 16:53:08,352 [Feeder] DEBUG /JDBC 2
2005-10-01 16:53:08,439 [Feeder] DEBUG possible
2005-10-01 16:53:08,503 [Feeder] DEBUG /JDBC2 153


Code:
2005-10-01 16:53:10,818 [Feeder] DEBUG HIBERNATE 0
2005-10-01 16:53:11,096 [Feeder] DEBUG /HIBERNATE 278
2005-10-01 16:53:11,097 [Feeder] DEBUG extradited
2005-10-01 16:53:11,097 [Feeder] DEBUG /HIBER2 279
2005-10-01 16:53:11,203 [Feeder] DEBUG JDBC 0
2005-10-01 16:53:11,205 [Feeder] DEBUG /JDBC 2
2005-10-01 16:53:11,206 [Feeder] DEBUG extradited
2005-10-01 16:53:11,273 [Feeder] DEBUG /JDBC2 70


Code:
2005-10-01 16:53:08,804 [Feeder] DEBUG HIBERNATE 0
2005-10-01 16:53:09,067 [Feeder] DEBUG /HIBERNATE 263
2005-10-01 16:53:09,068 [Feeder] DEBUG boss
2005-10-01 16:53:09,164 [Feeder] DEBUG /HIBER2 360
2005-10-01 16:53:09,372 [Feeder] DEBUG JDBC 0
2005-10-01 16:53:09,377 [Feeder] DEBUG /JDBC 5
2005-10-01 16:53:09,476 [Feeder] DEBUG boss
2005-10-01 16:53:09,577 [Feeder] DEBUG /JDBC2 205


The question is still the same, is this usual difference between jdbc and hibernate queries?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 10:03 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Again, you are comparing apples and oranges. Try to read the complete resultset and marshall a Java bean out of it. In any case, this is total non-sense as long as you don't add concurrency and use real-world data sets.

Read the FAQs about performance or any of the monthly "my benchmark sucks" threads here on the forum.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 01, 2005 4:31 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
mikkom,
You can try write complete file on system and same data from relational database
file access will be quick, but it doesn't mean that flat file is better than database
database do transaction processing, indexing , etc and it is normal slower

hibernate do populate query to bean, object query etc - hibernate use jdbc and add features and have to be slower - If JDBC features are enough for you then you doesn't need hibernate
There is posibility that hibernate do better complex query, but it depend from query writer


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 3:20 am 
Beginner
Beginner

Joined: Sun Jul 31, 2005 1:23 pm
Posts: 35
Interesting results.

One question: Did you consider that there might be a one time hit on the first query?

Maybe if you averaged over ten similar queries within the same execution context, the difference would disappear?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 4:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Two bugs are immediately obvious in your benchmark:

(1) You do not do things in a loop, so HotSpot gets no chance to optimize the Hibernate code (this is just basic Java benchmarking stuff)
(2) You are comparing a prepared statement to dynamic SQL (if you don't know the difference, that tells me you don't understand JDBC well enough to be able to even *start* a job like benchmarking Hibernate)

You've probably made many other errors in all the code you have not shown us.

Both of these basic mistakes tell me that if you really care about performance testing, you need to find someone in your organization who really knows and understands performance and benchmarking. Or, instead of doing such trivial, misleading micro-benchmarks, how about you actually implement one of the performance critical pieces of functionality in your system, deploy it to a realistic test environment, and test it properly, by simulating a real production load in the system. Micro-benchmarks are always bogus, and tell you almost nothing about the true scalability of a complex multi-user application.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 9:36 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Oracle is correct when deny testing in license agreement


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 10:55 am 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
gavin wrote:
Two bugs are immediately obvious in your benchmark:

(1) You do not do things in a loop, so HotSpot gets no chance to optimize the Hibernate code (this is just basic Java benchmarking stuff)


I do. I just didn't include the whole code because it's quite long.

Quote:
(2) You are comparing a prepared statement to dynamic SQL (if you don't know the difference, that tells me you don't understand JDBC well enough to be able to even *start* a job like benchmarking Hibernate)


I do know my jdbc quite well, I have been programming very large systems for more than 5 years with JDBC. Apart from that, my knowledge is not the point here.

If I would have created a preparedstatement for JDBC before the loop (I tested this and did the same thing with hibernate by creating query before the loop) the performance hit for hibernate are enormous. I think there is no point of being fair here so here are the results.

Quote:
You've probably made many other errors in all the code you have not shown us.


Very nice, continue attacking the person who makes questions without answering the questions.

This is exactly the reason why it is very hard to find good hibernate/jdbc/other framework comparisons. Every time I find one, there is someone saying "this benchmark sucks because it's too simple" or something similar. I hate arguing so please publish a valid benchmark yourself and add it to hibernate pages so everyone will see how effective hibernate really is.

My case is simple, I will be making lots of queries in short period of time. I need to get very good performance. It is said everywhere on hibernate pages that hibernate is very effective.

I do know that hibernate does much more things than plain JDBC query, I know that this is probably the reason why it is so much slower but same time I read statements like "hibernate is as effective as JDBC" and I just don't understand them.

I'll publish one more code that will create hibernate query and jdbc query before the loop and then does exactly the same thing as in my previous code if you want.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 11:11 am 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
Here is a full code with preparedstatement and bean initialization with jdbc. And the same thing with hibernate.

Code:
            PreparedStatement ps = datasource.getConnection().prepareStatement("select id, word from words wh\ere word=?");
            Query hq = session.createQuery("from Word where word=?");

            for(Map.Entry<String, Integer> entry : articleWords.entrySet()) {

                String wordString = entry.getKey();
                int amount = entry.getValue();

                now = System.currentTimeMillis();
                cat.debug("Hibernate 1 "+(System.currentTimeMillis() - now));
                now = System.currentTimeMillis();
                Word word = (Word) hq.setString(0, wordString).uniqueResult();
                cat.debug("Hibernate 2 "+(System.currentTimeMillis() - now));
                if(word != null) {
                    cat.debug(word.getWord());
                }
                cat.debug("Hibernate 3 "+(System.currentTimeMillis() - now));

                now = System.currentTimeMillis();
                cat.debug("JDBC 1 "+(System.currentTimeMillis() - now));
                now = System.currentTimeMillis();
                ps.setString(1, wordString);
                ResultSet rs = ps.executeQuery();
                cat.debug("JDBC 2 "+(System.currentTimeMillis() - now));
                if(rs.next()) {
                    Word jword = new Word();
                    jword.setWord(rs.getString("word"));
                    jword.setId(rs.getInt("id"));
                    cat.debug(jword.getWord());
                }
                cat.debug("JDBC 3 "+(System.currentTimeMillis() - now));

            }


And the results for the first few words

Code:
2005-10-02 18:08:44,514 [Feeder] DEBUG begin
2005-10-02 18:08:44,578 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:44,730 [Feeder] DEBUG Hibernate 2 150
2005-10-02 18:08:44,731 [Feeder] DEBUG possible
2005-10-02 18:08:44,732 [Feeder] DEBUG Hibernate 3 152
2005-10-02 18:08:44,793 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:44,794 [Feeder] DEBUG JDBC 2 0
2005-10-02 18:08:44,848 [Feeder] DEBUG possible
2005-10-02 18:08:44,915 [Feeder] DEBUG JDBC 3 121
2005-10-02 18:08:44,916 [Feeder] DEBUG Hibernate 1 1
2005-10-02 18:08:45,066 [Feeder] DEBUG Hibernate 2 150
2005-10-02 18:08:45,067 [Feeder] DEBUG boss
2005-10-02 18:08:45,068 [Feeder] DEBUG Hibernate 3 152
2005-10-02 18:08:45,140 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:45,142 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:45,207 [Feeder] DEBUG boss
2005-10-02 18:08:45,283 [Feeder] DEBUG JDBC 3 142
2005-10-02 18:08:45,284 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:45,523 [Feeder] DEBUG Hibernate 2 171
2005-10-02 18:08:45,524 [Feeder] DEBUG bid
2005-10-02 18:08:45,524 [Feeder] DEBUG Hibernate 3 172
2005-10-02 18:08:45,595 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:45,597 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:45,748 [Feeder] DEBUG bid
2005-10-02 18:08:45,749 [Feeder] DEBUG JDBC 3 153
2005-10-02 18:08:45,749 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:45,899 [Feeder] DEBUG Hibernate 2 81
2005-10-02 18:08:45,900 [Feeder] DEBUG extradited
2005-10-02 18:08:45,901 [Feeder] DEBUG Hibernate 3 83
2005-10-02 18:08:45,976 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:45,978 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:46,040 [Feeder] DEBUG extradited
2005-10-02 18:08:46,041 [Feeder] DEBUG JDBC 3 64
2005-10-02 18:08:46,041 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:46,188 [Feeder] DEBUG Hibernate 2 74
2005-10-02 18:08:46,197 [Feeder] DEBUG time
2005-10-02 18:08:46,198 [Feeder] DEBUG Hibernate 3 84
2005-10-02 18:08:46,268 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:46,269 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:46,341 [Feeder] DEBUG time
2005-10-02 18:08:46,410 [Feeder] DEBUG JDBC 3 142
2005-10-02 18:08:46,411 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:46,633 [Feeder] DEBUG Hibernate 2 148
2005-10-02 18:08:46,634 [Feeder] DEBUG schoolgirl
2005-10-02 18:08:46,634 [Feeder] DEBUG Hibernate 3 149
2005-10-02 18:08:46,708 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:46,709 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:46,776 [Feeder] DEBUG schoolgirl
2005-10-02 18:08:46,776 [Feeder] DEBUG JDBC 3 68
2005-10-02 18:08:46,850 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:47,005 [Feeder] DEBUG Hibernate 2 155
2005-10-02 18:08:47,006 [Feeder] DEBUG ukraine
2005-10-02 18:08:47,006 [Feeder] DEBUG Hibernate 3 156
2005-10-02 18:08:47,072 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:47,074 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:47,146 [Feeder] DEBUG ukraine
2005-10-02 18:08:47,147 [Feeder] DEBUG JDBC 3 74
2005-10-02 18:08:47,148 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:47,304 [Feeder] DEBUG Hibernate 2 91
2005-10-02 18:08:47,305 [Feeder] DEBUG liquefied
2005-10-02 18:08:47,305 [Feeder] DEBUG Hibernate 3 92
2005-10-02 18:08:47,371 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:47,373 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:47,445 [Feeder] DEBUG liquefied
2005-10-02 18:08:47,446 [Feeder] DEBUG JDBC 3 74
2005-10-02 18:08:47,520 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:47,680 [Feeder] DEBUG Hibernate 2 159
2005-10-02 18:08:47,680 [Feeder] DEBUG beaten
2005-10-02 18:08:47,681 [Feeder] DEBUG Hibernate 3 160
2005-10-02 18:08:47,747 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:47,749 [Feeder] DEBUG JDBC 2 0
2005-10-02 18:08:47,823 [Feeder] DEBUG beaten
2005-10-02 18:08:47,824 [Feeder] DEBUG JDBC 3 76
2005-10-02 18:08:47,825 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:47,967 [Feeder] DEBUG Hibernate 2 76
2005-10-02 18:08:47,981 [Feeder] DEBUG rest
2005-10-02 18:08:47,982 [Feeder] DEBUG Hibernate 3 91
2005-10-02 18:08:48,048 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:48,050 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:48,122 [Feeder] DEBUG rest
2005-10-02 18:08:48,123 [Feeder] DEBUG JDBC 3 74
2005-10-02 18:08:48,124 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:48,266 [Feeder] DEBUG Hibernate 2 76
2005-10-02 18:08:48,267 [Feeder] DEBUG salesman
2005-10-02 18:08:48,267 [Feeder] DEBUG Hibernate 3 77
2005-10-02 18:08:48,345 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:48,353 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:48,427 [Feeder] DEBUG salesman
2005-10-02 18:08:48,428 [Feeder] DEBUG JDBC 3 76
2005-10-02 18:08:48,495 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:48,641 [Feeder] DEBUG Hibernate 2 145
2005-10-02 18:08:48,642 [Feeder] DEBUG treating
2005-10-02 18:08:48,642 [Feeder] DEBUG Hibernate 3 146
2005-10-02 18:08:48,717 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:48,718 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:48,792 [Feeder] DEBUG treating
2005-10-02 18:08:48,793 [Feeder] DEBUG JDBC 3 76
2005-10-02 18:08:48,794 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:49,019 [Feeder] DEBUG Hibernate 2 143
2005-10-02 18:08:49,020 [Feeder] DEBUG ended
2005-10-02 18:08:49,020 [Feeder] DEBUG Hibernate 3 144
2005-10-02 18:08:49,095 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:49,096 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:49,161 [Feeder] DEBUG ended
2005-10-02 18:08:49,162 [Feeder] DEBUG JDBC 3 67
2005-10-02 18:08:49,163 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:49,311 [Feeder] DEBUG Hibernate 2 75
2005-10-02 18:08:49,312 [Feeder] DEBUG inadequate
2005-10-02 18:08:49,312 [Feeder] DEBUG Hibernate 3 76
2005-10-02 18:08:49,387 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:49,388 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:49,461 [Feeder] DEBUG inadequate
2005-10-02 18:08:49,461 [Feeder] DEBUG JDBC 3 74
2005-10-02 18:08:49,462 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:49,612 [Feeder] DEBUG Hibernate 2 84
2005-10-02 18:08:49,613 [Feeder] DEBUG body
2005-10-02 18:08:49,613 [Feeder] DEBUG Hibernate 3 85
2005-10-02 18:08:49,687 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:49,689 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:49,754 [Feeder] DEBUG body
2005-10-02 18:08:49,755 [Feeder] DEBUG JDBC 3 67
2005-10-02 18:08:49,828 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:49,980 [Feeder] DEBUG Hibernate 2 151
2005-10-02 18:08:49,980 [Feeder] DEBUG staging
2005-10-02 18:08:49,981 [Feeder] DEBUG Hibernate 3 152
2005-10-02 18:08:50,055 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:50,056 [Feeder] DEBUG JDBC 2 0
2005-10-02 18:08:50,122 [Feeder] DEBUG staging
2005-10-02 18:08:50,123 [Feeder] DEBUG JDBC 3 67
2005-10-02 18:08:50,196 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:50,346 [Feeder] DEBUG Hibernate 2 149
2005-10-02 18:08:50,346 [Feeder] DEBUG drive
2005-10-02 18:08:50,347 [Feeder] DEBUG Hibernate 3 150
2005-10-02 18:08:50,422 [Feeder] DEBUG JDBC 1 1
2005-10-02 18:08:50,423 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:50,489 [Feeder] DEBUG drive
2005-10-02 18:08:50,489 [Feeder] DEBUG JDBC 3 67
2005-10-02 18:08:50,490 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:50,638 [Feeder] DEBUG Hibernate 2 74
2005-10-02 18:08:50,647 [Feeder] DEBUG for
2005-10-02 18:08:50,648 [Feeder] DEBUG Hibernate 3 84
2005-10-02 18:08:50,714 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:50,716 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:50,788 [Feeder] DEBUG for
2005-10-02 18:08:50,789 [Feeder] DEBUG JDBC 3 74
2005-10-02 18:08:50,855 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:51,012 [Feeder] DEBUG Hibernate 2 156
2005-10-02 18:08:51,013 [Feeder] DEBUG concessions
2005-10-02 18:08:51,014 [Feeder] DEBUG Hibernate 3 158
2005-10-02 18:08:51,080 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:51,082 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:51,155 [Feeder] DEBUG concessions
2005-10-02 18:08:51,156 [Feeder] DEBUG JDBC 3 75
2005-10-02 18:08:51,156 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:51,307 [Feeder] DEBUG Hibernate 2 84
2005-10-02 18:08:51,308 [Feeder] DEBUG bbc
2005-10-02 18:08:51,309 [Feeder] DEBUG Hibernate 3 86
2005-10-02 18:08:51,382 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:51,384 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:51,459 [Feeder] DEBUG bbc
2005-10-02 18:08:51,460 [Feeder] DEBUG JDBC 3 77
2005-10-02 18:08:51,461 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:51,686 [Feeder] DEBUG Hibernate 2 157
2005-10-02 18:08:51,686 [Feeder] DEBUG study
2005-10-02 18:08:51,687 [Feeder] DEBUG Hibernate 3 158
2005-10-02 18:08:51,760 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:51,762 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:51,827 [Feeder] DEBUG study
2005-10-02 18:08:51,827 [Feeder] DEBUG JDBC 3 66
2005-10-02 18:08:51,828 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:51,988 [Feeder] DEBUG Hibernate 2 87
2005-10-02 18:08:51,989 [Feeder] DEBUG continue
2005-10-02 18:08:51,989 [Feeder] DEBUG Hibernate 3 88
2005-10-02 18:08:52,063 [Feeder] DEBUG JDBC 1 1
2005-10-02 18:08:52,064 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:52,129 [Feeder] DEBUG continue
2005-10-02 18:08:52,130 [Feeder] DEBUG JDBC 3 67
2005-10-02 18:08:52,203 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:52,347 [Feeder] DEBUG Hibernate 2 143
2005-10-02 18:08:52,352 [Feeder] DEBUG vulnerable
2005-10-02 18:08:52,353 [Feeder] DEBUG Hibernate 3 149
2005-10-02 18:08:52,426 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:52,428 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:52,493 [Feeder] DEBUG vulnerable
2005-10-02 18:08:52,494 [Feeder] DEBUG JDBC 3 67
2005-10-02 18:08:52,567 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:52,713 [Feeder] DEBUG Hibernate 2 145
2005-10-02 18:08:52,714 [Feeder] DEBUG captain
2005-10-02 18:08:52,714 [Feeder] DEBUG Hibernate 3 146
2005-10-02 18:08:52,788 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:52,795 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:52,868 [Feeder] DEBUG captain
2005-10-02 18:08:52,868 [Feeder] DEBUG JDBC 3 74
2005-10-02 18:08:52,936 [Feeder] DEBUG Hibernate 1 0
2005-10-02 18:08:53,080 [Feeder] DEBUG Hibernate 2 143
2005-10-02 18:08:53,081 [Feeder] DEBUG first
2005-10-02 18:08:53,081 [Feeder] DEBUG Hibernate 3 144
2005-10-02 18:08:53,155 [Feeder] DEBUG JDBC 1 0
2005-10-02 18:08:53,157 [Feeder] DEBUG JDBC 2 1
2005-10-02 18:08:53,222 [Feeder] DEBUG first
2005-10-02 18:08:53,223 [Feeder] DEBUG JDBC 3 67


The difference is still there.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 11:23 am 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
gavin wrote:
how about you actually implement one of the performance critical pieces of functionality in your system, deploy it to a realistic test environment, and test it properly, by simulating a real production load in the system. Micro-benchmarks are always bogus, and tell you almost nothing about the true scalability of a complex multi-user application.


We are doing this right now. The problem is that we have no JDBC version of similar functionality so it's impossible to compare the result to something.

Your reply suggests that you have seen or done the kind of benchmarks you describe. Could you please tell what kind of results should I see from this kind of benchmark?

It really amazes me that you always seem to critizise all the benchmarks someone shows you but do not publish any kind of benchmarks on behalf of the hibernate project. Please please publish a good, comprehensive benchmark and people like me will shut up.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 11:32 am 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
snpesnpe wrote:
mikkom,
You can try write complete file on system and same data from relational database
file access will be quick, but it doesn't mean that flat file is better than database
database do transaction processing, indexing , etc and it is normal slower

hibernate do populate query to bean, object query etc - hibernate use jdbc and add features and have to be slower - If JDBC features are enough for you then you doesn't need hibernate
There is posibility that hibernate do better complex query, but it depend from query writer


Thank you for a good answer.

Hibernate makes the code cleaner, this is the main reason we want to use hibernate or some other similar tool. My question is really very simple, how big performance hit should I wait compared to plain DAO pattern. As I said, the system is very large and there is a lot of concurrency.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 11:46 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
mikkom wrote:
gavin wrote:
It really amazes me that you always seem to critizise all the benchmarks someone shows you but do not publish any kind of benchmarks on behalf of the hibernate project. Please please publish a good, comprehensive benchmark and people like me will shut up.


If you would have read the Performance FAQs by now you would know why we don't do such a thing.

1. Every benchmark that would be good, and would be written by us, would not be applicable to your application, not even remotely. It would be useless.

2. Why would you trust a benchmark from a vendor of the benchmarked product anyway? It's better to tell you the truth that only _you_ can create a comprehensive benchmark for _your_ application.

3. If you are not able to write such a benchmark, or if you really think that you should do micro-benchmarkts testing trivial functions, you can as well check out the "perftest" target in the Hibernate build, which is such a trivial benchmark. We use it in Hibernate development to control if a trivial performance bug slipped into the code.

End of discussion.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 12:23 pm 
Newbie

Joined: Sat Oct 01, 2005 8:45 am
Posts: 10
christian wrote:
mikkom wrote:
gavin wrote:
1. Every benchmark that would be good, and would be written by us, would not be applicable to your application, not even remotely. It would be useless.

2. Why would you trust a benchmark from a vendor of the benchmarked product anyway? It's better to tell you the truth that only _you_ can create a comprehensive benchmark for _your_ application.

3. If you are not able to write such a benchmark, or if you really think that you should do micro-benchmarkts testing trivial functions, you can as well check out the "perftest" target in the Hibernate build, which is such a trivial benchmark. We use it in Hibernate development to control if a trivial performance bug slipped into the code

End of discussion.


You could argument against any benchmark or review in world with these arguments but point taken, you don't publish any benchmarks (unless you are paid as is said in the faq).

And no, I don't want trivial benchmarks that's why I'm asking for a good, comprehensive one. And no, I don't think that generic benchmark that can be parametrized would be impossible to implement at all.

End of discussion on my part too.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 02, 2005 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
mikkom wrote:
you don't publish any benchmarks (unless you are paid as is said in the faq).


This is certainly not what I just wrote in the FAQ, so don't try to turn the words in my mouth. It's quite clear that we offer help if you can't benchmark your own application. Because this is not much fun for us, we don't do it in our spare time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.