- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 115 for nextInt (0.07 sec)
-
android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java
* * @author Colin Decker */ public class ChecksumBenchmark { // Use a constant seed for all of the benchmarks to ensure apples to apples comparisons. private static final int RANDOM_SEED = new Random().nextInt(); @Param({"10", "1000", "100000", "1000000"}) private int size; private byte[] testBytes; @BeforeExperiment void setUp() { testBytes = new byte[size];
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 16 16:53:43 UTC 2024 - 3.4K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java
void setUp() { checkArgument(size > 0, "empty collection not supported"); Set<Integer> set = new LinkedHashSet<>(size); Random random = new Random(); while (set.size() < size) { set.add(random.nextInt()); } List<Integer> list = new ArrayList<>(set); inputOrder.arrange(list); input = ImmutableList.copyOf(list); } @Benchmark int collections(int reps) { int dummy = 0;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 3.5K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java
sb.ensureCapacity(size); for (int k = 0; k < size; k++) { // [9-127) includes all ascii non-control characters sb.append((char) (random.nextInt(127 - 9) + 9)); } String string = sb.toString(); sb.setLength(0); data = ByteSource.wrap(string.getBytes(charset)); } @Benchmark public int timeCopy(int reps) throws IOException {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 10 19:45:10 UTC 2022 - 5.2K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java
return hashFn; } } // Use a constant seed for all of the benchmarks to ensure apples to apples comparisons. private static final int RANDOM_SEED = new Random().nextInt(); private byte[] testBytes; @BeforeExperiment void setUp() { testBytes = new byte[size]; new Random(RANDOM_SEED).nextBytes(testBytes); } @Benchmark
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.5K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java
return hashFn; } } // Use a constant seed for all of the benchmarks to ensure apples to apples comparisons. private static final int RANDOM_SEED = new Random().nextInt(); private byte[] testBytes; @BeforeExperiment void setUp() { testBytes = new byte[size]; new Random(RANDOM_SEED).nextBytes(testBytes); } @Benchmark
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.5K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java
* * @author Colin Decker */ public class ChecksumBenchmark { // Use a constant seed for all of the benchmarks to ensure apples to apples comparisons. private static final int RANDOM_SEED = new Random().nextInt(); @Param({"10", "1000", "100000", "1000000"}) private int size; private byte[] testBytes; @BeforeExperiment void setUp() { testBytes = new byte[size];
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 16 16:53:43 UTC 2024 - 3.4K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java
for (int i = 0; i < reps; i++) { dummy += cache.getUnchecked(nextRandomKey()); } requests.addAndGet(reps); return dummy; } private int nextRandomKey() { int a = random.nextInt(max); /* * For example, if concentration=2.0, the following takes the square root of * the uniformly-distributed random integer, then truncates any fractional
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java
Set<Element> set = Sets.newHashSetWithExpectedSize(size); while (set.size() < size) { set.add(newElement()); } return set; } private Element newElement() { int value = random.nextInt(); return isUserTypeFast ? new Element(value) : new SlowElement(value); } static class Element implements Comparable<Element> { final int hash; Element(int hash) { this.hash = hash;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 4.1K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java
StringBuilder sb = new StringBuilder(); for (int j = 0; j < charCount; j++) { int codePoint; // discard illegal surrogate "codepoints" do { codePoint = rnd.nextInt(maxCodePoint.value); } while (Character.isSurrogate((char) codePoint)); sb.appendCodePoint(codePoint); } strings[i] = sb.toString(); } } @Benchmark
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 5.2K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java
StringBuilder sb = new StringBuilder(); for (int j = 0; j < charCount; j++) { int codePoint; // discard illegal surrogate "codepoints" do { codePoint = rnd.nextInt(maxCodePoint.value); } while (Character.isSurrogate((char) codePoint)); sb.appendCodePoint(codePoint); } strings[i] = sb.toString(); } } @Benchmark
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 5.2K bytes - Viewed (0)