Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 3.03 KB

BENCHMARKS.md

File metadata and controls

81 lines (56 loc) · 3.03 KB

xsync benchmarks

Use the following command to run the benchmarks:

$ go test -bench .

To limit the number of used CPU cores append -cpu=<number> argument to the above command.

This document contains some benchmark results obtained on a cloud VM.

Counter vs. atomic int64

The following results were obtained on a GCP e2-highcpu-32 VM with 32 vCPUs (Intel Haswell), 32 GB memory, Ubuntu 20.04, Go 1.16.5.

Concurrent incs/decs, a value read on each 10,000 modification

Concurrent incs/decs, a value read on each 10,000 modification

Map vs. sync.Map

The following results were obtained on a GCP e2-highcpu-32 VM with 32 vCPUs (Intel Haswell), 32 GB memory, Ubuntu 20.04, Go 1.16.5.

1M entries with warm-up, 99% Gets, 0.5% Stores, 0.5% Deletes

1M entries with warm-up, 99% Gets, 0.5% Stores, 0.5% Deletes



1M entries with warm-up, 90% Gets, 5% Stores, 5% Deletes

1M entries with warm-up, 90% Gets, 5% Stores, 5% Deletes



1M entries with warm-up, 75% Gets, 12.5% Stores, 12.5% Deletes

1M entries with warm-up, 75% Gets, 12.5% Stores, 12.5% Deletes

MPMCQueue vs. Go channels

The following results were obtained on a GCP e2-highcpu-32 VM with 32 vCPUs (Intel Haswell), 32 GB memory, Ubuntu 20.04, Go 1.16.5.

Concurrent producers and consumers (1:1), queue/channel size 1,000, no work

Concurrent producers and consumers (1:1), queue/channel size 1,000, no work



Concurrent producers and consumers (1:1), queue/channel size 1,000, some work

Concurrent producers and consumers (1:1), queue/channel size 1,000, some work

RBMutex vs. sync.RWMutex

The following results were obtained on a GCP e2-highcpu-32 VM with 32 vCPUs (Intel Haswell), 32 GB memory, Ubuntu 20.04, Go 1.16.5.

Reader locks only, no work in the critical section

Reader locks only, no work in the critical section



Reader locks only, a loop spin in the critical section

Reader locks only, some work in the critical section



Writer locks on each 10,000 iteration, both no work and a loop spin in the critical section

Writer locks on each 10,000 iteration, both no work and some work in the critical section