Skip to content

Conversation

@fabianfett
Copy link
Collaborator

@fabianfett fabianfett commented Dec 4, 2025

Fixes: #261.

@fabianfett fabianfett added this to the 1.0 milestone Dec 4, 2025
Signed-off-by: Fabian Fett <[email protected]>
@fabianfett fabianfett force-pushed the ff-adopt-NonIsolatedNonSendingByDefault branch from c742432 to 5b23941 Compare December 4, 2025 12:42
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

❌ Benchmark comparison failed with error ❌

Summary
===============================================================
Threshold deviations for ValkeyBenchmarks:Client: GET benchmark
===============================================================
Malloc (total) (K, %) main pull_request Difference % Threshold %
p25 57 53 -6 5
p50 58 53 -7 5
p75 58 56 -5 5
=========================================================================================================
Threshold deviations for ValkeyBenchmarks:Client: GET benchmark | parallel 20 | 20 concurrent connections
=========================================================================================================
Malloc (total) (K, %) main pull_request Difference % Threshold %
p25 57 54 -5 5
p50 59 56 -6 5
p75 61 58 -5 5

New baseline 'pull_request' is BETTER than the 'main' baseline thresholds.

Full Benchmark Comparison

Comparing results between 'main' and 'pull_request'

Host 'a7bc1d947319' with 4 'x86_64' processors with 15 GB memory, running:
#18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025

ValkeyBenchmarks

Client: GET benchmark metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 57 57 58 58 60 60 60 6
pull_request 52 53 53 56 56 56 56 6
Δ -5 -4 -5 -2 -4 -4 -4 0
Improvement % 9 7 9 3 7 7 7 0

Client: GET benchmark | parallel 20 | 20 concurrent connections metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 53 57 59 61 62 64 64 27
pull_request 49 54 56 58 60 63 63 27
Δ -4 -3 -3 -3 -2 -1 -1 0
Improvement % 8 5 5 5 3 2 2 0

Connection: GET benchmark metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 4 4 4 4 4 4 4 8
pull_request 4 4 4 4 4 4 4 8
Δ 0 0 0 0 0 0 0 0
Improvement % 0 0 0 0 0 0 0 0

Connection: GET benchmark – NoOpTracer metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 6 6 10 10 10 10 10 8
pull_request 6 6 10 10 10 10 10 8
Δ 0 0 0 0 0 0 0 0
Improvement % 0 0 0 0 0 0 0 0

Connection: Pipeline array benchmark metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 26 30 30 37 38 38 38 6
pull_request 25 30 30 37 38 38 38 6
Δ -1 0 0 0 0 0 0 0
Improvement % 4 0 0 0 0 0 0 0

Connection: Pipeline benchmark metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 25 32 33 33 35 35 35 5
pull_request 25 31 33 34 35 35 35 6
Δ 0 -1 0 1 0 0 0 1
Improvement % 0 3 0 -3 0 0 0 1

HashSlot – {user}.whatever metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 0 0 0 0 0 0 0 18
pull_request 0 0 0 0 0 0 0 19
Δ 0 0 0 0 0 0 0 1
Improvement % 0 0 0 0 0 0 0 1

ValkeyCommandEncoder – Command with 7 words metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 0 0 0 0 0 0 0 832
pull_request 0 0 0 0 0 0 0 824
Δ 0 0 0 0 0 0 0 -8
Improvement % 0 0 0 0 0 0 0 -8

ValkeyCommandEncoder – Simple GET metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 0 0 0 0 0 0 0 1981
pull_request 0 0 0 0 0 0 0 1991
Δ 0 0 0 0 0 0 0 10
Improvement % 0 0 0 0 0 0 0 10

ValkeyCommandEncoder – Simple MGET 15 keys metrics

Malloc (total): results within specified thresholds, fold down for details.

Malloc (total) * p0 p25 p50 p75 p90 p99 p100 Samples
main 0 0 0 0 0 0 0 377
pull_request 0 0 0 0 0 0 0 375
Δ 0 0 0 0 0 0 0 -2
Improvement % 0 0 0 0 0 0 0 -2

Signed-off-by: Fabian Fett <[email protected]>
Signed-off-by: Fabian Fett <[email protected]>
Copy link
Collaborator

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

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

A couple of comments, mainly based on my ignorance of some of the concurrency keywords

var base: BaseAsyncSequence.AsyncIterator

#if compiler(>=6.2)
@concurrent
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be

public mutating func next() async throws -> Element? {
    try await self.base.next(isolation: #isolation)
}

Instead of adding @concurrent

/// ``ValkeyConnection/psubscribe(to:process:)``
@inlinable
public func _subscribe<Value>(
public nonisolated(nonsending) func _subscribe<Value>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this nonisolated(nonsending) when the functions that call it are nonisolated?

/// ``ValkeyConnection/subscribe(to:process:)`` or
/// ``ValkeyConnection/psubscribe(to:process:)``
@inlinable
public func _subscribe<Value>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of using a later swift-format which the majority of people aren't using yet can you add this instead

    // swift-format-ignore
    @inlinable
    public nonisolated(nonsending) func _subscribe<Value>(
        command: some ValkeySubscribeCommand,
        process: nonisolated(nonsending) (ValkeySubscription) async throws -> Value
    ) async throws -> Value {

with:
api_breakage_check_container_image: swift:latest
docs_check_container_image: swift:latest
# 6.2 does not understand `nonisolated(nonsending)` correctly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use // swift-format-ignore to get around swift-format not understanding nonisolated(nonsending)

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.

Adopt upcoming nonisolated(nonsending) by default

3 participants