Holistic Performance, Memory, and Energy Analysis of Sorting Algorithms and Binary Search Trees in Python

This paper presents a comprehensive, multi-metric evaluation of four sorting algorithmsrecursive merge sort, hybrid mergeinsertion sort with fixed and dynamic thresholds, and Pythons built-in Timsortas well as two binary search tree implementationsclassic unbalanced BST and self-balancing AVL treein a pure Python environment. Benchmarking spans four input distributions (random, sorted, reverse-sorted, and 25% perturbed) and four scales from103to106elements, jointly measuring wall-clock latency, memory fragmentation, and CPU/DRAM energy. The fixed-threshold hybrid (K=22) consistently outperforms pure merge by 1218%, while a dynamicnthreshold tracks within 510% without manual tuning. Instrumenting the AVL tree to count rotations yields an empirical slope of2.13n, and confirms stableO(logn)behavior even when worst-case ordered inputs drive an unbalanced BST to heightO(n)and quadratic total cost. Memory fragmentation drops by about 30% in the hybrid methods compared to40%for merge, with energy savings of 1520%; Timsort attains the lowest fragmentation and energy footprint among the methods evaluated. An automated Python-based benchmarking framework provides a reproducible blueprint for high-level algorithm analysis under realistic workloads.

Authors

Institutions

Publication Details

Journal
Applied and Computational Engineering
Published
2025-09-09
DOI
https://doi.org/10.54254/2755-2721/2025.ld26932
Primary Topic
Algorithms and Data Compression
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Holistic Performance, Memory, and Energy Analysis of Sorting Algorithms and Binary Search Trees in Python

Zihan Yang
Applied and Computational Engineering
Algorithms and Data Compression
article

Holistic Performance, Memory, and Energy Analysis of Sorting Algorithms and Binary Search Trees in Python

Zihan Yang
article en

Abstract

This paper presents a comprehensive, multi-metric evaluation of four sorting algorithmsrecursive merge sort, hybrid mergeinsertion sort with fixed and dynamic thresholds, and Pythons built-in Timsortas well as two binary search tree implementationsclassic unbalanced BST and self-balancing AVL treein a pure Python environment. Benchmarking spans four input distributions (random, sorted, reverse-sorted, and 25% perturbed) and four scales from103to106elements, jointly measuring wall-clock latency, memory fragmentation, and CPU/DRAM energy. The fixed-threshold hybrid (K=22) consistently outperforms pure merge by 1218%, while a dynamicnthreshold tracks within 510% without manual tuning. Instrumenting the AVL tree to count rotations yields an empirical slope of2.13n, and confirms stableO(logn)behavior even when worst-case ordered inputs drive an unbalanced BST to heightO(n)and quadratic total cost. Memory fragmentation drops by about 30% in the hybrid methods compared to40%for merge, with energy savings of 1520%; Timsort attains the lowest fragmentation and energy footprint among the methods evaluated. An automated Python-based benchmarking framework provides a reproducible blueprint for high-level algorithm analysis under realistic workloads.

Applied and Computational EngineeringVol. 179(1)
De Anza College (US)
Openalex Percentile: Top 87%
Algorithms and Data Compression
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Holistic Performance, Memory, and Energy Analysis of Sorting Algorithms and Binary Search Trees in Python — Zihan Yang · Applied and Computational Engineering (2025) | TGRS Research Map | TGRS