Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coastalwhite/amdahls-lie
A demonstration of breaking Amdahl's Law with Caches
https://github.com/coastalwhite/amdahls-lie
Last synced: about 1 month ago
JSON representation
A demonstration of breaking Amdahl's Law with Caches
- Host: GitHub
- URL: https://github.com/coastalwhite/amdahls-lie
- Owner: coastalwhite
- License: mit
- Created: 2024-03-21T15:16:22.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-02T11:32:44.000Z (7 months ago)
- Last Synced: 2024-04-02T13:47:15.629Z (7 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Amdahl's Lie - Speeding up code beyond the theoretical limit
This repository provides a proof-of-concept that shows how to break Amdahl's Law using caches. This tries to show that `n`-threaded applications can be more than `n` times as fast. This works for applications that can partition their work into memory slices.
This is by no means supposed to be a criticism of Amdahl's Law which is extremely useful in parallel programming.
## Explanation
This program is just a proof-of-concept to idea behind breaking Amdahl's Law.
The program is divided into a `lib.rs` and `main.rs` as to simplify benchmarking. The `lib.rs` contains all the interesting logic. There are three implementations: `singlethreaded`, `singlethreaded_batched` and `multithreaded`. To each of these implementations, you pass (i) a `set` of data, (ii) a list of `requests`, and (iii) a configuration (`cfg`). Each implementation will then call `handle_request` for each request and return a vector with all the results.
The `handle_request` function aims to do a large calculation over data that is present in the `set`. This is not that weird of a situation as the same might happen in for example a database. In this`handle_request` implementation, we unpredictably load a bunch of bytes and create a sum over them. This range of bytes that we work on is dependent on the `request.section`.
## License
Licensed under an MIT license.