Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions profiling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Profiling and Optimization Analysis

This directory contains performance profiling and optimization work for the TweetVerify codebase.

## Files

- **`profile_analysis.py`** - Profiling script using Python's cProfile to analyze 5 critical functions
- **`optimizations.py`** - Optimized implementations of the bottleneck functions
- **`benchmark_optimizations.py`** - Benchmark script comparing original vs optimized performance
- **`benchmark_results.txt`** - Summary of benchmark results

## Results Summary

Average performance improvement: **7.27x speedup** (57.0% improvement)

| Function | Speedup | Improvement |
|----------|---------|-------------|
| Emoji Removal | 24.96x | 96.0% |
| DataProcessor | 6.59x | 84.8% |
| Regex Cleaning | 1.97x | 49.3% |
| collate_batch | 1.65x | 39.3% |
| DataFrame Ops | 1.18x | 15.5% |

## Usage

Run profiling:
```bash
python3 profiling/profile_analysis.py
```

Run benchmarks:
```bash
python3 profiling/benchmark_optimizations.py
```

Loading