From fb8578ec8e0ffb9a708d4eb0fb9d19f7ca0be7ba Mon Sep 17 00:00:00 2001 From: Karthik Gururaj Date: Tue, 6 May 2014 10:32:07 -0700 Subject: [PATCH] Inlined the code from updateCell - helps Java JIT to detect hotspots and produce good native code --- .../broadinstitute/sting/utils/pairhmm/LoglessPairHMM.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protected/gatk-protected/src/main/java/org/broadinstitute/sting/utils/pairhmm/LoglessPairHMM.java b/protected/gatk-protected/src/main/java/org/broadinstitute/sting/utils/pairhmm/LoglessPairHMM.java index 31a0d1363..2408f34c1 100644 --- a/protected/gatk-protected/src/main/java/org/broadinstitute/sting/utils/pairhmm/LoglessPairHMM.java +++ b/protected/gatk-protected/src/main/java/org/broadinstitute/sting/utils/pairhmm/LoglessPairHMM.java @@ -101,7 +101,12 @@ public class LoglessPairHMM extends N2MemoryPairHMM { for (int i = 1; i < paddedReadLength; i++) { // +1 here is because hapStartIndex is 0-based, but our matrices are 1 based for (int j = hapStartIndex+1; j < paddedHaplotypeLength; j++) { - updateCell(i, j, prior[i][j], transition[i]); + //Inlined the code from updateCell - helps JIT to detect hotspots and produce good native code + matchMatrix[i][j] = prior[i][j] * ( matchMatrix[i - 1][j - 1] * transition[i][matchToMatch] + + insertionMatrix[i - 1][j - 1] * transition[i][indelToMatch] + + deletionMatrix[i - 1][j - 1] * transition[i][indelToMatch] ); + insertionMatrix[i][j] = matchMatrix[i - 1][j] * transition[i][matchToInsertion] + insertionMatrix[i - 1][j] * transition[i][insertionToInsertion]; + deletionMatrix[i][j] = matchMatrix[i][j - 1] * transition[i][matchToDeletion] + deletionMatrix[i][j - 1] * transition[i][deletionToDeletion]; } }