SlideShare a Scribd company logo
Tales of Linux Micro-benchmarks
Matt Fleming
@fleming_matt
Agenda
- Background: What is a micro-benchmark?
- Why all the hate?
- Case Studies
- When are they useful?
@fleming_mattTales of Linux micro-benchmarks
Micro-what?
Benchmark: A program to measure the
performance of a system, usually for comparsion.
Models a real-life workload.
Micro-benchmark: A program to measure a (small
but important!) portion of a system.
Artificial/synthetic.
@fleming_mattTales of Linux micro-benchmarks
Why all the hate?
You need some understanding of OS and
runtime/toolchain.
Many do not actually test what the author
intended.
But this is simply a bug or user error, it doesn’t
invalidate the concept.
@fleming_mattTales of Linux micro-benchmarks
Why all the hate?
C: simple loop compiled with -O0 and -O2
for (i = 0; i < 1000000000; i++)
val = val * 2;
Time: 2.238s Time: 0.001s
@fleming_mattTales of Linux micro-benchmarks
Why all the hate?
C: simple loop compiled with -O0 and -O2
for (i = 0; i < 1000000000; i++)
val = val * 2;
movl $0x0,-0xc(%rbp)
jmp 2
1:
shlq -0x8(%rbp)
addl $0x1,-0xc(%rbp)
2:
cmpl $999999999,-0xc(%rbp)
jle 1
Time: 2.238s Time: 0.001s
@fleming_mattTales of Linux micro-benchmarks
Why all the hate?
C: simple loop compiled with -O0 and -O2
for (i = 0; i < 1000000000; i++)
val = val * 2;
movl $0x0,-0xc(%rbp)
jmp 2
1:
shlq -0x8(%rbp)
addl $0x1,-0xc(%rbp)
2:
cmpl $999999999,-0xc(%rbp)
jle 1
Time: 2.238s Time: 0.001s
@fleming_mattTales of Linux micro-benchmarks
Case study 1 - Siege
@fleming_mattTales of Linux micro-benchmarks
Case study 1 - Siege
5.62% [kernel] [k] task_cputime
3.33% [kernel] [k] osq_lock
2.58% [kernel] [k] thread_group_cputime
$ perf top
- task_cputime
- 97.35% thread_group_cputime
thread_group_cputime_adjusted
do_sys_times
sys_times
entry_SYSCALL_64_fastpath
@fleming_mattTales of Linux micro-benchmarks
Case study 2 - lmbench
Measures fork() + exit()
@fleming_mattTales of Linux micro-benchmarks
Case study 2 - lmbench
Measures fork() + exit()
Actually measures fork() + page fault + exit()
@fleming_mattTales of Linux micro-benchmarks
Case study 2 - lmbench
Measures fork() + exit()
Actually measures fork() + page fault + exit()
Faulting address
fault_around_bytes#PF
@fleming_mattTales of Linux micro-benchmarks
Case study 3 - hackbench
Message-passing micro-benchmark
Processes or threads
Pipes or sockets
@fleming_mattTales of Linux micro-benchmarks
Case study 3 - hackbench
Message-passing micro-benchmark
Processes or threads
Pipes or sockets
70%
@fleming_mattTales of Linux micro-benchmarks
Case study 4 - pipetest
@fleming_mattTales of Linux micro-benchmarks
Case study 4 - pipetest
@fleming_mattTales of Linux micro-benchmarks
When are they useful?
After profiling your workload and identifying
bottlenecks
When they’re super simple
When they’ve been tested
@fleming_mattTales of Linux micro-benchmarks
Questions?
@fleming_mattTales of Linux micro-benchmarks

More Related Content

What's hot

Control System toolbox in Matlab
Control System toolbox in MatlabControl System toolbox in Matlab
Control System toolbox in Matlab
Abdul Sami
 
Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016
Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016
Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016
Matthew Broberg
 
Case study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck SchedulerCase study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck Scheduler
Mengxuan Xia
 
What is Functional Programming?
What is Functional Programming?What is Functional Programming?
What is Functional Programming?
Eric Normand
 
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Tamir Dresher
 
Performance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memoryPerformance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memory
ZongYing Lyu
 
Continuous Processing with Apache Flink - Strata London 2016
Continuous Processing with Apache Flink - Strata London 2016Continuous Processing with Apache Flink - Strata London 2016
Continuous Processing with Apache Flink - Strata London 2016
Stephan Ewen
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Brian Brazil
 
Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016
Matthew Broberg
 
Communicating with Channels
Communicating with ChannelsCommunicating with Channels
Communicating with Channels
jlongster2
 
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward
 
HA with RelStorage and Postgres
HA with RelStorage and PostgresHA with RelStorage and Postgres
HA with RelStorage and Postgres
Simone Deponti
 
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Takuo Watanabe
 

What's hot (13)

Control System toolbox in Matlab
Control System toolbox in MatlabControl System toolbox in Matlab
Control System toolbox in Matlab
 
Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016
Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016
Snap Telemetry Framework & Plugin Architecture at GrafanaCon 2016
 
Case study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck SchedulerCase study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck Scheduler
 
What is Functional Programming?
What is Functional Programming?What is Functional Programming?
What is Functional Programming?
 
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
 
Performance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memoryPerformance improvement techniques for software distributed shared memory
Performance improvement techniques for software distributed shared memory
 
Continuous Processing with Apache Flink - Strata London 2016
Continuous Processing with Apache Flink - Strata London 2016Continuous Processing with Apache Flink - Strata London 2016
Continuous Processing with Apache Flink - Strata London 2016
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 
Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016Framingham Go Meetup - October 2016
Framingham Go Meetup - October 2016
 
Communicating with Channels
Communicating with ChannelsCommunicating with Channels
Communicating with Channels
 
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
 
HA with RelStorage and Postgres
HA with RelStorage and PostgresHA with RelStorage and Postgres
HA with RelStorage and Postgres
 
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
 

Similar to Tales of Linux micro-benchmarks

What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performance
Piotr Przymus
 
Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016
Matt Warren
 
Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard Way
Cosimo Streppone
 
The Art Of Performance Tuning
The Art Of Performance TuningThe Art Of Performance Tuning
The Art Of Performance Tuning
Jonathan Ross
 
Java Micro-Benchmarking
Java Micro-BenchmarkingJava Micro-Benchmarking
Java Micro-Benchmarking
Constantine Nosovsky
 
Performance is a Feature!
Performance is a Feature!Performance is a Feature!
Performance is a Feature!
PostSharp Technologies
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
Jeff Larkin
 
Pragmatic model checking: from theory to implementations
Pragmatic model checking: from theory to implementationsPragmatic model checking: from theory to implementations
Pragmatic model checking: from theory to implementations
Universität Rostock
 
Trends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient PerformanceTrends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient Performance
inside-BigData.com
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
Rajan Kumar
 
Lab6 rtos
Lab6 rtosLab6 rtos
Lab6 rtos
indirakumar86
 
[COSCUP 2022] 腳踏多條船-利用 Coroutine在 Software Transactional Memory上進行動態排程
[COSCUP 2022] 腳踏多條船-利用 Coroutine在  Software Transactional Memory上進行動態排程[COSCUP 2022] 腳踏多條船-利用 Coroutine在  Software Transactional Memory上進行動態排程
[COSCUP 2022] 腳踏多條船-利用 Coroutine在 Software Transactional Memory上進行動態排程
littleuniverse24
 
Matopt
MatoptMatopt
Cgc2
Cgc2Cgc2
Analysis of Algorithms
Analysis of AlgorithmsAnalysis of Algorithms
Analysis of Algorithms
Amna Saeed
 
Daa
DaaDaa
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
FellowBuddy.com
 
Python Programming - IX. On Randomness
Python Programming - IX. On RandomnessPython Programming - IX. On Randomness
Python Programming - IX. On Randomness
Ranel Padon
 
Training ImageNet-1k ResNet50 in 15min pfn
Training ImageNet-1k ResNet50 in 15min pfnTraining ImageNet-1k ResNet50 in 15min pfn
Training ImageNet-1k ResNet50 in 15min pfn
Mila, Université de Montréal
 
How to use mtr 2
How to use mtr 2How to use mtr 2
How to use mtr 2
Eduardo Narvaez
 

Similar to Tales of Linux micro-benchmarks (20)

What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performance
 
Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016Performance and how to measure it - ProgSCon London 2016
Performance and how to measure it - ProgSCon London 2016
 
Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard Way
 
The Art Of Performance Tuning
The Art Of Performance TuningThe Art Of Performance Tuning
The Art Of Performance Tuning
 
Java Micro-Benchmarking
Java Micro-BenchmarkingJava Micro-Benchmarking
Java Micro-Benchmarking
 
Performance is a Feature!
Performance is a Feature!Performance is a Feature!
Performance is a Feature!
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
Pragmatic model checking: from theory to implementations
Pragmatic model checking: from theory to implementationsPragmatic model checking: from theory to implementations
Pragmatic model checking: from theory to implementations
 
Trends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient PerformanceTrends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient Performance
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Lab6 rtos
Lab6 rtosLab6 rtos
Lab6 rtos
 
[COSCUP 2022] 腳踏多條船-利用 Coroutine在 Software Transactional Memory上進行動態排程
[COSCUP 2022] 腳踏多條船-利用 Coroutine在  Software Transactional Memory上進行動態排程[COSCUP 2022] 腳踏多條船-利用 Coroutine在  Software Transactional Memory上進行動態排程
[COSCUP 2022] 腳踏多條船-利用 Coroutine在 Software Transactional Memory上進行動態排程
 
Matopt
MatoptMatopt
Matopt
 
Cgc2
Cgc2Cgc2
Cgc2
 
Analysis of Algorithms
Analysis of AlgorithmsAnalysis of Algorithms
Analysis of Algorithms
 
Daa
DaaDaa
Daa
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
 
Python Programming - IX. On Randomness
Python Programming - IX. On RandomnessPython Programming - IX. On Randomness
Python Programming - IX. On Randomness
 
Training ImageNet-1k ResNet50 in 15min pfn
Training ImageNet-1k ResNet50 in 15min pfnTraining ImageNet-1k ResNet50 in 15min pfn
Training ImageNet-1k ResNet50 in 15min pfn
 
How to use mtr 2
How to use mtr 2How to use mtr 2
How to use mtr 2
 

Recently uploaded

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 

Recently uploaded (20)

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 

Tales of Linux micro-benchmarks

  • 1. Tales of Linux Micro-benchmarks Matt Fleming @fleming_matt
  • 2. Agenda - Background: What is a micro-benchmark? - Why all the hate? - Case Studies - When are they useful? @fleming_mattTales of Linux micro-benchmarks
  • 3. Micro-what? Benchmark: A program to measure the performance of a system, usually for comparsion. Models a real-life workload. Micro-benchmark: A program to measure a (small but important!) portion of a system. Artificial/synthetic. @fleming_mattTales of Linux micro-benchmarks
  • 4. Why all the hate? You need some understanding of OS and runtime/toolchain. Many do not actually test what the author intended. But this is simply a bug or user error, it doesn’t invalidate the concept. @fleming_mattTales of Linux micro-benchmarks
  • 5. Why all the hate? C: simple loop compiled with -O0 and -O2 for (i = 0; i < 1000000000; i++) val = val * 2; Time: 2.238s Time: 0.001s @fleming_mattTales of Linux micro-benchmarks
  • 6. Why all the hate? C: simple loop compiled with -O0 and -O2 for (i = 0; i < 1000000000; i++) val = val * 2; movl $0x0,-0xc(%rbp) jmp 2 1: shlq -0x8(%rbp) addl $0x1,-0xc(%rbp) 2: cmpl $999999999,-0xc(%rbp) jle 1 Time: 2.238s Time: 0.001s @fleming_mattTales of Linux micro-benchmarks
  • 7. Why all the hate? C: simple loop compiled with -O0 and -O2 for (i = 0; i < 1000000000; i++) val = val * 2; movl $0x0,-0xc(%rbp) jmp 2 1: shlq -0x8(%rbp) addl $0x1,-0xc(%rbp) 2: cmpl $999999999,-0xc(%rbp) jle 1 Time: 2.238s Time: 0.001s @fleming_mattTales of Linux micro-benchmarks
  • 8. Case study 1 - Siege @fleming_mattTales of Linux micro-benchmarks
  • 9. Case study 1 - Siege 5.62% [kernel] [k] task_cputime 3.33% [kernel] [k] osq_lock 2.58% [kernel] [k] thread_group_cputime $ perf top - task_cputime - 97.35% thread_group_cputime thread_group_cputime_adjusted do_sys_times sys_times entry_SYSCALL_64_fastpath @fleming_mattTales of Linux micro-benchmarks
  • 10. Case study 2 - lmbench Measures fork() + exit() @fleming_mattTales of Linux micro-benchmarks
  • 11. Case study 2 - lmbench Measures fork() + exit() Actually measures fork() + page fault + exit() @fleming_mattTales of Linux micro-benchmarks
  • 12. Case study 2 - lmbench Measures fork() + exit() Actually measures fork() + page fault + exit() Faulting address fault_around_bytes#PF @fleming_mattTales of Linux micro-benchmarks
  • 13. Case study 3 - hackbench Message-passing micro-benchmark Processes or threads Pipes or sockets @fleming_mattTales of Linux micro-benchmarks
  • 14. Case study 3 - hackbench Message-passing micro-benchmark Processes or threads Pipes or sockets 70% @fleming_mattTales of Linux micro-benchmarks
  • 15. Case study 4 - pipetest @fleming_mattTales of Linux micro-benchmarks
  • 16. Case study 4 - pipetest @fleming_mattTales of Linux micro-benchmarks
  • 17. When are they useful? After profiling your workload and identifying bottlenecks When they’re super simple When they’ve been tested @fleming_mattTales of Linux micro-benchmarks