Re-Review: 7032154 - Performance tuning of sun.misc.FloatingDecimal/FormattedFloatingDecimal

Brian Burkhalter brian.burkhalter at oracle.com
Wed Apr 24 21:57:43 UTC 2013


Hello,

Re-post of the proposed fix for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7032154.

The updated webrev is at http://cr.openjdk.java.net/~bpb/7032154/.

Since this change proposal was originally posted, more extensive review and testing has been performed, a couple of bugs found and fixed, and the code cleaned up substantially, primarily in terms of style and documentation.

Please review at your convenience. Hopefully this time the change will be deemed acceptable and we can move on.

Some statistics about the changes are included below. I hope that the formatting survives auto-forwarding ...

Thanks,

Brian

~~~~~

--- Lines of code ---

Net code reduction of 448 lines based on cloc (http://cloc.sourceforge.net) v 1.56:

File														Before		After
src/share/classes/java/util/Formatter.java					1974		1944
src/share/classes/sun/misc/FloatingDecimal.java				1369		1329
src/share/classes/sun/misc/FormattedFloatingDecimal.java	1104		269
src/share/classes/sun/misc/FDBigInt.java					330			0
src/share/classes/sun/misc/FDBigInteger.java				0			787
										Total (-448)		4777		4329

--- Microbenchmarking Results (operations / millisecond) ---

Dual Core MacBookPro5,3
JDK 8 64-bit fastdebug server
Server VM (-server)

-- Single Threaded

Test											Before		After		Change (%)
decimalFormatFormatDouble					37.138		54.551		+47
decimalFormatFormatObjectDouble			37.604		54.988		+46
decimalFormatFormatObjectFloat				77.850		106.716		+37
decimalFormatFormatToCharIteratorDouble		1.359		1.352		-0.5
decimalFormatFormatToCharIteratorFloat		8.293		8.421		+1.5
doubleToStringFast							2553.488	4006.301	+57
doubleToStringFastIterative					1776.017	2304.943	+30
doubleToStringSlowIterative					91.069		314.900		+46
floatToStringFast								3320.959	5398.451	+63
floatToStringFastIterative						2898.135	4498.891	+55
floatToStringSlowIterative						351.807		841.788		+39
formatterFormatDouble						34.628		53.091		+53
formatterFormatFloat							77.532		115.328		+49
parseDoubleFast								6600.946	8163.202	+24
parseDoubleFastIterative						3037.867	4397.148	+47
parseDoubleHex								152.875		565.412		+270
parseDoubleSlowIterative						357.848		760.584		+113
parseFloatFast								6679.775	8342.373	+25
parseFloatFastIterative						3627.009	4672.158	+29
parseFloatHex								151.791		567.527		+274
parseFloatSlowIterative						960.797		1497.473	+56
stringBufferAppendDouble					82.135		244.290		+197
stringBufferAppendFloat						280.669		599.049		+113
stringBuilderAppendDouble					82.102		246.431		+200
stringBuilderAppendFloat						284.135		613.715		+116

-- Two Threads on Dual Core MacBookPro5,3

Parenthetical values indicate change versus the same test on a single thread.

Test											Before			After
decimalFormatFormatDouble					57.038 (1.54)	89.872 (1.65)
decimalFormatFormatObjectDouble			58.337 (1.55)	90.631 (1.65)
decimalFormatFormatObjectFloat				121.016 (1.55)	179.136 (1.68)
decimalFormatFormatToCharIteratorDouble		1.826 (1.34)		1.885 (1.39)
decimalFormatFormatToCharIteratorFloat		11.717 (1.41)	12.316 (1.46)
doubleToStringFast							3645.053 (1.43)	6275.872 (1.57)
doubleToStringFastIterative					2874.118 (1.62)	4013.234 (1.74)
doubleToStringSlowIterative					130.749 (1.44)	548.555 (1.74)
floatToStringFast								4759.219 (1.43)	8427.571 (1.56)
floatToStringFastIterative						4148.118 (1.43)	7042.274 (1.56)
floatToStringSlowIterative						509.901 (1.45)	1399.959 (1.663)
formatterFormatDouble						50.776 (1.47)	79.339 (1.49)
formatterFormatFloat							113.682 (1.47)	173.964 (1.51)
parseDoubleFast								9726.542 (1.47)	12194.055 (1.49)
parseDoubleFastIterative						4950.301 (1.63)	6812.298 (1.55)
parseDoubleHex								243.253 (1.59)	903.218 (1.60)
parseDoubleSlowIterative						500.704 (1.40)	1101.429 (1.45)
parseFloatFast								9759.319 (1.46)	12398.548 (1.49)
parseFloatFastIterative						5903.467 (1.63)	7489.077 (1.61)
parseFloatHex								239.219 (1.58)	914.947 (1.61)
parseFloatSlowIterative						1434.349 (1.49)	2236.705 (1.49)
stringBufferAppendDouble					118.747 (1.45)	424.010 (1.74)
stringBufferAppendFloat						407.550 (1.45)	1020.185 (1.70)
stringBuilderAppendDouble					118.506 (1.44)	427.533 (1.73)
stringBuilderAppendFloat						409.844 (1.44)	1034.202 (1.69)




More information about the core-libs-dev mailing list