[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-mlvm-dev
Subject:    [9] RFR (XXS): 8031043: ClassValue's backing map should have a smaller initial size
From:       Christian Thalinger <christian.thalinger () oracle ! com>
Date:       2014-01-23 20:16:30
Message-ID: 063B6F8B-C7BF-4AD4-AF74-30445B1E8294 () oracle ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


https://bugs.openjdk.java.net/browse/JDK-8031043
http://cr.openjdk.java.net/~twisti/8031043/webrev.00

8031043: ClassValue's backing map should have a smaller initial size
Reviewed-by:

The current initial size for ClassValue's backing WeakHashMap (ClassValueMap) is: 

        private static final int INITIAL_ENTRIES = 32; 

This is too big and wastes a lot of memory. Usually a dynamic language or other users \
of ClassValue associate only one value with a Class. Even if users need more entries \
it's better to start small and grow as needed since adding new values to a Class is a \
one-time thing and not performance critical.

Here is some discussion on the mlvm-dev list:

http://mail.openjdk.java.net/pipermail/mlvm-dev/2014-January/005597.html


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;"><div style="margin: 0px; font-size: \
10px; font-family: Monaco;"><a \
href="https://bugs.openjdk.java.net/browse/JDK-8031043">https://bugs.openjdk.java.net/browse/JDK-8031043</a></div><div \
style="margin: 0px; font-size: 10px; font-family: Monaco;"><a \
href="http://cr.openjdk.java.net/~twisti/8031043/webrev.00">http://cr.openjdk.java.net/~twisti/8031043/webrev.00</a></div><div \
style="margin: 0px; font-size: 10px; font-family: Monaco; min-height: \
14px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: \
Monaco;">8031043: ClassValue's backing map should have a smaller initial \
size</div><div style="margin: 0px; font-size: 10px; font-family: \
Monaco;">Reviewed-by:</div><div style="margin: 0px; font-size: 10px; font-family: \
Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; \
font-family: Monaco;">The current initial size for ClassValue's backing WeakHashMap \
(ClassValueMap) is:&nbsp;</div><div style="margin: 0px; font-size: 10px; font-family: \
Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; \
font-family: Monaco;">&nbsp; &nbsp; &nbsp; &nbsp; private static final int \
INITIAL_ENTRIES = 32;&nbsp;</div><div style="margin: 0px; font-size: 10px; \
font-family: Monaco; min-height: 14px;"><br></div><div style="margin: 0px; font-size: \
10px; font-family: Monaco;">This is too big and wastes a lot of memory. Usually a \
dynamic language or other users of ClassValue associate only one value with a Class. \
Even if users need more entries it's better to start small and grow as needed since \
adding new values to a Class is a one-time thing and not performance \
critical.</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; \
min-height: 14px;"><br></div><div style="margin: 0px; font-size: 10px; font-family: \
Monaco;">Here is some discussion on the mlvm-dev list:</div><div style="margin: 0px; \
font-size: 10px; font-family: Monaco; min-height: 14px;"><br></div><div \
style="margin: 0px; font-size: 10px; font-family: Monaco;"><a \
href="http://mail.openjdk.java.net/pipermail/mlvm-dev/2014-January/005597.html">http:/ \
/mail.openjdk.java.net/pipermail/mlvm-dev/2014-January/005597.html</a></div><div><br></div></body></html>




_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic