final InstrumentDerivative[] swap = new InstrumentDerivative[nbSwap];
for (int loops = 0; loops < nbSwap; loops++) {
final double rate = RATE_FIXED - 0.0050 + loops * BP1;
final SwapFixedIborDefinition swapDefinition = SwapFixedIborDefinition.from(SETTLEMENT_DATE, SWAP_TENOR, USD6MLIBOR3M, NOTIONAL, rate, true);
swap[loops] = swapDefinition.toDerivative(referenceDate);
}
startTime = System.currentTimeMillis();
for (int looptest = 0; looptest < nbTest; looptest++) {
for (int loops = 0; loops < nbSwap; loops++) {
pv[loops] = swap[loops].accept(pvdCalculator, MULTICURVES);
}
}
endTime = System.currentTimeMillis();
System.out.println("SwapCalculatorTest: " + nbTest + " x " + nbSwap + " swaps (5Y/Q) - present value " + (endTime - startTime) + " ms");
// Performance note: Discounting price: 13-Mar-2013: On Mac Pro 3.2 GHz Quad-Core Intel Xeon: xx ms for 100x100 swaps.
startTime = System.currentTimeMillis(); // Swap construction + PV
for (int looptest = 0; looptest < nbTest; looptest++) {
for (int loops = 0; loops < nbSwap; loops++) {
final double rate = RATE_FIXED - 0.0050 + loops * BP1;
final SwapFixedIborDefinition swapDefinition = SwapFixedIborDefinition.from(SETTLEMENT_DATE, SWAP_TENOR, USD6MLIBOR3M, NOTIONAL, rate, true);
swap[loops] = swapDefinition.toDerivative(referenceDate);
}
for (int loops = 0; loops < nbSwap; loops++) {
pv[loops] = swap[loops].accept(pvdCalculator, MULTICURVES);
}
}