profile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package profile provides protocol encoding/decoding performance profiling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatProfile

func FormatProfile(r *ProfileResult) string

FormatProfile formats profiling results.

Types

type FieldProfile

type FieldProfile struct {
	Name     string        `json:"name"`
	Duration time.Duration `json:"duration"`
	Allocs   int64         `json:"allocs"`
	Bytes    int64         `json:"bytes"`
}

FieldProfile holds profiling data for a single field.

type ProfileResult

type ProfileResult struct {
	Protocol   string         `json:"protocol"`
	Operation  string         `json:"operation"`
	Total      time.Duration  `json:"total"`
	Fields     []FieldProfile `json:"fields"`
	TotalAlloc int64          `json:"total_alloc"`
	Bottleneck string         `json:"bottleneck"`
}

ProfileResult holds the complete profiling result.

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

Profiler profiles protocol operations.

func NewProfiler

func NewProfiler(lib *protocol.Library) *Profiler

NewProfiler creates a new profiler.

func (*Profiler) ProfileDecode

func (p *Profiler) ProfileDecode(protoName string, data []byte, iterations int) (*ProfileResult, error)

ProfileDecode profiles a decode operation.

Jump to

Keyboard shortcuts

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