db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject RsIterator - performance issue
Date Sat, 24 Jul 2004 13:59:10 GMT
Hi all,

I'm wondering about some lines in RsIterator#getObjectFromResultSet() 
method when query objects.

In line 428 always the whole result set row was mapped to an internal 
map, independent from a match in the cache. Why not map the PK values 
first from the result set, then check against the cache and only if not 
found in cache we map the whole row from the result set.

I locally change this behavior and all tests pass, additionally I wrote 
a simple performance test:
First time the query read from the DB (no cached objects), second time 
the objects can be found in cache.

against MaxDB             new  old
Time query 10000 objects: 762  752 [ms]
Time fetch 10000 objects: 161  472 [ms]

against hsql              new  old
Time query 10000 objects: 600  556 [ms]
Time fetch 10000 objects: 250  354 [ms]

The first read of the new implementation is a bit slower, because when 
the object was not found in cache the whole result set row was read 
again (with all PK values). A more performant solution will be to read 
the non-PK fields only, instead of all fields. But therefor we have to 
change the RowReader interface.

Any objections against the patched RsIterator version?

regards,
Armin

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message