digitalmars.D - Compressed class references?
- bearophile (7/7) Mar 11 2012 A significant percentage of heap memory in a 64 bit JavaVM is used by re...
- =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= (12/19) Mar 11 2012 This probably can't work for D.
- deadalnix (4/33) Mar 11 2012 Additionally, 64bits pointer is good for us :
A significant percentage of heap memory in a 64 bit JavaVM is used by references, that are 8 bytes long. To reduce this problem they have invented "compressed references" (useful only for 64 bit systems), that turn references to 32 bit again: https://blogs.oracle.com/jrockit/entry/understanding_compressed_refer ftp://public.dhe.ibm.com/software/webserver/appserv/was/WAS_V7_64-bit_performance.pdf With them the total amount of heap memory decreases. They don't slow down the class usage significantly, and the memory reduction reduces the CPU cache pressure, increasing the performance a bit. Will this idea be useful for 64 bit D/DMD too, for D GC-managed class references (not for raw pointers)? Bye, bearophile
Mar 11 2012
On 12-03-2012 01:41, bearophile wrote:A significant percentage of heap memory in a 64 bit JavaVM is used by references, that are 8 bytes long. To reduce this problem they have invented "compressed references" (useful only for 64 bit systems), that turn references to 32 bit again: https://blogs.oracle.com/jrockit/entry/understanding_compressed_refer ftp://public.dhe.ibm.com/software/webserver/appserv/was/WAS_V7_64-bit_performance.pdf With them the total amount of heap memory decreases. They don't slow down the class usage significantly, and the memory reduction reduces the CPU cache pressure, increasing the performance a bit. Will this idea be useful for 64 bit D/DMD too, for D GC-managed class references (not for raw pointers)? Bye, bearophileThis probably can't work for D. The problem is that D allows casting references to pointers. As we all know, a pointer is a distinct type from a reference, and casting a pointer to e.g. an integer type is perfectly valid and sometimes necessary. So, that is to say, this would blow up when doing the reference -> pointer conversion. You could do it such that when one does the ref -> ptr conversion, the reference is simply expanded to a normal pointer, and vice versa. However, I'm not sure if this will hold water in the long run. -- - Alex
Mar 11 2012
Le 12/03/2012 01:44, Alex Rønne Petersen a écrit :On 12-03-2012 01:41, bearophile wrote:Additionally, 64bits pointer is good for us : http://www.deadalnix.me/2012/03/05/impact-of-64bits-vs-32bits-when-u ing-non-precise-gc/ (shameless autopromotion inside).A significant percentage of heap memory in a 64 bit JavaVM is used by references, that are 8 bytes long. To reduce this problem they have invented "compressed references" (useful only for 64 bit systems), that turn references to 32 bit again: https://blogs.oracle.com/jrockit/entry/understanding_compressed_refer ftp://public.dhe.ibm.com/software/webserver/appserv/was/WAS_V7_64-bit_performance.pdf With them the total amount of heap memory decreases. They don't slow down the class usage significantly, and the memory reduction reduces the CPU cache pressure, increasing the performance a bit. Will this idea be useful for 64 bit D/DMD too, for D GC-managed class references (not for raw pointers)? Bye, bearophileThis probably can't work for D. The problem is that D allows casting references to pointers. As we all know, a pointer is a distinct type from a reference, and casting a pointer to e.g. an integer type is perfectly valid and sometimes necessary. So, that is to say, this would blow up when doing the reference -> pointer conversion. You could do it such that when one does the ref -> ptr conversion, the reference is simply expanded to a normal pointer, and vice versa. However, I'm not sure if this will hold water in the long run.
Mar 11 2012