Skip to content
Browse files

Alternative bit function

  • Loading branch information...
1 parent 4b6393a commit d4f1dd7910727b95331a9f78538b6937a3afce02 @mikera committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/test/java/mikera/performance/PerformanceBenchmark.java
View
9 src/test/java/mikera/performance/PerformanceBenchmark.java
@@ -27,6 +27,15 @@ public void timeImproved(int runs) {
r=result;
}
}
+
+ public void timeImprovedWithMultiply(int runs) {
+ for (int i=0; i<runs; i++) {
+ long input = i;
+ long a = (input * 0x10001);
+ long result = (a & 0xFF000000FFL) + ((a & 0xFF000000FF00L) <<8);
+ r=result;
+ }
+ }
/**
* @param args

0 comments on commit d4f1dd7

Please sign in to comment.
Something went wrong with that request. Please try again.