English中文
TWOBUFQUEUE / SPSC BENCHMARK

256 MiB capacity · callback iterations 0 · ordinary write · publish MAX

Compare producer message-submission speed and cost: higher throughput and lower producer p50 / p99 / p999 are better. Controls are ReaderWriterQueue, rigtorp/SPSCQueue and atomic_queue.

10,000,000 messages per runMean of 3 runsOne configuration across 8 / 16 / 32 / 64 BWeights 35 / 30 / 20 / 15publish_count = MAX (4,294,967,295)is_scan_current = falseHigh QoS · no hard affinity

What does this report measure?

Producer submission throughput and cost: how quickly messages enter the queue and how much producer time each message takes.

Compare TwoBufQueue, ReaderWriterQueue, rigtorp/SPSCQueue and atomic_queue with 8 / 16 / 32 / 64 B messages.TwoBufQueue uses ordinary write, publishes progress only at block handoff and does not scan unfinished current blocks.Callback iterations are 0; consumers still receive messages and invoke the callback.

Procedure: Prepare messages → time consecutive producer submissions → stop timing → wait for the round to drain. Every queue uses identical message counts and lengths.

Timing scope: Timing includes producer payload copying, progress publication, block acquisition/switching during sending and retry waits. Input preparation, end-of-round handoff and callback draining are outside timing. Concurrent copy and consumer threads still affect actual producer speed.

Throughput: Successful submissions divided by accumulated producer send time, in M messages/s (million messages per second); higher is better. GB/s uses net payload bytes.

p50, p99 and p999 are quantiles of producer message-submission cost; lower is better.To measure short operations accurately, time each group of 1,000 successful submissions and divide its duration by 1,000 to obtain one mean per-message cost sample.

p50 (50th percentile): Within a run, 50% of group samples have a mean per-message cost no greater than this value.

p99 (99th percentile): Within a run, 99% of group samples have a mean per-message cost no greater than this value.

p999 (99.9th percentile): Within a run, 99.9% of group samples have a mean per-message cost no greater than this value.

Compute these quantiles independently per run, then average the three run results. The measurement is Producer message-submission overhead: quantiles use 1,000-write group means, not individual write calls or producer-to-consumer end-to-end latency.

Throughput overview

Four queues are grouped for each message length; throughput is in M messages/s.

Complete-payload and ordering validation passedCommon configuration selected from four metricsOne tuned configuration per queue in each report

Each TwoBufQueue data pool is fixed to 256 MiB, totaling 512 MiB. Native SPSC message storage has a 256 MiB budget, including spare slots and padding; control metadata is counted separately.

Each queue uses one configuration for throughput, p50, p99 and p999, shared across 8 / 16 / 32 / 64 B.Selection weights are 35% / 30% / 20% / 15%, with equal participation of all four message lengths. Native capacities derive from a fixed byte budget; copy strategies retain the fixed payload implementation for each length.

The table now uses three search-stage measurements of the common configuration, so it differs from earlier independent per-metric selections. Original records remain; the additional ReaderWriterQueue neighborhood is saved separately.

8 BThroughput · M messages/s
TwoBufQueue
1,022.21
ReaderWriterQueue
801.00
rigtorp/SPSCQueue
326.11
atomic_queue
186.30
16 BThroughput · M messages/s
TwoBufQueue
926.90
ReaderWriterQueue
767.38
rigtorp/SPSCQueue
267.48
atomic_queue
48.65
32 BThroughput · M messages/s
TwoBufQueue
576.85
ReaderWriterQueue
422.63
rigtorp/SPSCQueue
220.68
atomic_queue
30.20
64 BThroughput · M messages/s
TwoBufQueue
339.18
ReaderWriterQueue
204.26
rigtorp/SPSCQueue
99.42
atomic_queue
45.19

Performance comparison

Equal message lengths share a background color; the entire TwoBufQueue row is bold and outlined. Below throughput, the minimum and maximum of three runs are shown.

Message length
Implementation / copy strategyThroughput
M messages/s
Payload throughput
GB/s
Producer submission cost
p50 ns/message
Producer submission cost
p99 ns/message
Producer submission cost
p999 ns/message
Backpressure %
8 BCallback iterations 0 · 10,000,000 messages per run · mean of three runs
TwoBufQueueOrdinary write · first-byte readback1,022.2051,016.036 – 1,028.5558.1780.9171.9865.6940%0 / 30,000,000
ReaderWriterQueueComplete member copy801.002649.604 – 893.9016.4081.2221.9722.6940%0 / 30,000,000
rigtorp/SPSCQueueMember copy + destination write prefetch326.105313.386 – 333.1832.6093.0004.3476.7080%0 / 30,000,000
atomic_queueComplete member copy186.298175.399 – 198.3431.4904.98617.58336.5420%0 / 30,000,000
16 BCallback iterations 0 · 10,000,000 messages per run · mean of three runs
TwoBufQueueOrdinary write · first-byte readback926.900923.205 – 932.41914.8300.8752.2083.7500%0 / 30,000,000
ReaderWriterQueueZero destination, then copy the full payload with memcpy767.375724.706 – 800.67512.2781.3192.5695.6530%0 / 30,000,000
rigtorp/SPSCQueueMember copy + destination write prefetch267.481230.185 – 304.3284.2803.0975.8618.8610%0 / 30,000,000
atomic_queueComplete member copy48.65543.680 – 52.1570.77813.37540.08343.2780%0 / 30,000,000
32 BCallback iterations 0 · 10,000,000 messages per run · mean of three runs
TwoBufQueueOrdinary write · first-byte readback576.852526.814 – 610.85318.4591.4725.88912.6110%0 / 30,000,000
ReaderWriterQueueZero destination, then copy the full payload with memcpy422.627390.659 – 440.06813.5242.6674.9039.7220%0 / 30,000,000
rigtorp/SPSCQueueMember copy + destination write prefetch220.680172.547 – 252.0797.0624.05614.09717.2920%0 / 30,000,000
atomic_queueComplete member copy30.20228.745 – 31.3630.96635.84769.181314.0000%0 / 30,000,000
64 BCallback iterations 0 · 10,000,000 messages per run · mean of three runs
TwoBufQueueOrdinary write · first-byte readback339.182323.621 – 368.03821.7082.4866.59712.6670%0 / 30,000,000
ReaderWriterQueueComplete member copy204.257142.833 – 239.65813.0724.6819.87520.3610%0 / 30,000,000
rigtorp/SPSCQueueMember copy + destination write prefetch99.41565.287 – 126.3906.3637.36122.86126.1940%0 / 30,000,000
atomic_queueComplete member copy45.19339.567 – 48.6902.89229.76440.02856.2220%0 / 30,000,000

The table's p50 / p99 / p999 measure Time spent submitting messages in the producer thread: first calculate the mean cost of each group of Mean cost of 1,000 successful writes quantiles, averaged over three runs; these are neither individual-call nor end-to-end latency. Every metric in a row uses one configuration, shared across all four lengths for that queue. Combined selection makes tradeoffs; individual metrics are no longer claimed to be independently optimal. Click any metric to inspect that same complete configuration.Backpressure % = messages affected by backpressure ÷ total messages × 100%, using combined totals from three throughput runs; numerator and denominator are also shown below. A message counts once even if several write attempts fail.

Three individual results

All three measurements are retained, including slow results. All four metrics use the same configuration ID.

8 BThree individual results and their mean
Implementation / metricRun 1Run 2Run 3Mean
TwoBufQueueThroughput M messages/s · config a0740b5ff8a01,016.0361,022.0251,028.5551,022.205
TwoBufQueuep50 ns/message · config a0740b5ff8a00.9170.9170.9170.917
TwoBufQueuep99 ns/message · config a0740b5ff8a01.7501.5832.6251.986
TwoBufQueuep999 ns/message · config a0740b5ff8a05.2502.0429.7925.694
ReaderWriterQueueThroughput M messages/s · config 05c6a693ebc0859.500649.604893.901801.002
ReaderWriterQueuep50 ns/message · config 05c6a693ebc01.2081.2081.2501.222
ReaderWriterQueuep99 ns/message · config 05c6a693ebc02.0421.8332.0421.972
ReaderWriterQueuep999 ns/message · config 05c6a693ebc03.4172.1252.5422.694
rigtorp/SPSCQueueThroughput M messages/s · config ddbed3127220331.746333.183313.386326.105
rigtorp/SPSCQueuep50 ns/message · config ddbed31272203.1252.9172.9583.000
rigtorp/SPSCQueuep99 ns/message · config ddbed31272204.5834.2084.2504.347
rigtorp/SPSCQueuep999 ns/message · config ddbed31272207.0426.5836.5006.708
atomic_queueThroughput M messages/s · config f54226336788198.343175.399185.152186.298
atomic_queuep50 ns/message · config f542263367884.9175.0005.0424.986
atomic_queuep99 ns/message · config f542263367887.1678.87536.70817.583
atomic_queuep999 ns/message · config f5422633678837.50034.70837.41736.542
16 BThree individual results and their mean
Implementation / metricRun 1Run 2Run 3Mean
TwoBufQueueThroughput M messages/s · config 5db40e8f6a91925.077923.205932.419926.900
TwoBufQueuep50 ns/message · config 5db40e8f6a910.8750.8750.8750.875
TwoBufQueuep99 ns/message · config 5db40e8f6a911.9582.2502.4172.208
TwoBufQueuep999 ns/message · config 5db40e8f6a912.7502.6675.8333.750
ReaderWriterQueueThroughput M messages/s · config 1fe946d9a7bc724.706800.675776.744767.375
ReaderWriterQueuep50 ns/message · config 1fe946d9a7bc1.2081.5001.2501.319
ReaderWriterQueuep99 ns/message · config 1fe946d9a7bc2.3752.9582.3752.569
ReaderWriterQueuep999 ns/message · config 1fe946d9a7bc3.3759.5424.0425.653
rigtorp/SPSCQueueThroughput M messages/s · config 488489a115af304.328230.185267.931267.481
rigtorp/SPSCQueuep50 ns/message · config 488489a115af3.0423.2083.0423.097
rigtorp/SPSCQueuep99 ns/message · config 488489a115af5.7506.3755.4585.861
rigtorp/SPSCQueuep999 ns/message · config 488489a115af9.4179.5837.5838.861
atomic_queueThroughput M messages/s · config 7afaa762ae1a50.12852.15743.68048.655
atomic_queuep50 ns/message · config 7afaa762ae1a6.62512.62520.87513.375
atomic_queuep99 ns/message · config 7afaa762ae1a38.37540.87541.00040.083
atomic_queuep999 ns/message · config 7afaa762ae1a42.29243.66743.87543.278
32 BThree individual results and their mean
Implementation / metricRun 1Run 2Run 3Mean
TwoBufQueueThroughput M messages/s · config cd4e8317c002610.853526.814592.890576.852
TwoBufQueuep50 ns/message · config cd4e8317c0021.4581.5421.4171.472
TwoBufQueuep99 ns/message · config cd4e8317c0025.7507.3754.5425.889
TwoBufQueuep999 ns/message · config cd4e8317c00212.04219.6256.16712.611
ReaderWriterQueueThroughput M messages/s · config 37b8e391eac3437.154440.068390.659422.627
ReaderWriterQueuep50 ns/message · config 37b8e391eac33.0422.9582.0002.667
ReaderWriterQueuep99 ns/message · config 37b8e391eac36.1674.2084.3334.903
ReaderWriterQueuep999 ns/message · config 37b8e391eac310.7509.5008.9179.722
rigtorp/SPSCQueueThroughput M messages/s · config 626a79b8b850237.414172.547252.079220.680
rigtorp/SPSCQueuep50 ns/message · config 626a79b8b8504.0424.0424.0834.056
rigtorp/SPSCQueuep99 ns/message · config 626a79b8b85013.91715.00013.37514.097
rigtorp/SPSCQueuep999 ns/message · config 626a79b8b85015.83318.87517.16717.292
atomic_queueThroughput M messages/s · config b998250847cc31.36328.74530.49930.202
atomic_queuep50 ns/message · config b998250847cc35.04237.00035.50035.847
atomic_queuep99 ns/message · config b998250847cc110.95841.83354.75069.181
atomic_queuep999 ns/message · config b998250847cc818.79254.00069.208314.000
64 BThree individual results and their mean
Implementation / metricRun 1Run 2Run 3Mean
TwoBufQueueThroughput M messages/s · config a9c507ff27cc323.621325.887368.038339.182
TwoBufQueuep50 ns/message · config a9c507ff27cc2.3752.4582.6252.486
TwoBufQueuep99 ns/message · config a9c507ff27cc5.2087.3757.2086.597
TwoBufQueuep999 ns/message · config a9c507ff27cc7.62518.79211.58312.667
ReaderWriterQueueThroughput M messages/s · config 8f16777e2f59142.833230.279239.658204.257
ReaderWriterQueuep50 ns/message · config 8f16777e2f594.8755.0834.0834.681
ReaderWriterQueuep99 ns/message · config 8f16777e2f5911.12510.7927.7089.875
ReaderWriterQueuep999 ns/message · config 8f16777e2f5930.70815.33315.04220.361
rigtorp/SPSCQueueThroughput M messages/s · config 0d1082002fb065.287106.570126.39099.415
rigtorp/SPSCQueuep50 ns/message · config 0d1082002fb07.7506.8757.4587.361
rigtorp/SPSCQueuep99 ns/message · config 0d1082002fb022.95822.25023.37522.861
rigtorp/SPSCQueuep999 ns/message · config 0d1082002fb026.54225.12526.91726.194
atomic_queueThroughput M messages/s · config b4753ca6ef7539.56748.69047.32245.193
atomic_queuep50 ns/message · config b4753ca6ef7534.29225.37529.62529.764
atomic_queuep99 ns/message · config b4753ca6ef7541.41738.79239.87540.028
atomic_queuep999 ns/message · config b4753ca6ef7578.83344.70845.12556.222

Throughput and latency each have three runs; modes and random seeds are recorded as run. Each p999 uses approximately 10,000 group samples, leaving about 10 tail samples and sensitivity to scheduling variation.

All initialization parameters

Initialization is listed once per queue and shared by all message lengths. Per-length values such as slot counts use derivation rules; complete run settings are retained in exported JSON and raw records.

TwoBufQueue: initialization shared by all message lengths

All 61 test-class parameters and constructor/template arguments are listed. Message lengths use one shared value list; derived capacities and fixed per-length copy choices use by_payload_bytes mappings instead of four repeated parameter sets.

Test-class parameters

ParameterValue
transporttwo_buf_queue
mode["throughput", "write_latency"]
payload_bytes[8, 16, 32, 64]
messages10000000
warmup_messages50000
callback_iterations0
verify_payloadfalse
prepared_inputtrue
variable_payloadtrue
prepared_input_limit_bytes268435456
measure_callback_timetrue
producer_interval_ns0
source_block_size524288
source_pool_min512
source_pool_max512
source_queue_capacity512
writer_backpressuredrop
writer_spin_count1000
writer_wait_timeout_ms5000
output_block_size1048576
output_frame_capacity1024
output_pool_min256
output_pool_max256
output_queue_capacity512
cancel_claim_modetail
output_modespsc
output_reader_modewait_signal
output_reader_count1
output_retry_wait_us1000
output_enable_statsfalse
is_scan_currentfalse
reader_spin_count1000
rescan_interval_ns1000000
rescan_max_interval_ns1000000
consumer_cpu-1
producer_cpu-1
producer_qosuser_interactive
round_storage_bytes214748364
fixed_round_boundariestrue
spsc_buffer_bytes0
prefault_producer_bufferstrue
finish_timeout_ms5000
work_wait_min_ms1
finish_retry_ms1
publish_count4294967295
use_write_sessionfalse
rigtorp_write_prefetchtrue
readerwriterqueue_copy_after_zerofalse
spsc_capacity0
retry_yield_every1024
spsc_idle_spins1000
spsc_idle_sleep_ns0
timerauto
sample_every32
max_samples1000000
latency_batch_size1000
timer_calibration_samples16384
call_batch_size256
random_seed[42, 43, 44]
timeout_seconds180
buffer_budget_bytes536870912

Constructor and template arguments

ParameterValue
source_thread_id0
read_layer1_thread_count1
writer_queue_enable_statsfalse
message_prefix_bytes0
writer_count1
source_copy_thread_count1
callback_thread_count1
pool_depth_instrumentationfalse
callback_signature(thread_id, data, payload_bytes)
callback_business_iterations0
writer_typeOwnedWriter<Writer<4294967295, false, uint16_t, void>>
writer_apiWriter::write
ordinary_write_readbacktrue
sync_contextvoid
callback_wrapperFixedRecordCallback<PayloadBytes, Sink>
source_pool_payload_bytes268435456
reader_pool_payload_bytes268435456
ReaderWriterQueue: initialization shared by all message lengths

All 61 test-class parameters and constructor/template arguments are listed. Message lengths use one shared value list; derived capacities and fixed per-length copy choices use by_payload_bytes mappings instead of four repeated parameter sets.

Test-class parameters

ParameterValue
transportreaderwriterqueue
mode["throughput", "write_latency"]
payload_bytes[8, 16, 32, 64]
messages10000000
warmup_messages50000
callback_iterations0
verify_payloadfalse
prepared_inputtrue
variable_payloadtrue
prepared_input_limit_bytes268435456
measure_callback_timetrue
producer_interval_ns0
source_block_size65536
source_pool_min4096
source_pool_max4096
source_queue_capacity4096
writer_backpressuredrop
writer_spin_count1000
writer_wait_timeout_ms5000
output_block_size1048576
output_frame_capacity1024
output_pool_min256
output_pool_max256
output_queue_capacity512
cancel_claim_modetail
output_modespsc
output_reader_modewait_signal
output_reader_count1
output_retry_wait_us1000
output_enable_statsfalse
is_scan_currentfalse
reader_spin_count1000
rescan_interval_ns1000000
rescan_max_interval_ns1000000
consumer_cpu-1
producer_cpu-1
producer_qosuser_interactive
round_storage_bytes214748364
fixed_round_boundariestrue
spsc_buffer_bytes268435456
prefault_producer_bufferstrue
finish_timeout_ms5000
work_wait_min_ms1
finish_retry_ms1
publish_count4294967295
use_write_sessionfalse
rigtorp_write_prefetchfalse
readerwriterqueue_copy_after_zero{"by_payload_bytes": {"8": false, "16": true, "32": true, "64": false}}
spsc_capacity{"by_payload_bytes": {"8": 33488385, "16": 16743937, "32": 8371713, "64": 4185601}}
retry_yield_every1024
spsc_idle_spins0
spsc_idle_sleep_ns12500
timerauto
sample_every32
max_samples1000000
latency_batch_size1000
timer_calibration_samples16384
call_batch_size256
random_seed[42, 43, 44]
timeout_seconds180
buffer_budget_bytes536870912

Constructor and template arguments

ParameterValue
source_thread_id0
read_layer1_thread_count1
writer_queue_enable_statsfalse
message_prefix_bytes0
writer_count1
source_copy_thread_count0
callback_thread_count1
pool_depth_instrumentationfalse
callback_signature(thread_id, data, payload_bytes)
callback_business_iterations0
unused_fieldssource_* / output_* / reader_spin_count / rescan_* / is_scan_current / publish_count: native SPSC does not construct TwoBufQueue layers
upstream_unmodifiedtrue
requested_native_capacity{"by_payload_bytes": {"8": 33488385, "16": 16743937, "32": 8371713, "64": 4185601}}
native_templateReaderWriterQueue<Payload,512>
copy_policy{"by_payload_bytes": {"8": "full member copy", "16": "zero initialization then full memcpy", "32": "zero initialization then full memcpy", "64": "full member copy"}}
consumer_operationpeek → callback → pop
rigtorp/SPSCQueue: initialization shared by all message lengths

All 61 test-class parameters and constructor/template arguments are listed. Message lengths use one shared value list; derived capacities and fixed per-length copy choices use by_payload_bytes mappings instead of four repeated parameter sets.

Test-class parameters

ParameterValue
transportrigtorp
mode["throughput", "write_latency"]
payload_bytes[8, 16, 32, 64]
messages10000000
warmup_messages50000
callback_iterations0
verify_payloadfalse
prepared_inputtrue
variable_payloadtrue
prepared_input_limit_bytes268435456
measure_callback_timetrue
producer_interval_ns0
source_block_size65536
source_pool_min4096
source_pool_max4096
source_queue_capacity4096
writer_backpressuredrop
writer_spin_count1000
writer_wait_timeout_ms5000
output_block_size1048576
output_frame_capacity1024
output_pool_min256
output_pool_max256
output_queue_capacity512
cancel_claim_modetail
output_modespsc
output_reader_modewait_signal
output_reader_count1
output_retry_wait_us1000
output_enable_statsfalse
is_scan_currentfalse
reader_spin_count1000
rescan_interval_ns1000000
rescan_max_interval_ns1000000
consumer_cpu-1
producer_cpu-1
producer_qosuser_interactive
round_storage_bytes214748364
fixed_round_boundariestrue
spsc_buffer_bytes268435456
prefault_producer_bufferstrue
finish_timeout_ms5000
work_wait_min_ms1
finish_retry_ms1
publish_count4294967295
use_write_sessionfalse
rigtorp_write_prefetchtrue
readerwriterqueue_copy_after_zerofalse
spsc_capacity{"by_payload_bytes": {"8": 33554415, "16": 16777207, "32": 8388603, "64": 4194301}}
retry_yield_every1024
spsc_idle_spins4000
spsc_idle_sleep_ns1000
timerauto
sample_every32
max_samples1000000
latency_batch_size1000
timer_calibration_samples16384
call_batch_size256
random_seed[42, 43, 44]
timeout_seconds180
buffer_budget_bytes536870912

Constructor and template arguments

ParameterValue
source_thread_id0
read_layer1_thread_count1
writer_queue_enable_statsfalse
message_prefix_bytes0
writer_count1
source_copy_thread_count0
callback_thread_count1
pool_depth_instrumentationfalse
callback_signature(thread_id, data, payload_bytes)
callback_business_iterations0
unused_fieldssource_* / output_* / reader_spin_count / rescan_* / is_scan_current / publish_count: native SPSC does not construct TwoBufQueue layers
upstream_unmodifiedtrue
requested_native_capacity{"by_payload_bytes": {"8": 33554415, "16": 16777207, "32": 8388603, "64": 4194301}}
native_templaterigtorp::SPSCQueue<Payload>
copy_policymember initialization copy + destination write prefetch
consumer_operationfront → callback → pop
atomic_queue: initialization shared by all message lengths

All 61 test-class parameters and constructor/template arguments are listed. Message lengths use one shared value list; derived capacities and fixed per-length copy choices use by_payload_bytes mappings instead of four repeated parameter sets.

Test-class parameters

ParameterValue
transportatomic_queue
mode["throughput", "write_latency"]
payload_bytes[8, 16, 32, 64]
messages10000000
warmup_messages50000
callback_iterations0
verify_payloadfalse
prepared_inputtrue
variable_payloadtrue
prepared_input_limit_bytes268435456
measure_callback_timetrue
producer_interval_ns0
source_block_size65536
source_pool_min4096
source_pool_max4096
source_queue_capacity4096
writer_backpressuredrop
writer_spin_count1000
writer_wait_timeout_ms5000
output_block_size1048576
output_frame_capacity1024
output_pool_min256
output_pool_max256
output_queue_capacity512
cancel_claim_modetail
output_modespsc
output_reader_modewait_signal
output_reader_count1
output_retry_wait_us1000
output_enable_statsfalse
is_scan_currentfalse
reader_spin_count1000
rescan_interval_ns1000000
rescan_max_interval_ns1000000
consumer_cpu-1
producer_cpu-1
producer_qosuser_interactive
round_storage_bytes214748364
fixed_round_boundariestrue
spsc_buffer_bytes268435456
prefault_producer_bufferstrue
finish_timeout_ms5000
work_wait_min_ms1
finish_retry_ms1
publish_count4294967295
use_write_sessionfalse
rigtorp_write_prefetchfalse
readerwriterqueue_copy_after_zerofalse
spsc_capacity{"by_payload_bytes": {"8": 33554432, "16": 16777216, "32": 8388608, "64": 4194304}}
retry_yield_every1024
spsc_idle_spins2000
spsc_idle_sleep_ns10000
timerauto
sample_every32
max_samples1000000
latency_batch_size1000
timer_calibration_samples16384
call_batch_size256
random_seed[42, 43, 44]
timeout_seconds180
buffer_budget_bytes536870912

Constructor and template arguments

ParameterValue
source_thread_id0
read_layer1_thread_count1
writer_queue_enable_statsfalse
message_prefix_bytes0
writer_count1
source_copy_thread_count0
callback_thread_count1
pool_depth_instrumentationfalse
callback_signature(thread_id, data, payload_bytes)
callback_business_iterations0
unused_fieldssource_* / output_* / reader_spin_count / rescan_* / is_scan_current / publish_count: native SPSC does not construct TwoBufQueue layers
upstream_unmodifiedtrue
requested_native_capacity{"by_payload_bytes": {"8": 33554432, "16": 16777216, "32": 8388608, "64": 4194304}}
native_templateAtomicQueueB2<Payload,std::allocator<Payload>,true,false,true>
copy_policyfull member copy
consumer_operationtry_pop → callback

Methodology and environment

Retain the existing results, payload, copy strategy and selection rules.

Fixed test procedure

10 million messages per run, 50,000 warmup messages, callback iterations 0. Input is prepared before write timing, and every payload word varies.

Fixed round limit: 214,748,364 B, equal to 80% of the 256 MiB layer-2 budget. All queues use identical round boundaries; the final round ends at the actual message count.

Only accumulated producer write time is timed. End-of-round handoff, tail publication and callback draining occur outside timing; every message must still be consumed. TwoBufQueue copy and callback threads run independently.

Ordinary write reads back the first byte after the complete copy; Session does not add this readback.

Plateau rules for combined selection

Use common configurations measured at all four lengths. Writer candidates are three neighboring block sizes growing by powers of two; native SPSC candidates are three neighboring spin or wait settings.

The four-length composite scores of three neighboring configurations differ by at most 10%; the coefficient of variation of composite scores grouped by run number is at most 20%. Individual results, variation and neighborhood changes for every length are retained.

Every configuration passes complete validation. Three throughput and three latency runs succeed, with zero write failures, zero Writer backpressure and resolvable latency. Reference coefficients of variation remain capped at 20% / 25% / 40% / 60%.

All metrics use one configuration. Search-stage results are not mixed with earlier independent rechecks. This is the best combined plateau within the measured common configurations, not proof of a global optimum.

Host and build

macOS-14.4.1-arm64-arm-64bit · arm64 · 8 logical CPUs.

Clang 18.1.8 · Release · -O3 -DNDEBUG · no sanitizer.

Producer user_interactive QoS, without hard affinity; copy and callback threads are unpinned. Timer: mach_absolute_time; 1,000 writes per timing group.

Additional measurements use the original executable with identical SHA-256. Upstream headers, complete payloads and copy strategies are unchanged. AC power was confirmed beforehand.

Data and auditability

The original batch contains 1,284 complete validations and 9,708 measurements, with 0 failed runs. The additional ReaderWriterQueue neighborhood contains 24 complete validations and 144 measurements, with 0 failures.

The three reports share the same native SPSC controls. Copy strategies are fixed as disclosed in the table; they and compiler-generated code also affect results.

Earlier per-metric selections are backed up. All four metrics here use common configurations; reference values were fixed before additional measurements. Detailed run settings record actual mode and random_seed values.