benchmark

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 26 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

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 added in v1.1.10

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
	Days            []int
	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 Result

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

type RunBenchmarkInput

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

type RunSingleTestInput

type RunSingleTestInput struct {
	Platform  *kwilTesting.Platform
	Case      BenchmarkCase
	Days      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