# jojo165556/speedup-lab architecture

> Architecture diagram of the GitHub repository jojo165556/speedup-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jojo165556/speedup-lab
- Repository: https://github.com/jojo165556/speedup-lab

## Overview

This repository is a Python performance-analysis study: it runs a mixed CPU/I/O workload sequentially and with thread or process pools, profiles the workload, measures speedup, and compares results with Amdahl’s law. Its main workflow runs a reference execution, runs parallel variants, records measurements, then validates output integrity and plots theoretical versus observed speedup. The graph also includes the GIL demo and line-level profiling. Edges reflect shown calls and file reads/writes; the README documents capabilities whose implementation details are not otherwise shown.

Main entry points: [`01_sequentiel.py`](https://github.com/jojo165556/speedup-lab/blob/main/01_sequentiel.py) (Sequential Reference), [`common.py`](https://github.com/jojo165556/speedup-lab/blob/main/common.py) (CPU and I/O Tasks), [`analyser_profilage.py`](https://github.com/jojo165556/speedup-lab/blob/main/analyser_profilage.py) (Macro Profiling), [`04_mesures.py`](https://github.com/jojo165556/speedup-lab/blob/main/04_mesures.py) (Worker Benchmarks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workload["Workload"]
  node_tasks["CPU and I/O Tasks<br/>[common.py]"]
end

subgraph group_execution["Execution"]
  node_sequential["Sequential Reference<br/>[01_sequentiel.py]"]
  node_parallel["Parallel Variants<br/>[03_paralleliser.py]"]
  node_gil_demo["GIL Demonstration<br/>[05_demo_gil.py]"]
end

subgraph group_analysis["Performance Analysis"]
  node_line_profile["Line Profiling<br/>[02_profilage.py]"]
  node_measurement["Timing Protocol<br/>[mesure.py]"]
  node_macro_profile["Macro Profiling"]
  node_benchmark["Worker Benchmarks<br/>[04_mesures.py]"]
  node_amdahl_calc["Amdahl Analysis"]
end

subgraph group_results["Results and Validation"]
  node_plot["Speedup Plot<br/>[06_amdahl.py]"]
  node_recipe_check["Integrity Check"]
  node_reference_data["Reference Results"]
  node_parallel_data["Parallel Results"]
  node_measure_data["Worker Measurements<br/>[mesures.csv]"]
  node_amdahl_data["Amdahl Parameters"]
end

node_user(("User"))

node_user -->|"runs reference"| node_sequential
node_user -->|"runs variants"| node_parallel
node_user -->|"profiles lines"| node_line_profile
node_user -->|"profiles workload"| node_macro_profile
node_user -->|"measures workers"| node_benchmark
node_user -->|"compares execution"| node_gil_demo
node_user -->|"generates plot"| node_plot
node_user -->|"checks integrity"| node_recipe_check
node_sequential -->|"processes elements"| node_tasks
node_sequential -->|"measures optionally"| node_measurement
node_sequential -->|"writes reference"| node_reference_data
node_parallel -->|"dispatches tasks"| node_tasks
node_parallel -->|"writes composite"| node_parallel_data
node_gil_demo -->|"runs CPU task"| node_tasks
node_macro_profile -->|"profiles execution"| node_sequential
node_macro_profile -->|"times task types"| node_tasks
node_macro_profile -->|"calculates fraction"| node_amdahl_calc
node_amdahl_calc -->|"writes parameters"| node_amdahl_data
node_benchmark -->|"benchmarks variants"| node_parallel
node_benchmark -->|"repeats timing"| node_measurement
node_benchmark -->|"writes measurements"| node_measure_data
node_plot -->|"reads parameters"| node_amdahl_data
node_plot -->|"reads measurements"| node_measure_data
node_recipe_check -->|"reads reference"| node_reference_data
node_recipe_check -->|"reads parallel output"| node_parallel_data
node_line_profile -->|"profiles equivalents"| node_tasks

click node_tasks "https://github.com/jojo165556/speedup-lab/blob/main/common.py"
click node_line_profile "https://github.com/jojo165556/speedup-lab/blob/main/02_profilage.py"
click node_sequential "https://github.com/jojo165556/speedup-lab/blob/main/01_sequentiel.py"
click node_parallel "https://github.com/jojo165556/speedup-lab/blob/main/03_paralleliser.py"
click node_gil_demo "https://github.com/jojo165556/speedup-lab/blob/main/05_demo_gil.py"
click node_measurement "https://github.com/jojo165556/speedup-lab/blob/main/mesure.py"
click node_macro_profile "https://github.com/jojo165556/speedup-lab/blob/main/analyser_profilage.py"
click node_benchmark "https://github.com/jojo165556/speedup-lab/blob/main/04_mesures.py"
click node_amdahl_calc "https://github.com/jojo165556/speedup-lab/blob/main/analyser_profilage.py"
click node_plot "https://github.com/jojo165556/speedup-lab/blob/main/06_amdahl.py"
click node_recipe_check "https://github.com/jojo165556/speedup-lab/blob/main/verifier_recette.py"
click node_reference_data "https://github.com/jojo165556/speedup-lab/blob/main/resultats_reference.json"
click node_parallel_data "https://github.com/jojo165556/speedup-lab/blob/main/resultats_parallele.json"
click node_measure_data "https://github.com/jojo165556/speedup-lab/blob/main/mesures.csv"
click node_amdahl_data "https://github.com/jojo165556/speedup-lab/blob/main/donnees_amdahl.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tasks,node_user toneBlue
class node_sequential,node_parallel,node_gil_demo toneAmber
class node_line_profile,node_measurement,node_macro_profile,node_benchmark,node_amdahl_calc toneMint
class node_plot,node_recipe_check,node_reference_data,node_parallel_data,node_measure_data,node_amdahl_data toneRose
```

## Components

### Workload

- [CPU and I/O Tasks](https://github.com/jojo165556/speedup-lab/blob/main/common.py): `common.py`

### Execution

- [Sequential Reference](https://github.com/jojo165556/speedup-lab/blob/main/01_sequentiel.py): `01_sequentiel.py`
- [Parallel Variants](https://github.com/jojo165556/speedup-lab/blob/main/03_paralleliser.py): `03_paralleliser.py`
- [GIL Demonstration](https://github.com/jojo165556/speedup-lab/blob/main/05_demo_gil.py): `05_demo_gil.py`

### Performance Analysis

- [Line Profiling](https://github.com/jojo165556/speedup-lab/blob/main/02_profilage.py): `02_profilage.py`
- [Timing Protocol](https://github.com/jojo165556/speedup-lab/blob/main/mesure.py): `mesure.py`
- [Macro Profiling](https://github.com/jojo165556/speedup-lab/blob/main/analyser_profilage.py): `analyser_profilage.py`
- [Worker Benchmarks](https://github.com/jojo165556/speedup-lab/blob/main/04_mesures.py): `04_mesures.py`
- [Amdahl Analysis](https://github.com/jojo165556/speedup-lab/blob/main/analyser_profilage.py): `analyser_profilage.py`

### Results and Validation

- [Speedup Plot](https://github.com/jojo165556/speedup-lab/blob/main/06_amdahl.py): `06_amdahl.py`
- [Integrity Check](https://github.com/jojo165556/speedup-lab/blob/main/verifier_recette.py): `verifier_recette.py`
- [Reference Results](https://github.com/jojo165556/speedup-lab/blob/main/resultats_reference.json): `resultats_reference.json`
- [Parallel Results](https://github.com/jojo165556/speedup-lab/blob/main/resultats_parallele.json): `resultats_parallele.json`
- [Worker Measurements](https://github.com/jojo165556/speedup-lab/blob/main/mesures.csv): `mesures.csv`
- [Amdahl Parameters](https://github.com/jojo165556/speedup-lab/blob/main/donnees_amdahl.json): `donnees_amdahl.json`

### Other components

- **User**

## Connections

- User → Sequential Reference: runs reference (evidence: `README.md`)
- User → Parallel Variants: runs variants (evidence: `README.md`)
- User → Line Profiling: profiles lines (evidence: `README.md`)
- User → Macro Profiling: profiles workload (evidence: `README.md`)
- User → Worker Benchmarks: measures workers (evidence: `README.md`)
- User → GIL Demonstration: compares execution (evidence: `README.md`)
- User → Speedup Plot: generates plot (evidence: `README.md`)
- User → Integrity Check: checks integrity (evidence: `README.md`)
- Sequential Reference → CPU and I/O Tasks: processes elements (evidence: `01_sequentiel.py`)
- Sequential Reference → Timing Protocol: measures optionally (evidence: `01_sequentiel.py`)
- Sequential Reference → Reference Results: writes reference (evidence: `01_sequentiel.py`)
- Parallel Variants → CPU and I/O Tasks: dispatches tasks (evidence: `03_paralleliser.py`)
- Parallel Variants → Parallel Results: writes composite (evidence: `03_paralleliser.py`)
- GIL Demonstration → CPU and I/O Tasks: runs CPU task (evidence: `05_demo_gil.py`)
- Macro Profiling → Sequential Reference: profiles execution (evidence: `analyser_profilage.py`)
- Macro Profiling → CPU and I/O Tasks: times task types (evidence: `analyser_profilage.py`)
- Macro Profiling → Amdahl Analysis: calculates fraction (evidence: `analyser_profilage.py`)
- Amdahl Analysis → Amdahl Parameters: writes parameters (evidence: `analyser_profilage.py`)
- Worker Benchmarks → Parallel Variants: benchmarks variants (evidence: `04_mesures.py`)
- Worker Benchmarks → Timing Protocol: repeats timing (evidence: `04_mesures.py`)
- Worker Benchmarks → Worker Measurements: writes measurements (evidence: `04_mesures.py`)
- Speedup Plot → Amdahl Parameters: reads parameters (evidence: `06_amdahl.py`)
- Speedup Plot → Worker Measurements: reads measurements (evidence: `06_amdahl.py`)
- Integrity Check → Reference Results: reads reference (evidence: `verifier_recette.py`)
- Integrity Check → Parallel Results: reads parallel output (evidence: `verifier_recette.py`)
- Line Profiling → CPU and I/O Tasks: profiles equivalents (evidence: `02_profilage.py`)
