You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Jeffrey Lichtman <sw...@rcn.com> on 2005/05/01 09:18:41 UTC

Re: Optimal tuple memory representation

>I'm wondering if creating java object for each tuple and let the gc do its
>work would be more performant than having a reusable ByteBuffer that contains
>many raw tuples?  What do you think?

When we created Derby (nee Cloudscape), object instantiation and garbage 
collection were still quite expensive. We decided it would be cheaper to 
re-use objects such as data values and rows - this would avoid the problem 
of creating and destroying large numbers of objects when scanning through 
tables and indexes. Since then the memory management in most JVMs has 
gotten smarter, and if we were to start from scratch today we might not put 
so much emphasis on object re-use. For example, we might make data values 
and rows immutable, which would simplify the design of certain other parts 
of the system (e.g. code generation, some store interfaces, etc.).


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/