We were doing some simple performance tests today at work between Hibernate and Cayenne. A lot of the developers are a bit "tired" of Hibernate and are exploring the idea of Cayenne now, but the project we are looking at using it on next will be a public and politically sensitive (our government agency doesn't like us discussing details) web application and needs decent performance, so we were tasked to do some basic performance tests against an existing DB.
We configured Cayenne and Hibernate both with 5 DB channels and ran on the same machine (4-cores, lots of RAM). I did not use optimistic locking in Cayenne. I made sure the DB channels were all open before running. Here is the result of our initial tests: http://spreadsheets.google.com/pub?key=tNytbSdt5wYIRTmTl4L-cCA&output=html (Hope that link works.) The 20 indicates 20 concurrent threads (each with a separate DC). The 5 is 5 concurrent threads (to match the DB channels, each with a separate DC). I'll discuss the 5-2 in a minute. I expected Cayenne to be a little slower since it does more, but some of the results were particularly surprising. Especially UpdateIdea20, which averaged 5.6 seconds to commit a simple name change to the Idea table (which was a relatively small table -- perhaps 15 or so attributes). On most of these you will notice the commit time just keeps growing and growing. I thought at first it might just be DC sync, so I did as suggested in: http://cayenne.apache.org/doc/turning-off-context-synchronization.html but that didn't seem to have much of an effect (if any). Then I started thinking about our tests being fairly simple and they were all updating the same record repeatedly (which isn't realistic, I know), so for 5-2 I made sure 5 different records were being updated and turned off Use Shared Cache for the domain. That had the biggest impact, but even for that one the time more than doubles between the first and fifth threads. (The JVM in OS X uses all available cores, so at least 4 of the 5 were able to run concurrently.) Are there more optimizations that can be done? Does http://issues.apache.org/cayenne/browse/CAY-554 (mentioned on the turning off context synchronization link above) still apply to 3.0? Just looking for some thoughts. I've never really had to optimize before because all of my stuff has been smaller-scale before and certainly less visible. Thanks! mrg PS. At this point, they'd probably use 2.0.4 unless 3.0 is becoming an official release soon, too. I just expect 2.0.4 to be even slower.
