You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Rick <ri...@gmail.com> on 2008/11/15 17:06:24 UTC
Just curious...how 'much' worse is performance if just maps
I'm starting this conversion of an existing hibernate app over to
iBATIS. The app is 95% reads (the resulting objects eventually get
massaged into XML trees for a gui to use.) As I'm looking at these
models, the entity properties are currently set to match the exact db
column names. I'm debating about returning Lists of Maps. I know
performance will be worse populating Maps vs pojos... but I'm curious
'how much worse' are we talking about? Has anyone done some crude
benchmarking?
I probably won't use maps though because I don't like the
error-proneness of getting the property values by key name (getXXX is
easier than having to keep the datamodel open and remembering the
exact column name, and ooops someone forgot a unit test.)
--
Rick
Re: Just curious...how 'much' worse is performance if just maps
Posted by Clinton Begin <cl...@gmail.com>.
Oh.... also if you're loading LOTS of data, the map might need twice as much
space, as I can't remember if it calls intern() on the keys (or values for
that matter).
Clinton
On Sun, Nov 16, 2008 at 7:23 AM, Clinton Begin <cl...@gmail.com>wrote:
> If you measure it in milliseconds over hundreds of thousands of calls,
> it's technically far worse. But practically speaking, your users probably
> wouldn't notice in a million years. :-)
>
> Clinton
>
>
> On Sat, Nov 15, 2008 at 9:06 AM, Rick <ri...@gmail.com> wrote:
>
>> I'm starting this conversion of an existing hibernate app over to
>> iBATIS. The app is 95% reads (the resulting objects eventually get
>> massaged into XML trees for a gui to use.) As I'm looking at these
>> models, the entity properties are currently set to match the exact db
>> column names. I'm debating about returning Lists of Maps. I know
>> performance will be worse populating Maps vs pojos... but I'm curious
>> 'how much worse' are we talking about? Has anyone done some crude
>> benchmarking?
>>
>> I probably won't use maps though because I don't like the
>> error-proneness of getting the property values by key name (getXXX is
>> easier than having to keep the datamodel open and remembering the
>> exact column name, and ooops someone forgot a unit test.)
>>
>> --
>> Rick
>>
>
>
Re: Just curious...how 'much' worse is performance if just maps
Posted by Clinton Begin <cl...@gmail.com>.
If you measure it in milliseconds over hundreds of thousands of calls, it's
technically far worse. But practically speaking, your users probably
wouldn't notice in a million years. :-)
Clinton
On Sat, Nov 15, 2008 at 9:06 AM, Rick <ri...@gmail.com> wrote:
> I'm starting this conversion of an existing hibernate app over to
> iBATIS. The app is 95% reads (the resulting objects eventually get
> massaged into XML trees for a gui to use.) As I'm looking at these
> models, the entity properties are currently set to match the exact db
> column names. I'm debating about returning Lists of Maps. I know
> performance will be worse populating Maps vs pojos... but I'm curious
> 'how much worse' are we talking about? Has anyone done some crude
> benchmarking?
>
> I probably won't use maps though because I don't like the
> error-proneness of getting the property values by key name (getXXX is
> easier than having to keep the datamodel open and remembering the
> exact column name, and ooops someone forgot a unit test.)
>
> --
> Rick
>