[hibernate-dev] Hibernate Developer IRC meeting - 5/03
Emmanuel Bernard
emmanuel at hibernate.org
Fri May 4 05:07:14 EDT 2012
Performance I don't know, you are probably right. But memory wise, that could be way different.
Even ignoring the overhead of the object + pointer in memory, the alignment of boolean or other small objects would make a significant impact.
Of course if we are talking about 20 values, we should not bother. But persisters and the like store more than 20 values and we have more than one persister / loader. It might be inconsequential in the end but that might be worth testing.
On a related note it's up for debate whether or not putting data in a hash map for faster lookup later is worth it in all cases:
- it takes much more space than raw arrays
- array scan might be as fast or faster for a small enough array. As we have seen in Infinispan and OGM, computing a hash is not a cheap operation.
Again this require testing but I am guilty as charge of using collections in AnnotationBinder when doing some computations that would be better off written as an array + array scan.
On 3 mai 2012, at 19:32, Steve Ebersole wrote:
> I seriously doubt the performance cost of 20 'parallel arrays' versus 1 array of Objects holding those 20 values is anything but negligible at best.
>
>
> On Thu 03 May 2012 11:04:30 AM CDT, Emmanuel Bernard wrote:
>> Sorry I could not assist the meeting live but reviewed the logs and had some remarks, so ehre are the logs and my remarks :)
>>
>> ## Meeting logs
>>
>> http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2012/hibernate-dev.2012-05-03-14.01.html
>> Minutes (text):http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2012/hibernate-dev.2012-05-03-14.01.txt
>> Log: http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2012/hibernate-dev.2012-05-03-14.01.log.html
>>
>> ## About parallel arrays vs arrays of objects
>>
>> Even today, there is a cost in using Objects or HashMap as data placeholders. This might not be relevant for us especially since we are not using them for "live" data but since memory footprint has always been a concern for Hibernate, it's worth mentioning.
>>
>> This presentation is quite interesting and show the extra memory cost of such structure compared to arrays http://www.cs.virginia.edu/kim/publicity/pldi09tutorials/memory-efficient-java-tutorial.pdf
>>
>> ## PessimisticLockException versus LockAcquisitionException
>>
>> I am not certain of that and Git history got cut short with the migration of entitymanager into core. But I do have recollections of some lock exceptions that were not catch up and I had to use PessimisticLockException. It could have been a change triggered by the TCK. Again I might be wrong, it was a long time ago. Plus ORM's core has evolved since.
>>
>> Emmanuel
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
> --
> steve at hibernate.org
> http://hibernate.org
More information about the hibernate-dev
mailing list