Benchkit

kdrag0n

Magisk KernelSU APatch
v2.6.4
Version
15.65 MB
Size
Nov 1, 2021
Updated

Module Info

  • Contributors kdrag0n, Zackptg5, MarcAnt01, iGlitch, JohnFawkes
  • Source Code View Repository
  • Tags
    #Benchkit #Benchmark #Profiling #Kernel Tuning #Magisk Module #kdrag0n #Dhrystone #fio #stress-ng #JankBenchX

About this module

Optimizing an Android kernel or ROM without real measurements is guesswork. Benchkit by kdrag0n ends the guessing — bundling over 15 industry-standard profiling and benchmarking tools used by Linux kernel maintainers, Facebook engineers, and the Android Open Source Project itself, all ready to run on your rooted Android device. From Dhrystone CPU benchmarks to Facebook's schbench scheduler latency tests, from filesystem I/O testing with fio to audio latency profiling with OboeTester — Benchkit turns your phone into a serious performance research platform.

Benchmark Categories

A complete profiling stack covering every layer of Android performance — from raw CPU cycles to UI jank, from kernel scheduler behavior to audio latency.

CPU & Integer Performance

Dhrystone for classic integer benchmarking (used by EAS energy model calibration), callbench for syscall and vDSO speed measurement, and GTcycles for measuring the CPU's generic timer frequency. Essential tools for evaluating SoC raw compute capability.

Scheduler & Latency

hackbench for scheduler wakeup latency and pipe stress, schbench (Facebook's detailed scheduler benchmark), cyclictest for real-time latency testing, and rt-app for simulating reproducible mobile workloads. Critical for tuning CPU governors and scheduler parameters.

Storage & I/O

fio (Flexible I/O Tester by Linux block subsystem maintainer Jens Axboe), IOzone for general filesystem benchmarking, and Bonnie++ for additional I/O profiling. Measure UFS/eMMC throughput, IOPS, and latency under configurable workload patterns.

Memory & Kernel

memcpy for raw memory bandwidth via libc memcpy(3), and SLABtop for detailed kernel SLAB memory usage breakdown (requires CONFIG_SLUB_DEBUG=y). Identify memory bottlenecks and kernel allocator behavior with surgical precision.

Stress & Synthetic Load

stress-ng — the comprehensive Linux stress-testing suite covering hundreds of CPU, memory, I/O, and kernel subsystem stressors. sysbench — scriptable database and system performance benchmarking. Push every part of your device to its limits to surface stability issues and thermal behavior.

UI Jank & Audio Latency

Full GUI benchmark suite: JankBenchX for UI smoothness, UiBench for AOSP-standard rendering tests, TouchLatency for input-to-display response timing, and OboeTester + SynthMark for audio pipeline latency and synth CPU benchmarking.

Why Benchkit Exists

Android kernel development has long suffered from a lack of empirical data. ROM developers tweak CONFIG_HZ values, kernel hackers adjust EAS energy parameters, and reviewers run synthetic benchmarks like AnTuTu — but few have access to the same precise, reproducible profiling tools that the upstream Linux kernel community relies on. The result: a culture of guesswork, anecdotal claims, and placebo "performance mods."

kdrag0n (Danny Lin) built Benchkit to change that. By cross-compiling the canonical Linux benchmark suite — fio from the block subsystem maintainer, schbench from Facebook's kernel team, stress-ng from Colin Ian King, cyclictest from the realtime Linux community — for AArch64 Android and packaging them as a single Magisk module, Benchkit gives Android developers direct access to the exact same measurement tools used to evaluate kernel changes upstream.

The result is a powerful, data-driven workflow: change a CPU governor, run Dhrystone — see the actual integer performance delta. Tune the scheduler, run hackbench and schbench — measure the latency improvement. Patch the I/O scheduler, run fio with realistic mobile workload patterns — verify the throughput change is real. Benchkit makes performance tuning a science, not a superstition.

Complete Tool Reference

ToolPurposeType
dhrystoneClassic CPU integer performance benchmark — used for EAS energy model CPU capacity calculationsCLI
callbenchSystem call speed (with/without vDSO) and basic mmap/read I/O measurementCLI
callbench3232-bit build of callbench for testing 32-bit vDSO performanceCLI
gtcyclesMeasure the frequency of the CPU's generic timerCLI
hackbenchScheduler wakeup latency and pipe throughput benchmarkCLI
schbenchDetailed scheduler wakeup latency benchmark (by Facebook)CLI
cyclictestMeasure timer jitter and expiration delay — real-time latency testingCLI
rt-appReal-time application simulator — replicates mobile workloads reproduciblyCLI
fioFlexible I/O Tester — generic I/O benchmark with highly configurable workload simulation (Jens Axboe)CLI
iozoneGeneral filesystem and I/O benchmarkCLI
bonnie++Classic I/O benchmark for sequential and random read/write performanceCLI
memcpyMemory bandwidth tester using libc memcpy(3)CLI
slabtopKernel SLAB memory usage details — requires CONFIG_SLUB_DEBUG=yCLI
stress-ngComprehensive stress-testing suite for hardware and kernel subsystemsCLI
sysbenchScriptable database and system performance benchmarkCLI
synthmarkCPU audio synthesis benchmarking — both CLI and GUICLI+GUI
JankBenchXUI smoothness benchmark — measures frame timing and jank in standard UI workloadsGUI
UiBenchAOSP-standard UI rendering benchmarkGUI
TouchLatencyGoogle's app for testing touch input latency, frame rendering, and missed framesGUI
OboeTesterAudio pipeline latency and Oboe audio API testingGUI

Quick Usage Examples

After flashing the module and rebooting, open Termux with root or use adb shell and try these starter commands:

# Quick CPU integer performance test
dhrystone
# Scheduler wakeup latency under load
schbench -t 8 -r 30
# 4K random read I/O benchmark on internal storage
fio --name=randread --rw=randread --bs=4k --size=1G --runtime=30 --time_based
# Full hardware stress test for 60 seconds
stress-ng --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 60s
# Memory bandwidth test
memcpy
# Real-time latency measurement
cyclictest -t 4 -p 80 -i 1000 -l 10000