Skip to content

Commit

Permalink
#4 - 5% speed up for dual n+n/2+1
Browse files Browse the repository at this point in the history
  • Loading branch information
obriensystems committed Jan 1, 2025
1 parent ebc2ad9 commit 6f7df17
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void main(String[] args) {
/**
if even divide by 2, if odd multiply by 3 and add 1
or for odd numbers do 2 steps to optimize (n + n/2 + 1) - because we truncate divides
6% speed up for java, 20% for c,
6% speed up for Java, 20% for C, 6% for Go
*/
for(oddSearchCurrent = oddSearchStart; oddSearchCurrent < oddSearchEnd; oddSearchCurrent += oddSearchIncrement) {
current = oddSearchCurrent;
Expand Down

0 comments on commit 6f7df17

Please sign in to comment.