grep

module
v0.0.0-...-3a56756 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0

README




Benchmarking Lab


Mission

Implement Grep!

Your CLI application should take a word and a file name args and report back the number of occurrences of the word in the file.

  • Clone the labs repo
  • Cd grep
  • An initial implementation of CountWord function is provided
  • Implement a test for the CountWord function
  • Benchmark your CountWord function.
  • Is it cpu or memory bound?
  • Using benchstat checkout to variation and make sure you have a solid measurement.
  • Can you speed up your initial implementation?
  • Implement and test a second implementation.
  • Using benchstat compare your first and second implementations.
Setup
# Install benchstat
# IMPORTANT! Make sure GOBIN is set to $HOME/gopherland/bin and is in your PATH!!
go env GOBIN
# Set if NOT SET!
go env -w GOBIN=$HOME/gopherland/bin
go get -u golang.org/x/perf/cmd/benchstat
Commands
# Normalize output so they have the same benchmark name
sed -i '' 's/V1//g' v1.out && sed -i '' 's/V2//g' v2.out

© 2020 Imhotep Software LLC. All materials licensed under Apache v2.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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