# plasma-umass/scalene

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/plasma-umass-scalene).**

13,284 stars · 431 forks · JavaScript · apache-2.0

## Links

- GitHub: https://github.com/plasma-umass/scalene
- awesome-repositories: https://awesome-repositories.com/repository/plasma-umass-scalene.md

## Topics

`cpu` `cpu-profiling` `gpu` `gpu-programming` `memory-allocation` `memory-consumption` `performance-analysis` `performance-cpu` `profiler` `profiles-memory` `profiling` `python` `python-profilers` `scalene`

## Description

Scalene is a high-performance diagnostic utility designed to measure resource consumption during the execution of Python applications. It functions as a line-level monitor, providing granular insights that pinpoint the specific source code responsible for performance overhead.

The tool distinguishes itself through statistical profiling that captures stack traces and resource usage without requiring manual instrumentation of the source code. It tracks CPU, GPU, and memory consumption by intercepting library-level calls and hardware driver commands, allowing for the analysis of both managed and native code.

Beyond standard CPU and memory tracking, the profiler supports multi-process resource monitoring and identifies memory leaks by locating allocations that remain unreleased. It maps these performance metrics directly to source code lines, facilitating the identification of bottlenecks in complex applications and GPU-accelerated computational tasks.

## Tags

### Development Tools & Productivity

- [Python Profilers](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/performance-resource-profilers/cpu-profilers/python-profilers.md) — Tracks CPU, GPU, and memory usage at the line level to identify bottlenecks in Python code.
- [Performance and Resource Profilers](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/performance-resource-profilers.md) — Provides a high-performance diagnostic utility that measures resource consumption during application execution to help developers optimize performance.
- [Performance Profiling](https://awesome-repositories.com/f/development-tools-productivity/performance-optimization-tools/performance-profiling.md) — Identifies specific lines of code that cause high CPU or memory usage to optimize execution speed and resource efficiency.
- [CPU Profilers](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/performance-resource-profilers/cpu-profilers.md) — Tracks CPU, GPU, and memory consumption at the line level to identify performance bottlenecks within source code. ([source](https://github.com/plasma-umass/scalene/tree/master/docs/))
- [Execution-to-Source Mappers](https://awesome-repositories.com/f/development-tools-productivity/source-map-generators/execution-to-source-mappers.md) — Maps execution samples back to specific source code lines by correlating instruction pointers with debug symbols and source file metadata.
- [Memory Allocation Interceptors](https://awesome-repositories.com/f/development-tools-productivity/compilers-toolchains/c-extension-interfaces/memory-allocation-interceptors.md) — Hooks into library-level memory allocation functions to track heap usage across both managed and native code.

### System Administration & Monitoring

- [Line-Level Resource Monitors](https://awesome-repositories.com/f/system-administration-monitoring/resource-monitoring/line-level-resource-monitors.md) — Provides granular insights into resource usage by pinpointing specific lines of code responsible for performance overhead.
- [Statistical Profilers](https://awesome-repositories.com/f/system-administration-monitoring/trace-sampling/statistical-profilers.md) — Uses periodic signal interrupts to capture stack traces and resource usage without requiring manual instrumentation of the source code.

### Operating Systems & Systems Programming

- [GPU Acceleration](https://awesome-repositories.com/f/operating-systems-systems-programming/hardware-interfacing-drivers/hardware-acceleration/gpu-acceleration.md) — Monitors and analyzes the utilization of graphics processing units to ensure efficient offloading of heavy computational tasks.
- [Asynchronous](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/signal-handlers/asynchronous.md) — Employs low-overhead asynchronous signal handlers to capture performance metrics during application execution.

### Testing & Quality Assurance

- [Memory Leak Detection](https://awesome-repositories.com/f/testing-quality-assurance/debugging-diagnostics/memory-leak-detection.md) — Pinpoints exact locations in source code where memory is being allocated but not released to prevent application crashes and bloat.

### Artificial Intelligence & ML

- [GPU Command Interceptors](https://awesome-repositories.com/f/artificial-intelligence-ml/gpu-kernel-implementations/gpu-command-interceptors.md) — Wraps graphics API calls to measure execution time and memory throughput by intercepting commands sent to the hardware driver.

### Software Engineering & Architecture

- [Performance Analysis](https://awesome-repositories.com/f/software-engineering-architecture/performance-analysis.md) — Evaluates the performance of complex applications to determine which functions or code blocks are slowing down the overall system.
- [Multi-Process Resource Tracers](https://awesome-repositories.com/f/software-engineering-architecture/inter-process-communication/multi-process-resource-tracers.md) — Monitors child processes and threads by aggregating resource metrics through shared memory segments and inter-process communication channels.
