benchmark

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

README

TSN-DB Benchmark

This directory contains benchmark tests for the Truflation Stream Network Database (TSN-DB), focusing on evaluating the performance impact of stream composition depth.

This benchmark is part of a larger system used to evaluate TSN-DB performance across different environments and AWS EC2 instance types. The results from these tests are used to generate markdown reports for each instance, providing valuable insights into the system's performance under various conditions.

For information on how to trigger these benchmarks and view the resulting reports, please refer to the Getting Benchmarks documentation.

Objective

The primary goal of this benchmark is to identify the limits regarding the depth at which composed streams can be created and queried efficiently.

Key Concepts

  • Stream Composition Depth: Refers to the number of dependencies between streams. For example, if Stream D depends on Stream C, which depends on Streams A and B, then D has a composition depth of 2.
  • Query Complexity: As depth increases, queries become more complex due to recursive operations and multiple permission checks.

Benchmark Parameters

The tests vary across several dimensions, defined here:

Running the Benchmark

To run the benchmark:

From the root of the project, run the following command:

go test -v ./internal/benchmark

To run a specific test case, use the -run flag:

go test -run TestBenchUnix ./internal/benchmark -v

The above command will run the TestBenchUnix test case.

Results

After running, the benchmark will output performance metrics for each test case, including:

  • Mean duration
  • Minimum duration
  • Maximum duration

These results help evaluate the efficiency of TSN-DB operations under different conditions.

Note

This benchmark is intended for development and testing purposes. The results may vary depending on your system configuration and current load.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average[T constraints.Integer | constraints.Float](values []T) T

func MustEthereumAddressFromBytes

func MustEthereumAddressFromBytes(b []byte) *util.EthereumAddress

func MustNewEthereumAddressFromBytes

func MustNewEthereumAddressFromBytes(b []byte) util.EthereumAddress

MustNewEthereumAddressFromBytes creates an EthereumAddress from a byte slice, panicking if the conversion fails. Use with caution and only in contexts where a failure to create the address is unrecoverable.

func MustNewEthereumAddressFromString

func MustNewEthereumAddressFromString(s string) util.EthereumAddress

MustNewEthereumAddressFromString creates an EthereumAddress from a string, panicking if the conversion fails. Use with caution and only in contexts where a failure to create the address is unrecoverable.

Types

type BenchmarkCase

type BenchmarkCase struct {
	QtyStreams      int
	BranchingFactor int
	DataPointsSet   []int
	UnixOnly        bool
	Visibility      util.VisibilityEnum
	Samples         int
	Procedures      []ProcedureEnum
}

type ProcedureEnum

type ProcedureEnum string
const (
	ProcedureGetRecord      ProcedureEnum = "get_record"
	ProcedureGetIndex       ProcedureEnum = "get_index"
	ProcedureGetChangeIndex ProcedureEnum = "get_index_change"
	ProcedureGetFirstRecord ProcedureEnum = "get_first_record"
)

type RangeParameters

type RangeParameters struct {
	DataPoints int
	FromDate   time.Time
	ToDate     time.Time
}

type Result

type Result struct {
	Case          BenchmarkCase
	MaxDepth      int
	MemoryUsage   uint64
	Procedure     ProcedureEnum
	DataPoints    int
	CaseDurations []time.Duration
}

type RunBenchmarkInput

type RunBenchmarkInput struct {
	ResultPath string
	Visibility util.VisibilityEnum
	QtyStreams int
	DataPoints []int
	Samples    int
}

type RunSingleTestInput

type RunSingleTestInput struct {
	Platform   *kwilTesting.Platform
	Case       BenchmarkCase
	DataPoints int
	Procedure  ProcedureEnum
	Tree       trees.Tree
}

type SetupSchemasInput

type SetupSchemasInput struct {
	BenchmarkCase BenchmarkCase
	Tree          trees.Tree
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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