benchmarks/

directory
v0.0.0-...-38a5715 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0

README

Benchmarking

Go has support for testing the performance of your code.

Package Review

Basic Benchmarking
Sub Benchmarks
Validate Benchmarks
Prediction
Caching
False Sharing

Look at the profiling topic to learn more about using benchmarks to profile code.

How to write benchmarks in Go - Dave Cheney
Profiling & Optimizing in Go - Brad Fitzpatrick
Benchstat computes and compares statistics about benchmarks
Advanced Testing Concepts for Go 1.7 - Marcel van Lohuizen

Exercises

Exercise 1

Write three benchmark tests for converting an integer into a string. First use the fmt.Sprintf function, then the strconv.FormatInt function and finally the strconv.Itoa. Identify which function performs the best.

Template (Go Playground) | Answer (Go Playground)


All material is licensed under the Apache License Version 2.0, January 2004.

Directories

Path Synopsis
Package caching provides code to show why Data Oriented Design matters.
Package caching provides code to show why Data Oriented Design matters.
Understanding your workload is critically important in understanding if something can be made concurrent and how complex it is to perform.
Understanding your workload is critically important in understanding if something can be made concurrent and how complex it is to perform.
Understanding your workload is critically important in understanding if something can be made concurrent and how complex it is to perform.
Understanding your workload is critically important in understanding if something can be made concurrent and how complex it is to perform.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL