Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 bit collatz multithreaded implementation in Java #19

Open
obriensystems opened this issue Jan 1, 2025 · 17 comments
Open

64 bit collatz multithreaded implementation in Java #19

obriensystems opened this issue Jan 1, 2025 · 17 comments
Assignees

Comments

@obriensystems
Copy link
Member

obriensystems commented Jan 1, 2025

TODO

option 1: custom 16-32 thread pool

option 2: Java 7 level ForkJoinPool

option 3: Java 8 lambda/streams parallelization

public void searchCollatzParallel(long oddSearchCurrent, long secondsStart) {
	long batchBits = 5; // adjust this based on the chip architecture 
		
	long searchBits = 32;
	long batches = 1 << batchBits;
	long threadBits = searchBits - batchBits;
	long threads = 1 << threadBits;
		
	for (long part = 0; part < (batches + 1) ; part++) {	
		// generate a limited collection for the search space - 32 is a good
		System.out.println("Searching: " + searchBits + " space, batch " + part + " of " 
				+ batches + " with " + threadBits +" bits of " + threads + " threads"  );
			
		List<Long> oddNumbers = LongStream
				.range(1L + (part * threads), ((1 + part) * threads) - 1)
				.filter(x -> x % 2 != 0) // TODO: find a way to avoid this filter using range above
				.boxed()
				.collect(Collectors.toList());
			
		// filter on max value or path
		List<Long> results = oddNumbers
			.parallelStream()
			.filter(num -> isCollatzMax(num.longValue(), secondsStart))
			.collect(Collectors.toList());

		results.stream().sorted().forEach(x -> System.out.println(x));
	}
	System.out.println("last number: " + ((1 + (batches) * threads) - 1));
}


m4pro 972 batch 13
64330
@obriensystems obriensystems self-assigned this Jan 1, 2025
obriensystems added a commit that referenced this issue Jan 1, 2025
@obriensystems
Copy link
Member Author

M4max preliminary results (chasing heap space)

			// generate a limited collection for the search space - 32 is a good
			List<Long> oddNumbers = LongStream.range(1L,1L << 28)
					.boxed()
					.collect(Collectors.toList());
			
			// filter on max value or path
			List<Long> results = oddNumbers
				.parallelStream()
				.filter(num -> isCollatzMax(num.longValue(), secondsStart))
				.collect(Collectors.toList());

			results.stream().sorted().forEach(x -> System.out.println(x));


Collatz multithreaded 2025 michael at obrienlabs.dev
mp: 222298113 p: 271 m: 666894340 ms: 2293 dur: 2
mp: 88080384 p: 29 m: 64 ms: 2293 dur: 2
mp: 130023425 p: 234 m: 390070276 ms: 2293 dur: 2
m0: 155189263 p: 242 m: 1571291296 ms: 2294 dur: 2
m0: 243269633 p: 191 m: 729808900 ms: 2293 dur: 2
m0: 155189275 p: 392 m: 232482095620 ms: 0 dur: 2
mp: 41943040 p: 28 m: 16 ms: 2293 dur: 2
mp: 125829121 p: 296 m: 377487364 ms: 2293 dur: 2
m0: 176160768 p: 30 m: 64 ms: 2293 dur: 2
mp: 96468993 p: 169 m: 289406980 ms: 2293 dur: 2
m0: 222298127 p: 165 m: 2250768544 ms: 0 dur: 2
mp: 104857600 p: 45 m: 88 ms: 2293 dur: 2
m0: 121634823 p: 159 m: 821035060 ms: 2293 dur: 2
mp: 113246208 p: 133 m: 9232 ms: 2293 dur: 2
m0: 58720257 p: 176 m: 176160772 ms: 2293 dur: 2
m0: 88080411 p: 179 m: 15445370356 ms: 0 dur: 2
mp: 75497472 p: 42 m: 52 ms: 2293 dur: 2
m0: 96469019 p: 337 m: 513834359668 ms: 1 dur: 2
m0: 130023451 p: 247 m: 27022585120 ms: 0 dur: 2
m0: 109051919 p: 226 m: 1104150688 ms: 2293 dur: 2
mp: 125829174 p: 570 m: 358601694532 ms: 0 dur: 2
m0: 20971521 p: 128 m: 62914564 ms: 2293 dur: 2
m0: 121635038 p: 619 m: 527067306664 ms: 0 dur: 2
mp: 121635038 p: 619 m: 527067306664 ms: 0 dur: 2
mp: 243270076 p: 620 m: 527067306664 ms: 0 dur: 2
mp: 155189275 p: 392 m: 232482095620 ms: 0 dur: 2
m0: 113247145 p: 469 m: 1469092117696 ms: 0 dur: 2
mp: 104857662 p: 456 m: 3228506080 ms: 0 dur: 2
m0: 222302422 p: 382 m: 9238597547092 ms: 1 dur: 2
m0: 243279295 p: 408 m: 89768582036980 ms: 4 dur: 2
mp: 41955177 p: 708 m: 159424614880 ms: 3 dur: 2
mp: 176187369 p: 754 m: 71573703784 ms: 8 dur: 2
m0: 125974687 p: 433 m: 198555228924928 ms: 47 dur: 2
m0: 58915198 p: 605 m: 306296925203752 ms: 10 dur: 2
m0: 130260095 p: 477 m: 474637698851092 ms: 16 dur: 2
mp: 155428635 p: 790 m: 88506516292 ms: 8 dur: 2
m0: 96883183 p: 810 m: 825525149213608 ms: 33 dur: 2
mp: 96883183 p: 810 m: 825525149213608 ms: 0 dur: 2
mp: 127456254 p: 950 m: 966616035460 ms: 333 dur: 2
m0: 106732521 p: 575 m: 2185143829170100 ms: 74 dur: 2
m0: 246666523 p: 514 m: 6404797161121264 ms: 447 dur: 3
mp: 169941673 p: 953 m: 966616035460 ms: 1789 dur: 5
mp: 226588897 p: 956 m: 966616035460 ms: 491 dur: 5
20971521
41943040
41955177
58720257
58915198
75497472
88080384
88080411
96468993
96469019
96883183
104857600
104857662
106732521
109051919
113246208
113247145
121634823
121635038
125829121
125829174
125974687
127456254
130023425
130023451
130260095
155189263
155189275
155428635
169941673
176160768
176187369
222298113
222298127
222302422
226588897
243269633
243270076
243279295
246666523
completed: 6686

@obriensystems
Copy link
Member Author

119 sec using brute force 2 ^ 29 threads - will rerun more granular

Screenshot 2025-01-01 at 11 35 34
		for (long part = 0; part < 16; part++) {
			
			// generate a limited collection for the search space - 32 is a good
			List<Long> oddNumbers = LongStream.range(1L + (part * (1L << 28)), (1 + part) * (1L << 28))
					.boxed()
					.collect(Collectors.toList());
			
			// filter on max value or path
			List<Long> results = oddNumbers
				.parallelStream()
				.filter(num -> isCollatzMax(num.longValue(), secondsStart))
				.collect(Collectors.toList());

			results.stream().sorted().forEach(x -> System.out.println(x));
			// clear the heap
			System.out.println("Clear the 12g heap between ForkJoinPool runs");
			results = null;
			oddNumbers = null;
			// ask
			System.gc();
			
		}


Collatz multithreaded 2025 michael at obrienlabs.dev
mp: 75497473 p: 241 m: 226492420 ms: 2448 dur: 2
m0: 222298113 p: 271 m: 666894340 ms: 2448 dur: 2
m0: 117440515 p: 177 m: 528482320 ms: 2448 dur: 2
m0: 121634817 p: 159 m: 364904452 ms: 2448 dur: 2
mp: 104857600 p: 45 m: 88 ms: 2448 dur: 2
mp: 41943040 p: 28 m: 16 ms: 2447 dur: 2
mp: 130023424 p: 128 m: 9232 ms: 2448 dur: 2
m0: 176160768 p: 30 m: 64 ms: 2447 dur: 2
mp: 88080384 p: 29 m: 64 ms: 2447 dur: 2
m0: 109051911 p: 182 m: 736100404 ms: 2448 dur: 2
mp: 100663297 p: 244 m: 301989892 ms: 2448 dur: 2
m0: 113246208 p: 133 m: 9232 ms: 2447 dur: 2
mp: 222298113 p: 271 m: 666894340 ms: 0 dur: 2
m0: 20971521 p: 128 m: 62914564 ms: 2448 dur: 2
m0: 75497499 p: 179 m: 4649047648 ms: 0 dur: 2
m0: 155189263 p: 242 m: 1571291296 ms: 2448 dur: 2
mp: 222298139 p: 382 m: 23099949664 ms: 0 dur: 2
m0: 117440539 p: 182 m: 30890738176 ms: 0 dur: 2
m0: 155189275 p: 392 m: 232482095620 ms: 2 dur: 2
mp: 155189275 p: 392 m: 232482095620 ms: 0 dur: 2
m0: 58720257 p: 176 m: 176160772 ms: 2448 dur: 2
m0: 243269635 p: 160 m: 1094713360 ms: 2448 dur: 2
mp: 155189598 p: 485 m: 49039295236 ms: 0 dur: 2
mp: 104857631 p: 319 m: 13978656628 ms: 0 dur: 2
m0: 222298143 p: 240 m: 32890358608 ms: 0 dur: 2
mp: 104857708 p: 518 m: 223658683108 ms: 1 dur: 2
m0: 130023518 p: 340 m: 300200433604 ms: 0 dur: 2
m0: 100663999 p: 262 m: 773841759568 ms: 0 dur: 2
mp: 121634927 p: 407 m: 18959407720 ms: 0 dur: 2
mp: 121635038 p: 619 m: 527067306664 ms: 0 dur: 2
m0: 113247145 p: 469 m: 1469092117696 ms: 0 dur: 2
mp: 243270076 p: 620 m: 527067306664 ms: 0 dur: 2
m0: 155192732 p: 397 m: 1838700140128 ms: 3 dur: 2
m0: 222302422 p: 382 m: 9238597547092 ms: 2 dur: 2
mp: 117451055 p: 632 m: 1208892070420 ms: 3 dur: 2
mp: 41955177 p: 708 m: 159424614880 ms: 0 dur: 2
m0: 243279295 p: 408 m: 89768582036980 ms: 2 dur: 2
mp: 176187369 p: 754 m: 71573703784 ms: 16 dur: 2
m0: 58915198 p: 605 m: 306296925203752 ms: 59 dur: 2
m0: 130260095 p: 477 m: 474637698851092 ms: 8 dur: 2
mp: 155428635 p: 790 m: 88506516292 ms: 7 dur: 2
m0: 222863207 p: 576 m: 494442403670932 ms: 106 dur: 2
m0: 101312511 p: 562 m: 2185143829170100 ms: 2 dur: 2
mp: 156977263 p: 896 m: 825525149213608 ms: 301 dur: 2
m0: 120080895 p: 438 m: 3277901576118580 ms: 246 dur: 3
m0: 246666523 p: 514 m: 6404797161121264 ms: 244 dur: 3
mp: 63728127 p: 949 m: 966616035460 ms: 308 dur: 3
mp: 127456254 p: 950 m: 966616035460 ms: 250 dur: 4
mp: 169941673 p: 953 m: 966616035460 ms: 1133 dur: 5
mp: 226588897 p: 956 m: 966616035460 ms: 580 dur: 5
20971521
41943040
41955177
58720257
58915198
63728127
75497473
75497499
88080384
100663297
100663999
101312511
104857600
104857631
104857708
109051911
113246208
113247145
117440515
117440539
117451055
120080895
121634817
121634927
121635038
127456254
130023424
130023518
130260095
155189263
155189275
155189598
155192732
155428635
156977263
169941673
176160768
176187369
222298113
222298139
222298143
222302422
222863207
226588897
243269635
243270076
243279295
246666523
Clear the 12g heap between ForkJoinPool runs
m0: 379027947 p: 600 m: 1414236446719942480 ms: 3421 dur: 9
mp: 453177793 p: 957 m: 966616035460 ms: 872 dur: 10
mp: 268549803 p: 964 m: 966616035460 ms: 2379 dur: 12
268549803
379027947
453177793
Clear the 12g heap between ForkJoinPool runs
mp: 716132809 p: 968 m: 966616035460 ms: 4497 dur: 16
mp: 670617279 p: 986 m: 966616035460 ms: 1387 dur: 18
670617279
716132809
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
mp: 1341234558 p: 987 m: 966616035460 ms: 16101 dur: 34
1341234558
Clear the 12g heap between ForkJoinPool runs
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 7577 dur: 41
mp: 1412987847 p: 1000 m: 966616035460 ms: 824 dur: 42
1410123943
1412987847
Clear the 12g heap between ForkJoinPool runs
mp: 1674652263 p: 1008 m: 966616035460 ms: 4299 dur: 47
1674652263
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
mp: 2610744987 p: 1050 m: 966616035460 ms: 21647 dur: 68
2610744987
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
Clear the 12g heap between ForkJoinPool runs
completed: 118537

obriensystems added a commit that referenced this issue Jan 1, 2025
@obriensystems
Copy link
Member Author

116 sec on 32 split up from 16
114 sec on 32 split without System.gc() - let the heap self manage between 12 and 6g

cores up to 12 instead of 15 (using only PC not EC)
Screenshot 2025-01-01 at 11 54 44
completed: 124308
not as efficient

	public void searchCollatzParallel(long oddSearchCurrent, long secondsStart) {
		long current = oddSearchCurrent;
		long path = 0L;
		long maxValue = 1L;

		
		long searchBits = 32;
		long batchBits = 8;
		long batches = 1 << batchBits;
		long threadBits = searchBits - batchBits;
		long threads = 1 << threadBits;
		for (long part = 0; part < batches ; part++) {
			
			// generate a limited collection for the search space - 32 is a good
			System.out.println("Searching: " + searchBits + " space, batch " + part + " of " 
					+ batches + " with " + threadBits +" bits of " + threads + " threads"  );
			List<Long> oddNumbers = LongStream.range(1L + (part * threads), (1 + part) * threads)
					.boxed()
					.collect(Collectors.toList());
			
			// filter on max value or path
			List<Long> results = oddNumbers
				.parallelStream()
				.filter(num -> isCollatzMax(num.longValue(), secondsStart))
				.collect(Collectors.toList());

			results.stream().sorted().forEach(x -> System.out.println(x));
		}
	}

adjust the following based on the chip arch
long batchBits = 6;

Screenshot 2025-01-01 at 11 57 12 Screenshot 2025-01-01 at 11 57 39

Searching: 32 space, batch 63 of 64 with 26 bits of 67108864 threads
completed: 119359

5 bits or 32 batch is the sweet spot
Screenshot 2025-01-01 at 12 00 12

Searching: 32 space, batch 19 of 32 with 27 bits of 134217728 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 24297 dur: 70
2610744987
Searching: 32 space, batch 20 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 21 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 22 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 23 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 24 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 25 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 26 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 27 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 28 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 29 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 30 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 31 of 32 with 27 bits of 134217728 threads
completed: 115524

obriensystems added a commit that referenced this issue Jan 1, 2025
@obriensystems
Copy link
Member Author

obriensystems commented Jan 1, 2025

Searching: 33 space, batch 6 of 32 with 28 bits of 268435456 threads

Screenshot 2025-01-01 at 12 02 50

overflow on 33

Searching: 33 space, batch 0 of 32 with 28 bits of 268435456 threads
m0: 176160768 p: 30 m: 64 ms: 2486 dur: 2
mp: 41943040 p: 28 m: 16 ms: 2486 dur: 2
mp: 104857600 p: 45 m: 88 ms: 0 dur: 2
mp: 176160768 p: 30 m: 64 ms: 0 dur: 2
m0: 176160769 p: 175 m: 528482308 ms: 0 dur: 2
m0: 88080385 p: 205 m: 264241156 ms: 0 dur: 2
mp: 41943041 p: 253 m: 125829124 ms: 0 dur: 2
m0: 104857601 p: 138 m: 314572804 ms: 0 dur: 2
m0: 176160771 p: 206 m: 792723472 ms: 0 dur: 2
m0: 121634823 p: 159 m: 821035060 ms: 0 dur: 2
m0: 243269635 p: 160 m: 1094713360 ms: 0 dur: 2
mp: 125829121 p: 296 m: 377487364 ms: 0 dur: 2
m0: 113246223 p: 164 m: 1146618016 ms: 0 dur: 2
m0: 41943044 p: 266 m: 1679340436 ms: 0 dur: 2
mp: 222298113 p: 271 m: 666894340 ms: 0 dur: 2
m0: 130023451 p: 247 m: 27022585120 ms: 0 dur: 2
mp: 113246235 p: 376 m: 15690533812 ms: 0 dur: 2
m0: 88080411 p: 179 m: 15445370356 ms: 0 dur: 2
m0: 176160809 p: 180 m: 30890738176 ms: 0 dur: 2
m0: 130023518 p: 340 m: 300200433604 ms: 0 dur: 2
m0: 125829174 p: 570 m: 358601694532 ms: 0 dur: 2
mp: 125829174 p: 570 m: 358601694532 ms: 0 dur: 2
mp: 104857662 p: 456 m: 3228506080 ms: 0 dur: 2
m0: 121635038 p: 619 m: 527067306664 ms: 0 dur: 2
mp: 243270076 p: 620 m: 527067306664 ms: 1 dur: 2
m0: 113247145 p: 469 m: 1469092117696 ms: 1 dur: 2
m0: 155189275 p: 392 m: 232482095620 ms: 0 dur: 2
m0: 121638454 p: 270 m: 1556709308296 ms: 2 dur: 2
m0: 155192732 p: 397 m: 1838700140128 ms: 2 dur: 2
m0: 222302422 p: 382 m: 9238597547092 ms: 0 dur: 2
m0: 243279295 p: 408 m: 89768582036980 ms: 2 dur: 2
mp: 117451055 p: 632 m: 1208892070420 ms: 0 dur: 2
mp: 41955177 p: 708 m: 159424614880 ms: 5 dur: 2
mp: 176187369 p: 754 m: 71573703784 ms: 7 dur: 2
m0: 125974687 p: 433 m: 198555228924928 ms: 42 dur: 2
m0: 58915198 p: 605 m: 306296925203752 ms: 19 dur: 2
m0: 130260095 p: 477 m: 474637698851092 ms: 3 dur: 2
mp: 155428635 p: 790 m: 88506516292 ms: 10 dur: 2
m0: 222863207 p: 576 m: 494442403670932 ms: 92 dur: 2
m0: 244409897 p: 403 m: 548497175735104 ms: 168 dur: 2
mp: 127456254 p: 950 m: 966616035460 ms: 110 dur: 2
m0: 106732521 p: 575 m: 2185143829170100 ms: 75 dur: 3
m0: 120080895 p: 438 m: 3277901576118580 ms: 202 dur: 3
m0: 246666523 p: 514 m: 6404797161121264 ms: 251 dur: 3
mp: 169941673 p: 953 m: 966616035460 ms: 1840 dur: 5
mp: 226588897 p: 956 m: 966616035460 ms: 446 dur: 5
41943040
41943041
41943044
41955177
58915198
88080385
88080411
104857600
104857601
104857662
106732521
113246223
113246235
113247145
117451055
120080895
121634823
121635038
121638454
125829121
125829174
125974687
127456254
130023451
130023518
130260095
155189275
155192732
155428635
169941673
176160768
176160769
176160771
176160809
176187369
222298113
222302422
222863207
226588897
243269635
243270076
243279295
244409897
246666523
Searching: 33 space, batch 1 of 32 with 28 bits of 268435456 threads
m0: 525858345 p: 585 m: 109005159866976880 ms: 3844 dur: 9
m0: 426406441 p: 595 m: 1414236446719942480 ms: 382 dur: 9
mp: 402824705 p: 962 m: 966616035460 ms: 1568 dur: 11
mp: 268549803 p: 964 m: 966616035460 ms: 1284 dur: 12
268549803
402824705
426406441
525858345
Searching: 33 space, batch 2 of 32 with 28 bits of 268435456 threads
mp: 716132809 p: 968 m: 966616035460 ms: 4115 dur: 16
mp: 670617279 p: 986 m: 966616035460 ms: 197 dur: 17
670617279
716132809
Searching: 33 space, batch 3 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 4 of 32 with 28 bits of 268435456 threads
mp: 1341234558 p: 987 m: 966616035460 ms: 18190 dur: 35
1341234558
Searching: 33 space, batch 5 of 32 with 28 bits of 268435456 threads
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 3996 dur: 39
mp: 1412987847 p: 1000 m: 966616035460 ms: 885 dur: 40
1410123943
1412987847
Searching: 33 space, batch 6 of 32 with 28 bits of 268435456 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 7966 dur: 48
1674652263
Searching: 33 space, batch 7 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 8 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 9 of 32 with 28 bits of 268435456 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 23972 dur: 72
2610744987
Searching: 33 space, batch 10 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 11 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 12 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 13 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 14 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 15 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 16 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 17 of 32 with 28 bits of 268435456 threads
mp: 4578853915 p: 1087 m: 966616035460 ms: 61814 dur: 133
4578853915
Searching: 33 space, batch 18 of 32 with 28 bits of 268435456 threads
mp: 4890328815 p: 1131 m: 319497287463520 ms: 6504 dur: 140
4890328815
Searching: 33 space, batch 19 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 20 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 21 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 22 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 23 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 24 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 25 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 26 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 27 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 28 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 29 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 30 of 32 with 28 bits of 268435456 threads
Searching: 33 space, batch 31 of 32 with 28 bits of 268435456 threads
m0: 8528817511 p: 726 m: -302149136352953592 ms: 93923 dur: 234
8528817511
completed: 239277

obriensystems added a commit that referenced this issue Jan 1, 2025
@obriensystems
Copy link
Member Author

Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 32 with 27 bits of 134217728 threads
m0: 88080383 p: 298 m: 1318004503576 ms: 1063 dur: 1
mp: 88080383 p: 298 m: 1318004503576 ms: 0 dur: 1
mp: 20971547 p: 327 m: 4654301776 ms: 0 dur: 1
m0: 111149055 p: 301 m: 1871095679188 ms: 0 dur: 1
m0: 121634815 p: 283 m: 2216420149480 ms: 0 dur: 1
m0: 77594623 p: 241 m: 14123284673092 ms: 1 dur: 1
mp: 52428831 p: 455 m: 3228506080 ms: 0 dur: 1
mp: 54525979 p: 354 m: 6374281120 ms: 0 dur: 1
mp: 121635038 p: 619 m: 527067306664 ms: 0 dur: 1
mp: 60817481 p: 357 m: 15011626048 ms: 0 dur: 1
mp: 62914587 p: 569 m: 358601694532 ms: 0 dur: 1
m0: 111162815 p: 482 m: 18731239518112 ms: 15 dur: 1
mp: 10507503 p: 675 m: 15208728208 ms: 3 dur: 1
mp: 62932764 p: 706 m: 159424614880 ms: 1 dur: 1
m0: 37769470 p: 563 m: 60342610919632 ms: 1 dur: 1
m0: 29457599 p: 604 m: 306296925203752 ms: 38 dur: 1
m0: 111296127 p: 469 m: 421482397464772 ms: 18 dur: 1
mp: 63101607 p: 737 m: 2916597734800 ms: 5 dur: 1
m0: 121981103 p: 495 m: 474637698851092 ms: 36 dur: 1
mp: 55187303 p: 742 m: 159424614880 ms: 98 dur: 1
mp: 63728127 p: 949 m: 966616035460 ms: 35 dur: 1
m0: 96883183 p: 810 m: 825525149213608 ms: 463 dur: 1
m0: 120074087 p: 570 m: 2185143829170100 ms: 555 dur: 2
m0: 120080895 p: 438 m: 3277901576118580 ms: 2 dur: 2
mp: 127456254 p: 950 m: 966616035460 ms: 793 dur: 3
10507503
20971547
29457599
37769470
52428831
54525979
55187303
60817481
62914587
62932764
63101607
63728127
77594623
88080383
96883183
111149055
111162815
111296127
120074087
120080895
121634815
121635038
121981103
127456254
Searching: 32 space, batch 1 of 32 with 27 bits of 134217728 threads
mp: 169941673 p: 953 m: 966616035460 ms: 1036 dur: 4
m0: 246666523 p: 514 m: 6404797161121264 ms: 340 dur: 4
mp: 226588897 p: 956 m: 966616035460 ms: 1388 dur: 5
169941673
226588897
246666523
Searching: 32 space, batch 2 of 32 with 27 bits of 134217728 threads
m0: 380379879 p: 644 m: 11840694835853140 ms: 1635 dur: 7
m0: 379027947 p: 600 m: 1414236446719942480 ms: 857 dur: 8
mp: 302118529 p: 959 m: 966616035460 ms: 233 dur: 8
mp: 268549803 p: 964 m: 966616035460 ms: 491 dur: 9
268549803
302118529
379027947
380379879
Searching: 32 space, batch 3 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 4 of 32 with 27 bits of 134217728 threads
mp: 537099606 p: 965 m: 966616035460 ms: 6917 dur: 16
mp: 670617279 p: 986 m: 966616035460 ms: 416 dur: 16
537099606
670617279
Searching: 32 space, batch 5 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 6 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 7 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 8 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 9 of 32 with 27 bits of 134217728 threads
mp: 1341234558 p: 987 m: 966616035460 ms: 16660 dur: 33
1341234558
Searching: 32 space, batch 10 of 32 with 27 bits of 134217728 threads
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 4252 dur: 37
mp: 1412987847 p: 1000 m: 966616035460 ms: 230 dur: 37
1410123943
1412987847
Searching: 32 space, batch 11 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 12 of 32 with 27 bits of 134217728 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 7156 dur: 44
1674652263
Searching: 32 space, batch 13 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 14 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 15 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 16 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 17 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 18 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 19 of 32 with 27 bits of 134217728 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 25090 dur: 69
2610744987
Searching: 32 space, batch 20 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 21 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 22 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 23 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 24 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 25 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 26 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 27 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 28 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 29 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 30 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 31 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 32 of 32 with 27 bits of 134217728 threads
last number: 4294967296
completed: 117963

@obriensystems
Copy link
Member Author

13900k a - 16g heap
Screenshot 2025-01-01 at 13 16 44

micha@13900a MINGW64 /c/wse_github/obrienlabsdev/performance/cpu/virtual/multithreaded/java-benchmark-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 32 with 27 bits of 134217728 threads
mp: 44040192 p: 28 m: 64 ms: 2259 dur: 2
mp: 22020097 p: 172 m: 66060292 ms: 2259 dur: 2
mp: 22020104 p: 203 m: 8257540 ms: 0 dur: 2
m0: 89128959 p: 223 m: 592753348168 ms: 2259 dur: 2
mp: 44040193 p: 173 m: 132120580 ms: 0 dur: 2
m0: 122683391 p: 350 m: 815907549832 ms: 0 dur: 2
mp: 105906207 p: 319 m: 5796960208 ms: 0 dur: 2
m0: 77594623 p: 241 m: 14123284673092 ms: 0 dur: 2
mp: 111149055 p: 301 m: 1871095679188 ms: 0 dur: 2
mp: 89128991 p: 311 m: 4878630160 ms: 0 dur: 2
mp: 122683391 p: 350 m: 815907549832 ms: 0 dur: 2
mp: 115343359 p: 389 m: 1150638852328 ms: 1 dur: 2
mp: 38797423 p: 452 m: 116484427024 ms: 6 dur: 2
mp: 105906313 p: 518 m: 2445595072 ms: 3 dur: 2
mp: 60817519 p: 618 m: 527067306664 ms: 2 dur: 2
mp: 121635038 p: 619 m: 527067306664 ms: 2 dur: 2
m0: 97518969 p: 505 m: 55458724036804 ms: 2 dur: 2
mp: 89131711 p: 678 m: 55688506648 ms: 5 dur: 2
m0: 97540219 p: 474 m: 80058454336744 ms: 43 dur: 2
mp: 94399148 p: 704 m: 159424614880 ms: 5 dur: 2
m0: 119606763 p: 275 m: 94259207953024 ms: 1 dur: 2
m0: 44186399 p: 602 m: 306296925203752 ms: 16 dur: 2
mp: 128081150 p: 738 m: 7209046267252 ms: 3 dur: 2
m0: 111296127 p: 469 m: 421482397464772 ms: 1 dur: 2
m0: 102921554 p: 487 m: 474637698851092 ms: 12 dur: 2
m0: 120074087 p: 570 m: 2185143829170100 ms: 140 dur: 2
m0: 120080895 p: 438 m: 3277901576118580 ms: 3 dur: 2
mp: 98110761 p: 748 m: 159424614880 ms: 9 dur: 2
mp: 103359483 p: 761 m: 159424614880 ms: 9 dur: 2
mp: 86010015 p: 797 m: 3177300945976 ms: 152 dur: 2
mp: 129177577 p: 813 m: 825525149213608 ms: 58 dur: 2
mp: 95592191 p: 947 m: 966616035460 ms: 60 dur: 2
mp: 127456254 p: 950 m: 966616035460 ms: 508 dur: 3
22020097
22020104
38797423
44040192
44040193
44186399
60817519
77594623
86010015
89128959
89128991
89131711
94399148
95592191
97518969
97540219
98110761
102921554
103359483
105906207
105906313
111149055
111296127
115343359
119606763
120074087
120080895
121635038
122683391
127456254
128081150
129177577
Searching: 32 space, batch 1 of 32 with 27 bits of 134217728 threads
mp: 169941673 p: 953 m: 966616035460 ms: 2852 dur: 6
m0: 210964383 p: 475 m: 6404797161121264 ms: 829 dur: 6
mp: 226588897 p: 956 m: 966616035460 ms: 370 dur: 7
169941673
210964383
226588897
Searching: 32 space, batch 2 of 32 with 27 bits of 134217728 threads
mp: 268549803 p: 964 m: 966616035460 ms: 2433 dur: 9
m0: 380379879 p: 644 m: 11840694835853140 ms: 253 dur: 10
m0: 394393759 p: 582 m: 109005159866976880 ms: 172 dur: 10
m0: 379027947 p: 600 m: 1414236446719942480 ms: 535 dur: 10
268549803
379027947
380379879
394393759
Searching: 32 space, batch 3 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 4 of 32 with 27 bits of 134217728 threads
mp: 537099606 p: 965 m: 966616035460 ms: 6267 dur: 16
mp: 670617279 p: 986 m: 966616035460 ms: 142 dur: 17
537099606
670617279
Searching: 32 space, batch 5 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 9 of 32 with 27 bits of 134217728 threads
mp: 1341234558 p: 987 m: 966616035460 ms: 16959 dur: 34
1341234558
Searching: 32 space, batch 10 of 32 with 27 bits of 134217728 threads
mp: 1412987847 p: 1000 m: 966616035460 ms: 4209 dur: 38
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 333 dur: 38
1410123943
1412987847
Searching: 32 space, batch 11 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 12 of 32 with 27 bits of 134217728 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 5522 dur: 44
1674652263
Searching: 32 space, batch 13 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 14 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 19 of 32 with 27 bits of 134217728 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 23399 dur: 67
2610744987
Searching: 32 space, batch 20 of 32 with 27 bits of 134217728 threads
...
Searching: 32 space, batch 32 of 32 with 27 bits of 134217728 threads
last number: 4294967296
completed: 112837

@obriensystems
Copy link
Member Author

14900K c

michael@14900c MINGW64 /c/wse_github/obrienlabsdev/performance/cpu/virtual/multithreaded/java-benchmark-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 32 with 27 bits of 134217728 threads
m0: 89128959 p: 223 m: 592753348168 ms: 1876 dur: 1
mp: 89128959 p: 223 m: 592753348168 ms: 0 dur: 1
mp: 44040192 p: 28 m: 64 ms: 1876 dur: 1
mp: 22020123 p: 296 m: 4887016576 ms: 0 dur: 1
mp: 89128991 p: 311 m: 4878630160 ms: 15 dur: 1
m0: 122683391 p: 350 m: 815907549832 ms: 0 dur: 1
m0: 77594623 p: 241 m: 14123284673092 ms: 0 dur: 1
mp: 122683391 p: 350 m: 815907549832 ms: 0 dur: 1
mp: 69206015 p: 352 m: 12596443086868 ms: 0 dur: 1
mp: 48234537 p: 367 m: 7136592640 ms: 0 dur: 1
mp: 111149110 p: 381 m: 16669551976 ms: 0 dur: 1
mp: 60817519 p: 618 m: 527067306664 ms: 0 dur: 1
mp: 55574555 p: 380 m: 16669551976 ms: 0 dur: 1
mp: 89131711 p: 678 m: 55688506648 ms: 0 dur: 1
m0: 97518969 p: 505 m: 55458724036804 ms: 0 dur: 1
mp: 76549223 p: 683 m: 38696262922132 ms: 16 dur: 1
m0: 97540219 p: 474 m: 80058454336744 ms: 15 dur: 1
m0: 119606763 p: 275 m: 94259207953024 ms: 16 dur: 1
mp: 55644487 p: 698 m: 55688506648 ms: 16 dur: 1
mp: 128081150 p: 738 m: 7209046267252 ms: 0 dur: 1
m0: 44186399 p: 602 m: 306296925203752 ms: 15 dur: 1
m0: 111296127 p: 469 m: 421482397464772 ms: 0 dur: 1
m0: 120074087 p: 570 m: 2185143829170100 ms: 94 dur: 2
m0: 120080895 p: 438 m: 3277901576118580 ms: 16 dur: 2
mp: 98110761 p: 748 m: 159424614880 ms: 16 dur: 2
mp: 129015023 p: 795 m: 3177300945976 ms: 125 dur: 2
mp: 129177577 p: 813 m: 825525149213608 ms: 31 dur: 2
mp: 127456254 p: 950 m: 966616035460 ms: 422 dur: 2
22020123
44040192
44186399
48234537
55574555
55644487
60817519
69206015
76549223
77594623
89128959
89128991
89131711
97518969
97540219
98110761
111149110
111296127
119606763
120074087
120080895
122683391
127456254
128081150
129015023
129177577
Searching: 32 space, batch 1 of 32 with 27 bits of 134217728 threads
m0: 254134431 p: 359 m: 6166418237244088 ms: 3016 dur: 5
mp: 254912508 p: 951 m: 966616035460 ms: 250 dur: 5
m0: 246666523 p: 514 m: 6404797161121264 ms: 16 dur: 5
mp: 226588897 p: 956 m: 966616035460 ms: 641 dur: 6
226588897
246666523
254134431
254912508
Searching: 32 space, batch 2 of 32 with 27 bits of 134217728 threads
m0: 380379879 p: 644 m: 11840694835853140 ms: 3000 dur: 9
m0: 379027947 p: 600 m: 1414236446719942480 ms: 470 dur: 10
mp: 302118529 p: 959 m: 966616035460 ms: 531 dur: 10
mp: 268549803 p: 964 m: 966616035460 ms: 0 dur: 10
268549803
302118529
379027947
380379879
Searching: 32 space, batch 3 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 4 of 32 with 27 bits of 134217728 threads
mp: 670617279 p: 986 m: 966616035460 ms: 6987 dur: 17
670617279
Searching: 32 space, batch 5 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 9 of 32 with 27 bits of 134217728 threads
mp: 1341234558 p: 987 m: 966616035460 ms: 18445 dur: 36
1341234558
Searching: 32 space, batch 10 of 32 with 27 bits of 134217728 threads
mp: 1412987847 p: 1000 m: 966616035460 ms: 2891 dur: 38
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 875 dur: 39
1410123943
1412987847
Searching: 32 space, batch 11 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 12 of 32 with 27 bits of 134217728 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 7536 dur: 47
1674652263
Searching: 32 space, batch 13 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 19 of 32 with 27 bits of 134217728 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 24667 dur: 72
2610744987
Searching: 32 space, batch 20 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 32 of 32 with 27 bits of 134217728 threads
last number: 4294967296
completed: 121956


@obriensystems
Copy link
Member Author

p1gen6

micha@p1gen6 MINGW64 /c/wse_github/ObrienlabsDev/performance/cpu/virtual/multithreaded/java-benchmark-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 32 with 27 bits of 134217728 threads
m0: 89128959 p: 223 m: 592753348168 ms: 1919 dur: 1
mp: 89128959 p: 223 m: 592753348168 ms: 0 dur: 1
mp: 44040219 p: 297 m: 43983120040 ms: 0 dur: 1
mp: 89128991 p: 311 m: 4878630160 ms: 0 dur: 1
m0: 122683391 p: 350 m: 815907549832 ms: 1 dur: 1
mp: 122683391 p: 350 m: 815907549832 ms: 0 dur: 1
m0: 77594623 p: 241 m: 14123284673092 ms: 0 dur: 1
mp: 69206015 p: 352 m: 12596443086868 ms: 0 dur: 1
mp: 127926271 p: 402 m: 2299687327492 ms: 2 dur: 1
mp: 60817519 p: 618 m: 527067306664 ms: 4 dur: 1
m0: 97518969 p: 505 m: 55458724036804 ms: 7 dur: 1
mp: 89131711 p: 678 m: 55688506648 ms: 1 dur: 1
m0: 97540219 p: 474 m: 80058454336744 ms: 16 dur: 1
mp: 55644487 p: 698 m: 55688506648 ms: 27 dur: 1
m0: 44186399 p: 602 m: 306296925203752 ms: 33 dur: 2
mp: 128081150 p: 738 m: 7209046267252 ms: 12 dur: 2
m0: 111296127 p: 469 m: 421482397464772 ms: 9 dur: 2
m0: 68614369 p: 489 m: 474637698851092 ms: 122 dur: 2
mp: 98110761 p: 748 m: 159424614880 ms: 84 dur: 2
mp: 129015023 p: 795 m: 3177300945976 ms: 246 dur: 2
m0: 129177577 p: 813 m: 825525149213608 ms: 76 dur: 2
mp: 129177577 p: 813 m: 825525149213608 ms: 0 dur: 2
mp: 127456254 p: 950 m: 966616035460 ms: 680 dur: 3
m0: 80049391 p: 572 m: 2185143829170100 ms: 397 dur: 3
m0: 120080895 p: 438 m: 3277901576118580 ms: 642 dur: 4
44040219
44186399
55644487
60817519
68614369
69206015
77594623
80049391
89128959
89128991
89131711
97518969
97540219
98110761
111296127
120080895
122683391
127456254
127926271
128081150
129015023
129177577
Searching: 32 space, batch 1 of 32 with 27 bits of 134217728 threads
mp: 226588897 p: 956 m: 966616035460 ms: 3793 dur: 8
m0: 246666523 p: 514 m: 6404797161121264 ms: 47 dur: 8
226588897
246666523
Searching: 32 space, batch 2 of 32 with 27 bits of 134217728 threads
m0: 379027947 p: 600 m: 1414236446719942480 ms: 5476 dur: 13
mp: 268549803 p: 964 m: 966616035460 ms: 990 dur: 14
268549803
379027947
Searching: 32 space, batch 3 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 4 of 32 with 27 bits of 134217728 threads
mp: 670617279 p: 986 m: 966616035460 ms: 12289 dur: 26
670617279
Searching: 32 space, batch 5 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 6 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 7 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 8 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 9 of 32 with 27 bits of 134217728 threads
mp: 1341234558 p: 987 m: 966616035460 ms: 31842 dur: 58
1341234558
Searching: 32 space, batch 10 of 32 with 27 bits of 134217728 threads
mp: 1412987847 p: 1000 m: 966616035460 ms: 8278 dur: 66
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 220 dur: 67
1410123943
1412987847
Searching: 32 space, batch 11 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 12 of 32 with 27 bits of 134217728 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 11591 dur: 78
1674652263
Searching: 32 space, batch 13 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 19 of 32 with 27 bits of 134217728 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 46491 dur: 125
2610744987
Searching: 32 space, batch 20 of 32 with 27 bits of 134217728 threads
..
Searching: 32 space, batch 32 of 32 with 27 bits of 134217728 threads
last number: 4294967296
completed: 217692

@obriensystems
Copy link
Member Author

I forgot to sequence by 2 (1,3,5) currently my LongStream is 1,2,3,4,5

obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
@obriensystems
Copy link
Member Author

obriensystems commented Jan 2, 2025

m4max - with odd optimization i forgot

			List<Long> oddNumbers = LongStream
					.range(1L + (part * threads), ((1 + part) * threads) - 1)
-->					.filter(x -> x % 2 != 0) // TODO: find a way to avoid this filter using range above
					.boxed()
					.collect(Collectors.toList());
			
			// filter on max value or path
			List<Long> results = oddNumbers
				.parallelStream()
				.filter(num -> isCollatzMax(num.longValue(), secondsStart))
				.collect(Collectors.toList());

Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 32 with 27 bits of 134217728 threads
m0: 88080383 p: 298 m: 1318004503576 ms: 626 dur: 0
m0: 20971519 p: 451 m: 1719636322696 ms: 626 dur: 0
mp: 20971519 p: 451 m: 1719636322696 ms: 0 dur: 0
mp: 88080383 p: 298 m: 1318004503576 ms: 0 dur: 0
m0: 60817407 p: 282 m: 2216420149480 ms: 0 dur: 0
mp: 56623103 p: 468 m: 564859072960 ms: 0 dur: 0
m0: 62914559 p: 287 m: 5089471954288 ms: 0 dur: 0
mp: 37748735 p: 470 m: 564859072960 ms: 0 dur: 0
m0: 77594623 p: 241 m: 14123284673092 ms: 1 dur: 0
mp: 62914587 p: 569 m: 358601694532 ms: 0 dur: 0
mp: 121635039 p: 619 m: 527067306664 ms: 0 dur: 0
mp: 60817519 p: 618 m: 527067306664 ms: 0 dur: 0
m0: 60833791 p: 437 m: 15980548268644 ms: 11 dur: 0
mp: 62932765 p: 706 m: 159424614880 ms: 1 dur: 0
m0: 111162815 p: 482 m: 18731239518112 ms: 2 dur: 0
m0: 37769471 p: 563 m: 60342610919632 ms: 0 dur: 0
m0: 29457599 p: 604 m: 306296925203752 ms: 40 dur: 0
m0: 111296127 p: 469 m: 421482397464772 ms: 4 dur: 0
mp: 63101607 p: 737 m: 2916597734800 ms: 11 dur: 0
mp: 56924955 p: 742 m: 7209046267252 ms: 9 dur: 0
m0: 121981103 p: 495 m: 474637698851092 ms: 18 dur: 0
mp: 63728127 p: 949 m: 966616035460 ms: 58 dur: 0
m0: 120074087 p: 570 m: 2185143829170100 ms: 263 dur: 1
m0: 120080895 p: 438 m: 3277901576118580 ms: 1 dur: 1
mp: 127456255 p: 950 m: 966616035460 ms: 468 dur: 1
20971519
29457599
37748735
37769471
56623103
56924955
60817407
60817519
60833791
62914559
62914587
62932765
63101607
63728127
77594623
88080383
111162815
111296127
120074087
120080895
121635039
121981103
127456255
Searching: 32 space, batch 1 of 32 with 27 bits of 134217728 threads
mp: 169941673 p: 953 m: 966616035460 ms: 1089 dur: 2
m0: 246666523 p: 514 m: 6404797161121264 ms: 553 dur: 3
mp: 226588897 p: 956 m: 966616035460 ms: 132 dur: 3
169941673
226588897
246666523
Searching: 32 space, batch 2 of 32 with 27 bits of 134217728 threads
m0: 380379879 p: 644 m: 11840694835853140 ms: 1350 dur: 4
mp: 268549803 p: 964 m: 966616035460 ms: 213 dur: 4
m0: 379027947 p: 600 m: 1414236446719942480 ms: 225 dur: 5
268549803
379027947
380379879
Searching: 32 space, batch 3 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 4 of 32 with 27 bits of 134217728 threads
mp: 537099607 p: 965 m: 966616035460 ms: 4213 dur: 9
mp: 670617279 p: 986 m: 966616035460 ms: 254 dur: 9
537099607
670617279
Searching: 32 space, batch 5 of 32 with 27 bits of 134217728 threads
...
Searching: 32 space, batch 9 of 32 with 27 bits of 134217728 threads
mp: 1341234559 p: 987 m: 966616035460 ms: 9065 dur: 18
1341234559
Searching: 32 space, batch 10 of 32 with 27 bits of 134217728 threads
mp: 1412987847 p: 1000 m: 966616035460 ms: 2482 dur: 21
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 197 dur: 21
1410123943
1412987847
Searching: 32 space, batch 11 of 32 with 27 bits of 134217728 threads
Searching: 32 space, batch 12 of 32 with 27 bits of 134217728 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 3956 dur: 25
1674652263
Searching: 32 space, batch 13 of 32 with 27 bits of 134217728 threads
...
Searching: 32 space, batch 19 of 32 with 27 bits of 134217728 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 13359 dur: 38
2610744987
Searching: 32 space, batch 20 of 32 with 27 bits of 134217728 threads
...
Searching: 32 space, batch 32 of 32 with 27 bits of 134217728 threads
last number: 4294967296
completed: 66508

@obriensystems
Copy link
Member Author

obriensystems commented Jan 2, 2025

5 bit batch on left, 4 bit batch on right
Screenshot 2025-01-01 at 20 36 07

optimize batch - M4max

  • 2 - heap error
  • 3 - 73 sec
  • 4 - 66 sec
  • 5 - 65 sec
  • 6 -
  • 7 -
  • 8 -

obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
@obriensystems
Copy link
Member Author

13900k a 32 cores
59 sec on 8 batch

micha@13900a MINGW64 /c/wse_github/obrienlabsdev/performance/cpu/virtual/multithreaded/java-benchmark-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 256 with 24 bits of 16777216 threads
m0: 11141119 p: 295 m: 83355939592 ms: 147 dur: 0
mp: 5505023 p: 338 m: 46336095844 ms: 147 dur: 0
mp: 5505149 p: 356 m: 2482111348 ms: 1 dur: 0
m0: 9699327 p: 331 m: 139646736808 ms: 0 dur: 0
mp: 12189857 p: 365 m: 562978024 ms: 6 dur: 0
mp: 9699431 p: 481 m: 6384303520 ms: 8 dur: 0
m0: 8388607 p: 473 m: 188286357652 ms: 3 dur: 0
m0: 6030015 p: 364 m: 375899359876 ms: 3 dur: 0
m0: 13238271 p: 515 m: 2287187077984 ms: 0 dur: 0
mp: 9306815 p: 530 m: 106094323636 ms: 1 dur: 0
mp: 12191171 p: 564 m: 125218704148 ms: 1 dur: 0
mp: 8127447 p: 566 m: 125218704148 ms: 1 dur: 0
m0: 8393215 p: 566 m: 60342610919632 ms: 5 dur: 0
mp: 11153577 p: 582 m: 4763430340 ms: 7 dur: 0
mp: 8397953 p: 592 m: 294475592320 ms: 6 dur: 0
mp: 8400511 p: 685 m: 159424614880 ms: 4 dur: 0
mp: 11200681 p: 688 m: 159424614880 ms: 17 dur: 0
mp: 15733191 p: 704 m: 159424614880 ms: 116 dur: 0
5505023
5505149
6030015
8127447
8388607
8393215
8397953
8400511
9306815
9699327
9699431
11141119
11153577
11200681
12189857
12191171
13238271
15733191
Searching: 32 space, batch 1 of 256 with 24 bits of 16777216 threads
m0: 19638399 p: 606 m: 306296925203752 ms: 205 dur: 0
mp: 31466383 p: 705 m: 159424614880 ms: 60 dur: 0
19638399
31466383
Searching: 32 space, batch 2 of 256 with 24 bits of 16777216 threads
mp: 41955177 p: 708 m: 159424614880 ms: 217 dur: 0
mp: 46564287 p: 734 m: 159424614880 ms: 17 dur: 0
m0: 38595583 p: 483 m: 474637698851092 ms: 55 dur: 0
mp: 36791535 p: 744 m: 159424614880 ms: 6 dur: 0
36791535
38595583
41955177
46564287
Searching: 32 space, batch 3 of 256 with 24 bits of 16777216 threads
mp: 63728127 p: 949 m: 966616035460 ms: 225 dur: 1
63728127
Searching: 32 space, batch 4 of 256 with 24 bits of 16777216 threads
m0: 80049391 p: 572 m: 2185143829170100 ms: 165 dur: 1
80049391
Searching: 32 space, batch 5 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 6 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 7 of 256 with 24 bits of 16777216 threads
m0: 120080895 p: 438 m: 3277901576118580 ms: 716 dur: 1
mp: 127456255 p: 950 m: 966616035460 ms: 66 dur: 2
120080895
127456255
Searching: 32 space, batch 8 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 9 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 10 of 256 with 24 bits of 16777216 threads
mp: 169941673 p: 953 m: 966616035460 ms: 668 dur: 2
169941673
Searching: 32 space, batch 11 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 12 of 256 with 24 bits of 16777216 threads
m0: 210964383 p: 475 m: 6404797161121264 ms: 471 dur: 3
210964383
Searching: 32 space, batch 13 of 256 with 24 bits of 16777216 threads
mp: 226588897 p: 956 m: 966616035460 ms: 288 dur: 3
226588897
Searching: 32 space, batch 14 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 15 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 16 of 256 with 24 bits of 16777216 threads
mp: 268549803 p: 964 m: 966616035460 ms: 687 dur: 4
268549803
Searching: 32 space, batch 17 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 18 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 19 of 256 with 24 bits of 16777216 threads
m0: 335227327 p: 605 m: 28206742763994640 ms: 635 dur: 4
m0: 319804831 p: 592 m: 1414236446719942480 ms: 101 dur: 4
319804831
335227327
Searching: 32 space, batch 20 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 21 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 22 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 23 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 24 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 25 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 26 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 27 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 28 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 29 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 30 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 31 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 32 of 256 with 24 bits of 16777216 threads
mp: 537099607 p: 965 m: 966616035460 ms: 3038 dur: 7
537099607
Searching: 32 space, batch 33 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 34 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 35 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 36 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 37 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 38 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 39 of 256 with 24 bits of 16777216 threads
mp: 670617279 p: 986 m: 966616035460 ms: 1658 dur: 9
670617279
Searching: 32 space, batch 40 of 256 with 24 bits of 16777216 threads
..
Searching: 32 space, batch 79 of 256 with 24 bits of 16777216 threads
mp: 1341234559 p: 987 m: 966616035460 ms: 8928 dur: 18
1341234559
Searching: 32 space, batch 80 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 81 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 82 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 83 of 256 with 24 bits of 16777216 threads
Searching: 32 space, batch 84 of 256 with 24 bits of 16777216 threads
mp: 1412987847 p: 1000 m: 966616035460 ms: 1297 dur: 19
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 12 dur: 19
1410123943
1412987847
Searching: 32 space, batch 85 of 256 with 24 bits of 16777216 threads
..
Searching: 32 space, batch 99 of 256 with 24 bits of 16777216 threads
mp: 1674652263 p: 1008 m: 966616035460 ms: 3327 dur: 23
1674652263
Searching: 32 space, batch 100 of 256 with 24 bits of 16777216 threads
...
Searching: 32 space, batch 155 of 256 with 24 bits of 16777216 threads
mp: 2610744987 p: 1050 m: 966616035460 ms: 12604 dur: 35
2610744987
Searching: 32 space, batch 156 of 256 with 24 bits of 16777216 threads
...
Searching: 32 space, batch 256 of 256 with 24 bits of 16777216 threads
last number: 4294967296
completed: 59118


on 10 bit

micha@13900a MINGW64 /c/wse_github/obrienlabsdev/performance/cpu/virtual/multithreaded/java-benchmark-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 1024 with 22 bits of 4194304 threads
mp: 688129 p: 198 m: 2064388 ms: 42 dur: 0
mp: 1474743 p: 380 m: 60669160 ms: 1 dur: 0
mp: 3735551 p: 340 m: 4907326192 ms: 61 dur: 0
mp: 1081343 p: 346 m: 947027860 ms: 61 dur: 0
mp: 2949485 p: 381 m: 60669160 ms: 2 dur: 0
mp: 327683 p: 259 m: 1474576 ms: 61 dur: 0
mp: 1376255 p: 137 m: 1807962280 ms: 42 dur: 0
mp: 3310013 p: 420 m: 72553696 ms: 0 dur: 0
m0: 3833855 p: 309 m: 3777349768 ms: 42 dur: 0
m0: 2785279 p: 213 m: 2744228464 ms: 41 dur: 0
mp: 1343559 p: 367 m: 62897848 ms: 66 dur: 0
mp: 3047423 p: 288 m: 12825169396 ms: 61 dur: 0
m0: 2424831 p: 329 m: 139646736808 ms: 43 dur: 0
mp: 1114177 p: 315 m: 11003416 ms: 61 dur: 0
mp: 1900543 p: 246 m: 2496709816 ms: 43 dur: 0
mp: 3736191 p: 446 m: 15971711920 ms: 8 dur: 0
mp: 3835183 p: 490 m: 76778008 ms: 1 dur: 0
mp: 1345383 p: 504 m: 8627004772 ms: 0 dur: 0
mp: 1117065 p: 527 m: 2974984576 ms: 1 dur: 0
m0: 3905863 p: 459 m: 144286791856 ms: 2 dur: 0
m0: 4000767 p: 229 m: 262742413984 ms: 3 dur: 0
m0: 3219199 p: 376 m: 422828990512 ms: 0 dur: 0
mp: 4003609 p: 534 m: 90239155648 ms: 25 dur: 0
mp: 3064033 p: 562 m: 46571871940 ms: 1 dur: 0
mp: 4063723 p: 565 m: 125218704148 ms: 2 dur: 0
m0: 3873535 p: 322 m: 858555169576 ms: 5 dur: 0
mp: 3732423 p: 596 m: 294475592320 ms: 14 dur: 0
327683
688129
1081343
1114177
1117065
1343559
1345383
1376255
1474743
1900543
2424831
2785279
2949485
3047423
3064033
3219199
3310013
3732423
3735551
3736191
3833855
3835183
3873535
3905863
4000767
4003609
4063723
m0: 5217727 p: 568 m: 1318802294932 ms: 80 dur: 0
mp: 6674175 p: 620 m: 125218704148 ms: 1 dur: 0
m0: 6631675 p: 576 m: 60342610919632 ms: 81 dur: 0
mp: 6649279 p: 664 m: 15208728208 ms: 3 dur: 0
5217727
6631675
6649279
6674175
mp: 8865705 p: 667 m: 15208728208 ms: 31 dur: 0
mp: 11200681 p: 688 m: 159424614880 ms: 4 dur: 0
8865705
11200681
mp: 14934241 p: 691 m: 159424614880 ms: 64 dur: 0
mp: 15733191 p: 704 m: 159424614880 ms: 67 dur: 0
14934241
15733191
m0: 19638399 p: 606 m: 306296925203752 ms: 43 dur: 0
19638399
mp: 31466383 p: 705 m: 159424614880 ms: 152 dur: 0
31466383
mp: 36791535 p: 744 m: 159424614880 ms: 59 dur: 0
36791535
m0: 38595583 p: 483 m: 474637698851092 ms: 49 dur: 0
38595583
mp: 63728127 p: 949 m: 966616035460 ms: 281 dur: 0
63728127
m0: 80049391 p: 572 m: 2185143829170100 ms: 195 dur: 1
80049391
m0: 120080895 p: 438 m: 3277901576118580 ms: 454 dur: 1
120080895
mp: 127456255 p: 950 m: 966616035460 ms: 115 dur: 1
127456255
mp: 169941673 p: 953 m: 966616035460 ms: 439 dur: 2
169941673
m0: 210964383 p: 475 m: 6404797161121264 ms: 617 dur: 2
210964383
mp: 226588897 p: 956 m: 966616035460 ms: 166 dur: 2
226588897
mp: 268549803 p: 964 m: 966616035460 ms: 477 dur: 3
268549803
m0: 319804831 p: 592 m: 1414236446719942480 ms: 608 dur: 4
319804831
mp: 537099607 p: 965 m: 966616035460 ms: 2698 dur: 6
537099607
mp: 670617279 p: 986 m: 966616035460 ms: 1662 dur: 8
670617279
mp: 1341234559 p: 987 m: 966616035460 ms: 8088 dur: 16
1341234559
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 811 dur: 17
mp: 1412987847 p: 1000 m: 966616035460 ms: 10 dur: 17
1410123943
1412987847
mp: 1674652263 p: 1008 m: 966616035460 ms: 3147 dur: 20
1674652263
mp: 2610744987 p: 1050 m: 966616035460 ms: 11153 dur: 31
2610744987
last number: 4294967296
completed: 52070


obriensystems added a commit that referenced this issue Jan 2, 2025
@obriensystems
Copy link
Member Author

batch 12 14900K 24 of 32 threads

michael@14900c MINGW64 /c/wse_github/obrienlabsdev/performance/cpu/virtual/multithreaded/java-benchmark-cli/performance-nbi (main)
$ java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 4096 with 20 bits of 1048576 threads
m0: 565247 p: 327 m: 24414590536 ms: 31 dur: 0
m0: 606207 p: 327 m: 699811540 ms: 31 dur: 0
mp: 172033 p: 152 m: 516100 ms: 15 dur: 0
mp: 868447 p: 338 m: 396067480 ms: 32 dur: 0
mp: 507903 p: 363 m: 333612088 ms: 32 dur: 0
mp: 344063 p: 135 m: 200884696 ms: 15 dur: 0
m0: 696319 p: 110 m: 457371412 ms: 15 dur: 0
mp: 376831 p: 329 m: 24414590536 ms: 31 dur: 0
m0: 958463 p: 126 m: 629558296 ms: 31 dur: 0
mp: 336199 p: 365 m: 229993504 ms: 0 dur: 0
mp: 934299 p: 413 m: 10934728 ms: 0 dur: 0
mp: 1000479 p: 426 m: 854564416 ms: 0 dur: 0
mp: 345947 p: 440 m: 76778008 ms: 0 dur: 0
m0: 640641 p: 415 m: 24648077896 ms: 0 dur: 0
mp: 1003263 p: 488 m: 7222283188 ms: 0 dur: 0
mp: 939497 p: 506 m: 7222283188 ms: 16 dur: 0
m0: 704511 p: 242 m: 56991483520 ms: 0 dur: 0
m0: 1042431 p: 439 m: 90239155648 ms: 0 dur: 0
mp: 837799 p: 524 m: 2974984576 ms: 15 dur: 0
172033
336199
344063
345947
376831
507903
565247
606207
640641
696319
704511
837799
868447
934299
939497
958463
1000479
1003263
1042431
m0: 1616553 p: 331 m: 139646736808 ms: 16 dur: 0
mp: 1564063 p: 530 m: 7222283188 ms: 0 dur: 0
m0: 1875711 p: 370 m: 155904349696 ms: 0 dur: 0
m0: 1988859 p: 427 m: 156914378224 ms: 16 dur: 0
mp: 1723519 p: 556 m: 46571871940 ms: 0 dur: 0
1564063
1616553
1723519
1875711
1988859
m0: 2643183 p: 430 m: 190459818484 ms: 0 dur: 0
m0: 2684647 p: 399 m: 352617812944 ms: 0 dur: 0
mp: 3064033 p: 562 m: 46571871940 ms: 0 dur: 0
m0: 3041127 p: 363 m: 622717901620 ms: 0 dur: 0
2643183
2684647
3041127
3064033
mp: 3732423 p: 596 m: 294475592320 ms: 15 dur: 0
m0: 3873535 p: 322 m: 858555169576 ms: 0 dur: 0
3732423
3873535
m0: 4637979 p: 573 m: 1318802294932 ms: 16 dur: 0
4637979
m0: 5656191 p: 400 m: 2412493616608 ms: 0 dur: 0
mp: 5649499 p: 612 m: 1017886660 ms: 0 dur: 0
5649499
5656191
mp: 7332399 p: 615 m: 150311737960 ms: 16 dur: 0
mp: 6649279 p: 664 m: 15208728208 ms: 0 dur: 0
m0: 6631675 p: 576 m: 60342610919632 ms: 0 dur: 0
6631675
6649279
7332399
mp: 8865705 p: 667 m: 15208728208 ms: 31 dur: 0
mp: 8400511 p: 685 m: 159424614880 ms: 0 dur: 0
8400511
8865705
mp: 11200681 p: 688 m: 159424614880 ms: 15 dur: 0
11200681
mp: 14934241 p: 691 m: 159424614880 ms: 47 dur: 0
14934241
mp: 15733191 p: 704 m: 159424614880 ms: 16 dur: 0
15733191
m0: 19638399 p: 606 m: 306296925203752 ms: 31 dur: 0
19638399
mp: 31466383 p: 705 m: 159424614880 ms: 151 dur: 0
31466383
mp: 36791535 p: 744 m: 159424614880 ms: 63 dur: 0
36791535
m0: 38595583 p: 483 m: 474637698851092 ms: 16 dur: 0
38595583
mp: 63728127 p: 949 m: 966616035460 ms: 296 dur: 0
63728127
m0: 80049391 p: 572 m: 2185143829170100 ms: 204 dur: 1
80049391
m0: 120080895 p: 438 m: 3277901576118580 ms: 375 dur: 1
120080895
mp: 127456255 p: 950 m: 966616035460 ms: 62 dur: 1
127456255
mp: 169941673 p: 953 m: 966616035460 ms: 434 dur: 1
169941673
m0: 210964383 p: 475 m: 6404797161121264 ms: 395 dur: 2
210964383
mp: 226588897 p: 956 m: 966616035460 ms: 140 dur: 2
226588897
mp: 268549803 p: 964 m: 966616035460 ms: 423 dur: 2
268549803
m0: 319804831 p: 592 m: 1414236446719942480 ms: 483 dur: 3
319804831
mp: 537099607 p: 965 m: 966616035460 ms: 2141 dur: 5
537099607
mp: 670617279 p: 986 m: 966616035460 ms: 1312 dur: 6
670617279
mp: 1341234559 p: 987 m: 966616035460 ms: 6735 dur: 13
1341234559
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 687 dur: 14
1410123943
mp: 1412987847 p: 1000 m: 966616035460 ms: 32 dur: 14
1412987847
mp: 1674652263 p: 1008 m: 966616035460 ms: 2656 dur: 16
1674652263
mp: 2610744987 p: 1050 m: 966616035460 ms: 9547 dur: 26
2610744987
last number: 4294967296
completed: 43783

@obriensystems
Copy link
Member Author

macbook m4max 12 bit batch

Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 4096 with 20 bits of 1048576 threads
m0: 459035 p: 275 m: 2512193776 ms: 22 dur: 0
mp: 507903 p: 363 m: 333612088 ms: 22 dur: 0
mp: 409627 p: 205 m: 6998884 ms: 21 dur: 0
mp: 163839 p: 196 m: 161425204 ms: 21 dur: 0
m0: 950271 p: 245 m: 2106598912 ms: 22 dur: 0
mp: 425985 p: 311 m: 3155092 ms: 21 dur: 0
m0: 688127 p: 136 m: 677985856 ms: 21 dur: 0
m0: 442367 p: 218 m: 1570824736 ms: 21 dur: 0
mp: 81919 p: 288 m: 47829688 ms: 21 dur: 0
m0: 491971 p: 169 m: 2798323360 ms: 23 dur: 0
mp: 475191 p: 306 m: 7706824 ms: 21 dur: 0
mp: 869467 p: 387 m: 76394644 ms: 1 dur: 0
mp: 410011 p: 448 m: 76778008 ms: 1 dur: 0
m0: 870171 p: 237 m: 3255240148 ms: 0 dur: 0
m0: 459759 p: 213 m: 6973568800 ms: 0 dur: 0
m0: 608111 p: 402 m: 24648077896 ms: 0 dur: 0
mp: 511935 p: 469 m: 76778008 ms: 2 dur: 0
m0: 704511 p: 242 m: 56991483520 ms: 6 dur: 0
mp: 704623 p: 503 m: 7222283188 ms: 0 dur: 0
mp: 939497 p: 506 m: 7222283188 ms: 8 dur: 0
mp: 837799 p: 524 m: 2974984576 ms: 1 dur: 0
m0: 1042431 p: 439 m: 90239155648 ms: 3 dur: 0
81919
163839
409627
410011
425985
442367
459035
459759
475191
491971
507903
511935
608111
688127
704511
704623
837799
869467
870171
939497
950271
1042431
m0: 1212415 p: 328 m: 139646736808 ms: 7 dur: 0
mp: 1564063 p: 530 m: 7222283188 ms: 2 dur: 0
mp: 2085417 p: 533 m: 7222283188 ms: 5 dur: 0
mp: 1723519 p: 556 m: 46571871940 ms: 1 dur: 0
m0: 1441407 p: 367 m: 151629574372 ms: 3 dur: 0
m0: 1988859 p: 427 m: 156914378224 ms: 0 dur: 0
1212415
1441407
1564063
1723519
1988859
2085417
m0: 2643183 p: 430 m: 190459818484 ms: 9 dur: 0
mp: 3064033 p: 562 m: 46571871940 ms: 1 dur: 0
m0: 2684647 p: 399 m: 352617812944 ms: 2 dur: 0
m0: 3041127 p: 363 m: 622717901620 ms: 1 dur: 0
2643183
2684647
3041127
3064033
mp: 3732423 p: 596 m: 294475592320 ms: 11 dur: 0
m0: 3873535 p: 322 m: 858555169576 ms: 2 dur: 0
3732423
3873535
m0: 5217727 p: 568 m: 1318802294932 ms: 8 dur: 0
5217727
m0: 5656191 p: 400 m: 2412493616608 ms: 19 dur: 0
mp: 5649499 p: 612 m: 1017886660 ms: 2 dur: 0
5649499
5656191
mp: 6674175 p: 620 m: 125218704148 ms: 6 dur: 0
mp: 6649279 p: 664 m: 15208728208 ms: 1 dur: 0
m0: 7202815 p: 284 m: 6727544495440 ms: 3 dur: 0
m0: 6631675 p: 576 m: 60342610919632 ms: 1 dur: 0
6631675
6649279
6674175
7202815
mp: 8865705 p: 667 m: 15208728208 ms: 20 dur: 0
mp: 8400511 p: 685 m: 159424614880 ms: 7 dur: 0
8400511
8865705
mp: 11200681 p: 688 m: 159424614880 ms: 21 dur: 0
11200681
mp: 14934241 p: 691 m: 159424614880 ms: 57 dur: 0
14934241
mp: 15733191 p: 704 m: 159424614880 ms: 9 dur: 0
15733191
m0: 19638399 p: 606 m: 306296925203752 ms: 36 dur: 0
19638399
mp: 31466383 p: 705 m: 159424614880 ms: 152 dur: 0
31466383
mp: 36791535 p: 744 m: 159424614880 ms: 63 dur: 0
36791535
m0: 38595583 p: 483 m: 474637698851092 ms: 16 dur: 0
38595583
mp: 63728127 p: 949 m: 966616035460 ms: 296 dur: 0
63728127
m0: 80049391 p: 572 m: 2185143829170100 ms: 188 dur: 1
80049391
m0: 120080895 p: 438 m: 3277901576118580 ms: 476 dur: 1
120080895
mp: 127456255 p: 950 m: 966616035460 ms: 83 dur: 1
127456255
mp: 169941673 p: 953 m: 966616035460 ms: 510 dur: 2
169941673
m0: 210964383 p: 475 m: 6404797161121264 ms: 480 dur: 2
210964383
mp: 226588897 p: 956 m: 966616035460 ms: 186 dur: 2
226588897
mp: 268549803 p: 964 m: 966616035460 ms: 511 dur: 3
268549803
m0: 319804831 p: 592 m: 1414236446719942480 ms: 606 dur: 3
319804831
mp: 537099607 p: 965 m: 966616035460 ms: 2709 dur: 6
537099607
mp: 670617279 p: 986 m: 966616035460 ms: 1642 dur: 8
670617279
mp: 1341234559 p: 987 m: 966616035460 ms: 8396 dur: 16
1341234559
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 865 dur: 17
1410123943
mp: 1412987847 p: 1000 m: 966616035460 ms: 37 dur: 17
1412987847
mp: 1674652263 p: 1008 m: 966616035460 ms: 3322 dur: 20
1674652263
mp: 2610744987 p: 1050 m: 966616035460 ms: 11909 dur: 32
2610744987
last number: 4294967296
completed: 54416

obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
obriensystems added a commit that referenced this issue Jan 2, 2025
@obriensystems obriensystems changed the title 64 bit collatz multi threaded implementation in Java 64 bit collatz multithreaded implementation in Java Jan 2, 2025
@obriensystems
Copy link
Member Author

Move code to #10

@obriensystems
Copy link
Member Author

see also #24

@obriensystems
Copy link
Member Author

obriensystems commented Jan 3, 2025

m4pro 8p4e 10 batch

948 cpu out of 1200

mini08 performance-nbi % java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
Searching: 32 space, batch 0 of 4096 with 20 bits of 1048576 threads
mp: 344219 p: 259 m: 76394644 ms: 23 dur: 0
mp: 507903 p: 363 m: 333612088 ms: 23 dur: 0
mp: 163839 p: 196 m: 161425204 ms: 20 dur: 0
m0: 294911 p: 220 m: 1570824736 ms: 23 dur: 0
m0: 491971 p: 169 m: 2798323360 ms: 24 dur: 0
mp: 950943 p: 413 m: 24371656 ms: 26 dur: 0
mp: 475161 p: 244 m: 1603672 ms: 20 dur: 0
m0: 459035 p: 275 m: 2512193776 ms: 24 dur: 0
m0: 688127 p: 136 m: 677985856 ms: 20 dur: 0
mp: 425985 p: 311 m: 3155092 ms: 23 dur: 0
m0: 459759 p: 213 m: 6973568800 ms: 0 dur: 0
mp: 230631 p: 442 m: 76778008 ms: 0 dur: 0
mp: 461263 p: 443 m: 76778008 ms: 2 dur: 0
m0: 478463 p: 182 m: 17202377752 ms: 1 dur: 0
m0: 480481 p: 412 m: 24648077896 ms: 1 dur: 0
mp: 511935 p: 469 m: 76778008 ms: 0 dur: 0
m0: 704511 p: 242 m: 56991483520 ms: 5 dur: 0
mp: 704623 p: 503 m: 7222283188 ms: 0 dur: 0
mp: 939497 p: 506 m: 7222283188 ms: 7 dur: 0
mp: 626331 p: 508 m: 7222283188 ms: 5 dur: 0
mp: 837799 p: 524 m: 2974984576 ms: 2 dur: 0
m0: 1042431 p: 439 m: 90239155648 ms: 0 dur: 0
163839
230631
294911
344219
425985
459035
459759
461263
475161
478463
480481
491971
507903
511935
626331
688127
704511
704623
837799
939497
950943
1042431
m0: 1212415 p: 328 m: 139646736808 ms: 9 dur: 0
mp: 1689023 p: 525 m: 90239155648 ms: 0 dur: 0
m0: 1875711 p: 370 m: 155904349696 ms: 2 dur: 0
mp: 1723519 p: 556 m: 46571871940 ms: 4 dur: 0
m0: 1988859 p: 427 m: 156914378224 ms: 3 dur: 0
1212415
1689023
1723519
1875711
1988859
mp: 3064033 p: 562 m: 46571871940 ms: 11 dur: 0
m0: 2684647 p: 399 m: 352617812944 ms: 1 dur: 0
m0: 3041127 p: 363 m: 622717901620 ms: 1 dur: 0
2684647
3041127
3064033
mp: 3542887 p: 583 m: 294475592320 ms: 18 dur: 0
mp: 3732423 p: 596 m: 294475592320 ms: 7 dur: 0
m0: 3873535 p: 322 m: 858555169576 ms: 0 dur: 0
3542887
3732423
3873535
m0: 4637979 p: 573 m: 1318802294932 ms: 9 dur: 0
4637979
m0: 5656191 p: 400 m: 2412493616608 ms: 23 dur: 0
mp: 5649499 p: 612 m: 1017886660 ms: 1 dur: 0
5649499
5656191
mp: 6674175 p: 620 m: 125218704148 ms: 6 dur: 0
mp: 6649279 p: 664 m: 15208728208 ms: 0 dur: 0
m0: 6631675 p: 576 m: 60342610919632 ms: 1 dur: 0
6631675
6649279
6674175
mp: 8865705 p: 667 m: 15208728208 ms: 35 dur: 0
mp: 8400511 p: 685 m: 159424614880 ms: 12 dur: 0
8400511
8865705
mp: 11200681 p: 688 m: 159424614880 ms: 29 dur: 0
11200681
mp: 14934241 p: 691 m: 159424614880 ms: 75 dur: 0
14934241
mp: 15733191 p: 704 m: 159424614880 ms: 18 dur: 0
15733191
m0: 19638399 p: 606 m: 306296925203752 ms: 46 dur: 0
19638399
mp: 31466383 p: 705 m: 159424614880 ms: 208 dur: 0
31466383
mp: 36791535 p: 744 m: 159424614880 ms: 87 dur: 0
36791535
m0: 38595583 p: 483 m: 474637698851092 ms: 27 dur: 0
38595583
mp: 63728127 p: 949 m: 966616035460 ms: 430 dur: 1
63728127
m0: 80049391 p: 572 m: 2185143829170100 ms: 272 dur: 1
80049391
m0: 120080895 p: 438 m: 3277901576118580 ms: 702 dur: 2
120080895
mp: 127456255 p: 950 m: 966616035460 ms: 157 dur: 2
127456255
mp: 169941673 p: 953 m: 966616035460 ms: 724 dur: 2
169941673
m0: 210964383 p: 475 m: 6404797161121264 ms: 725 dur: 3
210964383
mp: 226588897 p: 956 m: 966616035460 ms: 272 dur: 3
226588897
mp: 268549803 p: 964 m: 966616035460 ms: 739 dur: 4
268549803
m0: 319804831 p: 592 m: 1414236446719942480 ms: 882 dur: 5
319804831
mp: 537099607 p: 965 m: 966616035460 ms: 3974 dur: 9
537099607
mp: 670617279 p: 986 m: 966616035460 ms: 2476 dur: 12
670617279
mp: 1341234559 p: 987 m: 966616035460 ms: 12376 dur: 24
1341234559
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 1269 dur: 25
1410123943
mp: 1412987847 p: 1000 m: 966616035460 ms: 54 dur: 25
1412987847
mp: 1674652263 p: 1008 m: 966616035460 ms: 4900 dur: 30
1674652263
mp: 2610744987 p: 1050 m: 966616035460 ms: 17610 dur: 48
2610744987
last number: 4294967296
completed: 80574



M4pro 14 batch
mini08 performance-nbi % java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
searching: 32 space, batch 0 of 16384 with 18 bits of 262144 threads
m0: 111259 p: 229 m: 197540368 ms: 19 dur: 0
mp: 118825 p: 317 m: 7234324 ms: 17 dur: 0
mp: 237567 p: 181 m: 104029576 ms: 17 dur: 0
m0: 73755 p: 293 m: 139841152 ms: 17 dur: 0
mp: 40959 p: 287 m: 40356304 ms: 17 dur: 0
mp: 106495 p: 309 m: 78694792 ms: 17 dur: 0
m0: 102567 p: 164 m: 182107816 ms: 18 dur: 0
m0: 172031 p: 134 m: 127122352 ms: 16 dur: 0
mp: 126975 p: 286 m: 55602016 ms: 17 dur: 0
mp: 237651 p: 318 m: 7234324 ms: 0 dur: 0
mp: 111451 p: 322 m: 9402640 ms: 0 dur: 0
mp: 86015 p: 164 m: 30578632 ms: 16 dur: 0
m0: 103561 p: 234 m: 1570824736 ms: 7 dur: 0
mp: 87087 p: 332 m: 1431736 ms: 0 dur: 0
mp: 239039 p: 349 m: 104674192 ms: 1 dur: 0
m0: 239231 p: 181 m: 17202377752 ms: 0 dur: 0
mp: 77031 p: 350 m: 21933016 ms: 2 dur: 0
mp: 240617 p: 367 m: 593279152 ms: 0 dur: 0
mp: 213881 p: 372 m: 593279152 ms: 2 dur: 0
mp: 216367 p: 385 m: 11843332 ms: 1 dur: 0
mp: 106239 p: 353 m: 104674192 ms: 2 dur: 0
mp: 230631 p: 442 m: 76778008 ms: 2 dur: 0
40959
73755
77031
86015
87087
102567
103561
106239
106495
111259
111451
118825
126975
172031
213881
216367
230631
237567
237651
239039
239231
240617
m0: 480481 p: 412 m: 24648077896 ms: 4 dur: 0
mp: 511935 p: 469 m: 76778008 ms: 1 dur: 0
480481
511935
mp: 626331 p: 508 m: 7222283188 ms: 8 dur: 0
m0: 665215 p: 441 m: 52483285312 ms: 0 dur: 0
m0: 704511 p: 242 m: 56991483520 ms: 1 dur: 0
626331
665215
704511
m0: 1042431 p: 439 m: 90239155648 ms: 2 dur: 0
mp: 837799 p: 524 m: 2974984576 ms: 1 dur: 0
837799
1042431
m0: 1212415 p: 328 m: 139646736808 ms: 5 dur: 0
mp: 1117065 p: 527 m: 2974984576 ms: 5 dur: 0
1117065
1212415
m0: 1441407 p: 367 m: 151629574372 ms: 2 dur: 0
mp: 1501353 p: 530 m: 90239155648 ms: 2 dur: 0
1441407
1501353
mp: 1723519 p: 556 m: 46571871940 ms: 3 dur: 0
1723519
m0: 1988859 p: 427 m: 156914378224 ms: 2 dur: 0
1988859
mp: 2298025 p: 559 m: 46571871940 ms: 5 dur: 0
2298025
m0: 2643183 p: 430 m: 190459818484 ms: 6 dur: 0
m0: 2684647 p: 399 m: 352617812944 ms: 2 dur: 0
2643183
2684647
m0: 3041127 p: 363 m: 622717901620 ms: 3 dur: 0
mp: 3064033 p: 562 m: 46571871940 ms: 1 dur: 0
3041127
3064033
mp: 3542887 p: 583 m: 294475592320 ms: 6 dur: 0
3542887
mp: 3732423 p: 596 m: 294475592320 ms: 5 dur: 0
m0: 3873535 p: 322 m: 858555169576 ms: 0 dur: 0
3732423
3873535
m0: 4637979 p: 573 m: 1318802294932 ms: 9 dur: 0
4637979
m0: 5656191 p: 400 m: 2412493616608 ms: 15 dur: 0
mp: 5649499 p: 612 m: 1017886660 ms: 1 dur: 0
5649499
5656191
m0: 6416623 p: 483 m: 4799996945368 ms: 10 dur: 0
6416623
mp: 6674175 p: 620 m: 125218704148 ms: 4 dur: 0
m0: 6631675 p: 576 m: 60342610919632 ms: 0 dur: 0
mp: 6649279 p: 664 m: 15208728208 ms: 0 dur: 0
6631675
6649279
6674175
mp: 8400511 p: 685 m: 159424614880 ms: 26 dur: 0
8400511
mp: 11200681 p: 688 m: 159424614880 ms: 33 dur: 0
11200681
mp: 14934241 p: 691 m: 159424614880 ms: 53 dur: 0
14934241
mp: 15733191 p: 704 m: 159424614880 ms: 14 dur: 0
15733191
m0: 19638399 p: 606 m: 306296925203752 ms: 51 dur: 0
19638399
mp: 31466383 p: 705 m: 159424614880 ms: 168 dur: 0
31466383
mp: 36791535 p: 744 m: 159424614880 ms: 70 dur: 0
36791535
m0: 38595583 p: 483 m: 474637698851092 ms: 26 dur: 0
38595583
mp: 63728127 p: 949 m: 966616035460 ms: 339 dur: 0
63728127
m0: 80049391 p: 572 m: 2185143829170100 ms: 221 dur: 1
80049391
m0: 120080895 p: 438 m: 3277901576118580 ms: 560 dur: 1
120080895
mp: 127456255 p: 950 m: 966616035460 ms: 104 dur: 1
127456255
mp: 169941673 p: 953 m: 966616035460 ms: 595 dur: 2
169941673
m0: 210964383 p: 475 m: 6404797161121264 ms: 588 dur: 2
210964383
mp: 226588897 p: 956 m: 966616035460 ms: 220 dur: 3
226588897
mp: 268549803 p: 964 m: 966616035460 ms: 601 dur: 3
268549803
m0: 319804831 p: 592 m: 1414236446719942480 ms: 741 dur: 4
319804831
mp: 537099607 p: 965 m: 966616035460 ms: 3178 dur: 7
537099607
mp: 670617279 p: 986 m: 966616035460 ms: 1979 dur: 9
670617279
mp: 1341234559 p: 987 m: 966616035460 ms: 10091 dur: 19
1341234559
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 1039 dur: 20
1410123943
mp: 1412987847 p: 1000 m: 966616035460 ms: 44 dur: 20
1412987847
mp: 1674652263 p: 1008 m: 966616035460 ms: 3981 dur: 24
1674652263
mp: 2610744987 p: 1050 m: 966616035460 ms: 14402 dur: 39
2610744987
last number: 4294967296
completed: 65427

8 batch
mini08 performance-nbi % java -cp target/performance-nbi-0.0.1-SNAPSHOT.jar dev.obrienlabs.performance.nbi.Collatz
Collatz multithreaded 2025 michael at obrienlabs.dev
searching: 32 space, batch 0 of 256 with 24 bits of 16777216 threads
mp: 4718715 p: 374 m: 183878584 ms: 109 dur: 0
mp: 2621439 p: 293 m: 13075441504 ms: 109 dur: 0
mp: 8126571 p: 367 m: 562978024 ms: 109 dur: 0
m0: 15204351 p: 280 m: 2216420149480 ms: 109 dur: 0
mp: 6553819 p: 452 m: 143656072 ms: 110 dur: 0
mp: 6818103 p: 496 m: 76778008 ms: 0 dur: 0
mp: 5505023 p: 338 m: 46336095844 ms: 109 dur: 0
m0: 11010047 p: 339 m: 61781461108 ms: 109 dur: 0
mp: 1310881 p: 385 m: 60669160 ms: 110 dur: 0
mp: 15204519 p: 523 m: 62407898116 ms: 6 dur: 0
mp: 8127447 p: 566 m: 125218704148 ms: 0 dur: 0
mp: 4723849 p: 586 m: 294475592320 ms: 2 dur: 0
m0: 6631675 p: 576 m: 60342610919632 ms: 14 dur: 0
mp: 3732423 p: 596 m: 294475592320 ms: 0 dur: 0
mp: 6635419 p: 602 m: 294475592320 ms: 2 dur: 0
mp: 6649279 p: 664 m: 15208728208 ms: 7 dur: 0
mp: 11200681 p: 688 m: 159424614880 ms: 26 dur: 0
mp: 14934241 p: 691 m: 159424614880 ms: 120 dur: 0
mp: 15733191 p: 704 m: 159424614880 ms: 1 dur: 0
1310881
2621439
3732423
4718715
4723849
5505023
6553819
6631675
6635419
6649279
6818103
8126571
8127447
11010047
11200681
14934241
15204351
15204519
15733191
m0: 19638399 p: 606 m: 306296925203752 ms: 181 dur: 0
mp: 31466383 p: 705 m: 159424614880 ms: 119 dur: 0
19638399
31466383
m0: 38595583 p: 483 m: 474637698851092 ms: 222 dur: 0
mp: 36791535 p: 744 m: 159424614880 ms: 45 dur: 0
36791535
38595583
mp: 63728127 p: 949 m: 966616035460 ms: 382 dur: 1
63728127
m0: 80049391 p: 572 m: 2185143829170100 ms: 277 dur: 1
80049391
m0: 120080895 p: 438 m: 3277901576118580 ms: 703 dur: 2
mp: 127456255 p: 950 m: 966616035460 ms: 42 dur: 2
120080895
127456255
mp: 169941673 p: 953 m: 966616035460 ms: 1033 dur: 3
169941673
m0: 210964383 p: 475 m: 6404797161121264 ms: 651 dur: 3
210964383
mp: 226588897 p: 956 m: 966616035460 ms: 339 dur: 4
226588897
mp: 268549803 p: 964 m: 966616035460 ms: 1044 dur: 5
268549803
m0: 319804831 p: 592 m: 1414236446719942480 ms: 768 dur: 6
319804831
mp: 537099607 p: 965 m: 966616035460 ms: 4453 dur: 10
537099607
mp: 670617279 p: 986 m: 966616035460 ms: 2120 dur: 12
670617279
mp: 1341234559 p: 987 m: 966616035460 ms: 12976 dur: 25
1341234559
mp: 1412987847 p: 1000 m: 966616035460 ms: 1613 dur: 27
m0: 1410123943 p: 770 m: 7125885122794452160 ms: 22 dur: 27
1410123943
1412987847
mp: 1674652263 p: 1008 m: 966616035460 ms: 4990 dur: 32
1674652263
mp: 2610744987 p: 1050 m: 966616035460 ms: 18670 dur: 50
2610744987
last number: 4294967296
completed: 85050


m4 pro 16 batch
916 cpu
completed: 69518

950 batch 14
65526

m4pro 972 batch 13
64330

952 batch 12
81519




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant