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: 0

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