RFR(s): 8078463: optimize java/util/Map/Collisions.java
Stuart Marks
stuart.marks at oracle.com
Thu May 14 20:30:22 UTC 2015
On 5/14/15 12:58 AM, Chris Hegarty wrote:
> Or could use jdk.testlibrary.Asserts.assertEquals, if you want to avoid spinning up the testng machinery, and generating yet another xml test report. If you are only interested in assertEquals.
Unfortunately there are several assertions that aren't simple equality
assertions, so something else would have to be done for those.
>>> This of course is much simpler code, but it took 14.2 seconds, about 15%
>>> slower than the proposed version. Is the simpler code worth the slowdown? I
>>> could go either way.
>
> I’ve used the varargs version a number of times in my own tests. It is simple and easy to read. But if this 15% is important, then it could be worth the extra overloads. Either way I’m happy to this this change going in.
OK, thanks. I think I'll keep the multiple overloads.
The reason this came up in the first place was that the test timed out because
it ran too long. Now arguably (and I have argued) that this is a test
environment problem. Since this is a quick and easy speedup, though, we might as
well do it. And as long as we're speeding things up, we might as well speed them
up as much as is (reasonably) possible.
s'marks
More information about the core-libs-dev
mailing list