nanoBench: A Low-Overhead Tool for Running Microbenchmarks on x86 Systems

Andreas Abel, Jan Reineke
11/8/2019
cs.PF

Official code: andreas-abel/nanoBench (541 stars, Python, AGPL-3.0, last commit 2026-03-29).

Abstract

We present nanoBench, a tool for evaluating small microbenchmarks using hardware performance counters on Intel and AMD x86 systems. Most existing tools and libraries are intended to either benchmark entire programs, or program segments in the context of their execution within a larger program.

Show full abstract

In contrast, nanoBench is specifically designed to evaluate small, isolated pieces of code. Such code is common in microbenchmark-based hardware analysis techniques. Unlike previous tools, nanoBench can execute microbenchmarks directly in kernel space. This allows to benchmark privileged instructions, and it enables more accurate measurements. The reading of the performance counters is implemented with minimal overhead avoiding functions calls and branches. As a consequence, nanoBench is precise enough to measure individual memory accesses. We illustrate the utility of nanoBench at the hand of two case studies. First, we briefly discuss how nanoBench has been used to determine the latency, throughput, and port usage of more than 13,000 instruction variants on recent x86 processors. Second, we show how to generate microbenchmarks to precisely characterize the cache architectures of eleven Intel Core microarchitectures. This includes the most comprehensive analysis of the employed cache replacement policies to date.

View on arXivView PDF

Code Implementations(1)

AGPL-3.0

A tool for running small microbenchmarks on recent Intel and AMD x86 CPUs.

54169Python, CFeb 15, 20198 months agoAGPL-3.0

Similar Papers

Cite this paper

@article{abel2019nanobench,
  title  = {nanoBench: A Low-Overhead Tool for Running Microbenchmarks on x86 Systems},
  author = {Andreas Abel and Jan Reineke},
  year   = {2019},
  eprint = {1911.03282},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1911.03282}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1911.03282.svg)](https://codeofpaper.com/paper/1911.03282)

Discussion