Skip to content

Benchmark JS meta snapshots#7358

Merged
neilalexander merged 1 commit intomainfrom
maurice/bench-meta-snap
Sep 26, 2025
Merged

Benchmark JS meta snapshots#7358
neilalexander merged 1 commit intomainfrom
maurice/bench-meta-snap

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

Folow-up of #7350

Signed-off-by: Maurice van Veen github@mauricevanveen.com

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner September 26, 2025 10:58
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2.11.8:

goos: darwin
goarch: arm64
pkg: github.com/nats-io/nats-server/v2/server
cpu: Apple M2 Ultra
BenchmarkJetStreamMetaSnapshot
BenchmarkJetStreamMetaSnapshot/Default
BenchmarkJetStreamMetaSnapshot/Default-24         	       4	 251366969 ns/op
BenchmarkJetStreamMetaSnapshot/AllUnsupported
BenchmarkJetStreamMetaSnapshot/AllUnsupported-24  	       5	 206466767 ns/op
PASS
ok  	github.com/nats-io/nats-server/v2/server	148.689s

v2.11.9:

goos: darwin
goarch: arm64
pkg: github.com/nats-io/nats-server/v2/server
cpu: Apple M2 Ultra
BenchmarkJetStreamMetaSnapshot
BenchmarkJetStreamMetaSnapshot/Default
BenchmarkJetStreamMetaSnapshot/Default-24         	       2	 714755854 ns/op
BenchmarkJetStreamMetaSnapshot/AllUnsupported
BenchmarkJetStreamMetaSnapshot/AllUnsupported-24  	       2	 573180208 ns/op
PASS
ok  	github.com/nats-io/nats-server/v2/server	93.172s

This PR on top of main:

goos: darwin
goarch: arm64
pkg: github.com/nats-io/nats-server/v2/server
cpu: Apple M2 Ultra
BenchmarkJetStreamMetaSnapshot
BenchmarkJetStreamMetaSnapshot/Default
BenchmarkJetStreamMetaSnapshot/Default-24         	       4	 250398781 ns/op
BenchmarkJetStreamMetaSnapshot/AllUnsupported
BenchmarkJetStreamMetaSnapshot/AllUnsupported-24  	       5	 214635150 ns/op
PASS
ok  	github.com/nats-io/nats-server/v2/server	80.426s

js.mu.Unlock()

// Wait for all servers to have created all assets.
checkFor(b, 20*time.Second, 200*time.Millisecond, func() error {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to up this to 60*time.Second in order to make the test more reliable on my machine.

Copy link
Copy Markdown
Member

@neilalexander neilalexander Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually switching to Storage: MemoryStorage for streams and MemoryStorage: true for consumers speeds up the setup considerably.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to memory storage

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@neilalexander neilalexander merged commit ae3fdcf into main Sep 26, 2025
88 of 92 checks passed
@neilalexander neilalexander deleted the maurice/bench-meta-snap branch September 26, 2025 12:44
neilalexander added a commit that referenced this pull request Sep 29, 2025
Includes the following:

- #7290
- #7295
- #7291
- #7287
- #7299
- #7300
- #7297
- #7303
- #7304
- #7305
- #7309
- #7307
- #7320
- #7337
- #7344
- #7345
- #7348
- #7349
- #7350
- #7357
- #7356
- #7358
- #7367
- #7293

Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander added a commit that referenced this pull request Sep 29, 2025
Includes the following:

- #7337
- #7342
- #7344
- #7345
- #7347
- #7346
- #7348
- #7349
- #7350
- #7357
- #7356
- #7358
- #7359
- #7366
- #7367
- #7293
- #7368

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants