I think this is a good idea.
I simply changed the two allocators so that the allocate method ignored the boolean argument passed to it and always assumed it had been passed "false", which is a bit nasty but was just done for testing purposes.
I think maybe having a subclass of SimpleAllocator called e.g SimpleHeapAllocator would be one option that would give the developer the chance to select only heap buffers. We already have the allocator class as a config option for our application (i.e. it is read from our configuration file).
I didn't want to change all calls to ByteBuffer.allocate since I am not sure whether my results apply to all platforms and JVMs.
Robert
| Michael Bauroth <[EMAIL PROTECTED]>
29/04/2006 08:58
|
To: [email protected] cc: Subject: Global switch for direct / heap buffer use ? |
Hi,
regarding the performance tests from Robert what do you think about
implementing a global switch (e.g. in config) to choose between default
directbuffer or heapbuffer? I've looked into the sources to make it in
my overridden classes, but there are several classes (ByteBuffer,
SimpleAllocator, Cumulative...) that must be overriden, so that it
doesn't make sense for an individual to do so.
Does it make sense to open an issue in JIRA about that?
Regards
Michael
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.
