Jackrabbit 1.5 vs 1.6 Query Performance
Yes, I’m still talking about Jackrabbit query performance. But this time, I finally have something positive to say.
In our existing Jackrabbit setup, we are using version 1.5.0. I thought I would try out version 1.6 to see if it provides any query performance boosts. The short answer, yes it does.
Test Setup
My test setup is really basic. I created a simple program that would create 100 threads, each running the same query at the same time. I then measured how long it took for all 100 queries to complete. You might say this vaguely represents 100 concurrent connections, but I just intended the test to run the same query over and over. For each query type (more on that later), I ran the test program 3 separate times for Jackrabbit 1.5.0 and 3 separate times for Jackrabbit 1.6.
Query Types
Looking through our application code, I came up with some basic query types that we use. These are very general queries intended to help point out what types of queries perform better in version 1.6. All the queries tested are written in XPath.
Single Property
//element(*,my:type)[@property='value']
Two Properties
//element(*,my:type)[@property1='value1' and @property2='value2']
Like on Property
//element(*,my:type)[jcr:like(@property,'value%')]
Like on Child Property
//element(*,my:type)[jcr:like(./child/@property,'value%')]
Likes on Two Child Properties
//element(*,my:type)[jcr:like(./child/@property1,'value1%') and jcr:like(./child/@property2,'value2%')]
If Child Property Exists Or Is Not
//element(*,my:type)[not(./child/@property) or ./child/@property!='value')]
Results
| Query Type | v1.5 Ave | v1.6 Ave | % Improvement |
|---|---|---|---|
| Single Property | 28.5 s | 20.3 s | 29 % |
| Two Properties | 16.7 s | 9.7 s | 42 % |
| Like on Property | 17.8 s | 10.2 s | 43 % |
| Like on Child Property | 94.5 s | 42.8 s | 55 % |
| Like on Two Child Properties | 65.3 s | 34.3 s | 47 % |
| If Child Exists Or Is Not | 137.4 s | 55.4 s | 60 % |
Summary
So what do the results show us? First, that if you want increased query performance, moving to v1.6 is something you should really consider. Second, v1.6 shows large performance gains in querying across axis.