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

Use new iterator #48

Merged
merged 27 commits into from
Feb 27, 2025
Merged

Use new iterator #48

merged 27 commits into from
Feb 27, 2025

Conversation

davidamarquis
Copy link
Collaborator

@davidamarquis davidamarquis commented Nov 18, 2024

This PR implements a multithreaded version of Brouwer's algorithm. In the old approach a matrix multiplication was done for every iteration. The new approach eliminates all matrix multiplications except for a single initial one. This is done by using Gray code iteration with a revolving door algorithm over the messages of a given weight.

Benchmarks

All benchmarks use 3 threads. These codes are used by White in his thesis.

A [70, 35, 14] code

Old Approach
Range (min … max): 3.072 s … 3.283 s ┊ GC (min … max): 0.00% … 0.00%
Time (median): 3.178 s ┊ GC (median): 0.00%
Time (mean ± σ): 3.178 s ± 149.711 ms ┊ GC (mean ± σ): 0.00% ± 0.00%
Memory estimate: 70.49 MiB, allocs estimate: 4583915.

This PR
Range (min … max): 148.035 ms … 157.587 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 148.730 ms ┊ GC (median): 0.00%
Time (mean ± σ): 149.059 ms ± 1.599 ms ┊ GC (mean ± σ): 0.00% ± 0.00%
Memory estimate: 543.20 KiB, allocs estimate: 1434.

A [105, 35, 26] code

I think this example will enumerate about 10X more vectors than the [70, 35, 14] one (about 50 million vectors).

Old Approach
I killed the run after it did not finish in 30 minutes.

This PR
Single result which took 44.510 s (0.00% GC) to evaluate,
with a memory estimate of 1.12 MiB, over 2532 allocations.

@esabo esabo self-assigned this Jan 31, 2025
@davidamarquis davidamarquis marked this pull request as ready for review February 24, 2025 17:32
@davidamarquis davidamarquis changed the title Draft PR for using the new iterator Use new iterator Feb 27, 2025
@esabo esabo merged commit b0526e0 into dev Feb 27, 2025
1 check failed
@esabo esabo deleted the usenewgray branch February 27, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants