Skip to main content

dencoding_benchmark_test.go

dencoding_benchmark_test.go - Overview

This file contains benchmark tests for the dencoding package, specifically focusing on the performance of encoding and decoding integer values (both signed and unsigned).

Detailed Documentation

BenchmarkEncodeDecodeInt

  • Purpose: Benchmarks the encoding and decoding of int64 values using dencoding.EncodeInt and dencoding.DecodeInt.
  • Parameters:
    • b (*testing.B): The benchmark testing object.
  • Returns: None

BenchmarkEncodeUIntConcurrent

  • Purpose: Benchmarks the concurrent encoding performance of uint64 values using dencoding.EncodeUInt.
  • Parameters:
    • b (*testing.B): The benchmark testing object.
  • Returns: None

BenchmarkDecodeUIntConcurrent

  • Purpose: Benchmarks the concurrent decoding performance of uint64 values using dencoding.DecodeUInt.
  • Parameters:
    • b (*testing.B): The benchmark testing object.
  • Returns: None

BenchmarkMinMaxEncodeDecodeInt

  • Purpose: Benchmarks the encoding and decoding of int64 values, including positive, negative, and values close to math.MaxInt64 and math.MinInt64. It checks for correct round trip conversions.
  • Parameters:
    • b (*testing.B): The benchmark testing object.
  • Returns: None

Getting Started Relevance: NO