benchmarks

command
v0.0.0-...-8d8d9e6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

Benchmark Profiling

Using benchmarks you can profile your programs and see exactly where your performance or memory is being taken.

Profiling Commands

CPU Profiling
   go test -run none -bench . -benchtime 3s -benchmem -cpuprofile cpu.out
   go tool pprof benchmarks.test cpu.out
   
   (pprof) list algOne
   (pprof) web list algOne
Memory Profiling
    go test -run none -bench . -benchtime 3s -benchmem -memprofile mem.out
    go tool pprof -alloc_space benchmarks.test mem.out

    (pprof) list algOne
    (pprof) web list algOne

    -inuse_space  : Display in-use memory size
    -inuse_objects: Display in-use object counts
    -alloc_space  : Display allocated memory size
    -alloc_objects: Display allocated object counts

Code Review

Profiling (Go Playground) | Profiling Test (Go Playground)


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

Documentation

Overview

Sample program that takes a stream of bytes and looks for the bytes “elvis” and when they are found, replace them with “Elvis”. The code cannot assume that there are any line feeds or other delimiters in the stream and the code must assume that the stream is of any arbitrary length. The solution cannot meaningfully buffer to the end of the stream and then process the replacement.

Jump to

Keyboard shortcuts

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