Latency first: how fast is GPIBee, really?

Bar chart of the time one short query takes, with GPIBee USBTMC fastest at 1.42 milliseconds and the high-end USB adapter at 2.78 milliseconds
Time for one short *IDN? round trip. Four of the five GPIBee modes come in under the high-end USB adapter.

Why latency matters more than throughput

Think about what a measurement script actually sends: FREQ 1E6, MEAS:VOLT?, *OPC?. A command is a dozen bytes. The answer is a dozen bytes. Hundreds of such calls go by for every large block that is ever read from an instrument.

At a few hundred kilobytes per second, 20 bytes need a few hundredths of a millisecond on the wire. Yet a short query takes between 1.4 and 4 milliseconds in our tests. More than 95 % of that time is fixed cost per call: the adapter, the driver, the bus handshake and the instrument itself. Raw speed hardly enters into it.

That fixed cost adds up quickly. A script that runs 10,000 queries needs about 14 seconds at 730 queries per second, and about 27 seconds at 364 queries per second. Same instrument, same program, only the adapter differs.

How we measured

We connected a Rohde & Schwarz CMU200 and ran the same benchmark against every GPIBEE interface mode: Ethernet with VXI-11, Ethernet with the Prologix-style ++ protocol, USBTMC, USB VXI-11, and the UART with the ++ protocol. As a reference we used a popular USB high-speed GPIB adapter from a large vendor, one that costs considerably more than GPIBEE.

All modes except the two ++ protocol ones were driven through a VISA library. The ++ modes talk to the adapter directly. Each setup was measured once, with 1,000 queries per latency test, so treat differences of a few percent with care.

Short queries: GPIBEE answers faster

The first chart shows how long one complete *IDN? round trip takes: command out, answer back. Lower is better.

Time for one short query

Typical round trip of an *IDN? query in milliseconds. Lower is better.

GPIBEEHigh-end USB adapter
msGPIBee USBTMC: 1.42 msGPIBEE USBTMC1.42 msGPIBee Ethernet (++ protocol): 1.71 msGPIBEE Ethernet (++ protocol)1.71 msGPIBee Ethernet (VXI-11): 1.97 msGPIBEE Ethernet (VXI-11)1.97 msGPIBee USB VXI-11: 2.04 msGPIBEE USB VXI-112.04 msHigh-end USB adapter: 2.78 msHigh-end USB adapter2.78 msGPIBee UART (++ protocol): 3.98 msGPIBEE UART (++ protocol)3.98 ms

Four of the five GPIBEE modes beat the high-end USB adapter. USBTMC needs 1.42 ms, about half of the 2.78 ms of the reference. Ethernet and USB VXI-11 land between 1.7 and 2.0 ms. The UART mode is the exception: a serial line cannot compete, and it is there for compatibility, not for speed.

Queries per second

How many query and answer pairs fit into one second, back to back. Higher is better.

GPIBEEHigh-end USB adapter
queries/sGPIBee USBTMC: 730 queries/sGPIBEE USBTMC730 queries/sGPIBee Ethernet (++ protocol): 605 queries/sGPIBEE Ethernet (++ protocol)605 queries/sGPIBee Ethernet (VXI-11): 520 queries/sGPIBEE Ethernet (VXI-11)520 queries/sGPIBee USB VXI-11: 501 queries/sGPIBEE USB VXI-11501 queries/sHigh-end USB adapter: 364 queries/sHigh-end USB adapter364 queries/sGPIBee UART (++ protocol): 252 queries/sGPIBEE UART (++ protocol)252 queries/s
730 /s
GPIBEE USBTMC, the fastest mode
364 /s
High-end USB adapter
2×
more queries per second with USBTMC

Large transfers: everybody lands in the same range

Throughput still counts when you read a waveform or download a file from an instrument. We wrote a block to the instrument and read a binary file back, in sizes from 256 bytes to 1 MiB.

Writing to the instrument

Speed against size of one transfer. Small transfers are limited by the fixed cost per call, large ones by the link.

GPIBEE USBTMCGPIBEE Ethernet (VXI-11)High-end USB adapter
Write speed against transfer size0100200300400500600700256 B1 KiB4 KiB16 KiB64 KiB256 KiB1 MiBsize of one transferkB/sGPIBee USBTMC, 256 B: 55 kB/sGPIBee USBTMC, 1 KiB: 160 kB/sGPIBee USBTMC, 4 KiB: 309 kB/sGPIBee USBTMC, 16 KiB: 385 kB/sGPIBee USBTMC, 64 KiB: 391 kB/sGPIBee USBTMC, 256 KiB: 402 kB/sGPIBee USBTMC, 1 MiB: 399 kB/sGPIBEE USBTMCGPIBee Ethernet (VXI-11), 256 B: 52 kB/sGPIBee Ethernet (VXI-11), 1 KiB: 147 kB/sGPIBee Ethernet (VXI-11), 4 KiB: 301 kB/sGPIBee Ethernet (VXI-11), 16 KiB: 395 kB/sGPIBee Ethernet (VXI-11), 64 KiB: 397 kB/sGPIBee Ethernet (VXI-11), 256 KiB: 415 kB/sGPIBee Ethernet (VXI-11), 1 MiB: 415 kB/sGPIBEE Ethernet (VXI-11)High-end USB adapter, 256 B: 50 kB/sHigh-end USB adapter, 1 KiB: 148 kB/sHigh-end USB adapter, 4 KiB: 329 kB/sHigh-end USB adapter, 16 KiB: 433 kB/sHigh-end USB adapter, 64 KiB: 447 kB/sHigh-end USB adapter, 256 KiB: 461 kB/sHigh-end USB adapter, 1 MiB: 455 kB/sHigh-end USB adapter

Reading from the instrument

A binary file is read back and checked byte by byte.

GPIBEE USBTMCGPIBEE Ethernet (VXI-11)High-end USB adapter
Read speed against transfer size0100200300400500600700256 B1 KiB4 KiB16 KiB64 KiB256 KiB1 MiBsize of one transferkB/sGPIBee USBTMC, 256 B: 92 kB/sGPIBee USBTMC, 1 KiB: 241 kB/sGPIBee USBTMC, 4 KiB: 397 kB/sGPIBee USBTMC, 16 KiB: 471 kB/sGPIBee USBTMC, 64 KiB: 509 kB/sGPIBee USBTMC, 256 KiB: 528 kB/sGPIBee USBTMC, 1 MiB: 491 kB/sGPIBEE USBTMCGPIBee Ethernet (VXI-11), 256 B: 116 kB/sGPIBee Ethernet (VXI-11), 1 KiB: 238 kB/sGPIBee Ethernet (VXI-11), 4 KiB: 352 kB/sGPIBee Ethernet (VXI-11), 16 KiB: 394 kB/sGPIBee Ethernet (VXI-11), 64 KiB: 409 kB/sGPIBee Ethernet (VXI-11), 256 KiB: 413 kB/sGPIBee Ethernet (VXI-11), 1 MiB: 401 kB/sGPIBEE Ethernet (VXI-11)High-end USB adapter, 256 B: 123 kB/sHigh-end USB adapter, 1 KiB: 297 kB/sHigh-end USB adapter, 4 KiB: 501 kB/sHigh-end USB adapter, 16 KiB: 603 kB/sHigh-end USB adapter, 64 KiB: 636 kB/sHigh-end USB adapter, 256 KiB: 646 kB/sHigh-end USB adapter, 1 MiB: 591 kB/sHigh-end USB adapter

Both curves look alike: slow for tiny transfers, flat from about 16 KiB on. In the VXI-11, USB and USBTMC modes GPIBEE writes at about 400 to 415 kB/s and reads at 413 to 528 kB/s, and the high-end adapter is slightly ahead on big blocks. Its best read speed is 646 kB/s against 528 kB/s for GPIBEE USBTMC. Transfer speed also scales with the T1 time, the data settling time in the GPIB handshake. It was set to 500 ns on both adapters in these tests, GPIBEE and the high-end adapter alike, so the comparison is fair. Other T1 settings give other speeds. At these rates the GPIB handshake and the instrument itself usually set the ceiling, which is why the spread between adapters is small compared with the factor of two we saw in query speed.

One more latency number sits inside the read test. When a program fetches data in small pieces, every read call has a price. With the smallest buffer one call costs 172 µs on GPIBEE USBTMC and about 450 µs on Ethernet and USB VXI-11. The high-end adapter needs 1.45 ms per call. Programs that read in small chunks profit from that difference.

Why your numbers will differ. Maximum speeds in data sheets are typically measured against a logic-coupled dongle exercising the three-wire handshake with the minimum possible latency: a test fixture on the bus that answers without any processing on the instrument side. A real instrument is different. It parses the command, does its own work and then answers, so latency, queries per second and throughput all depend on the instrument as much as on the adapter. Our own results show it: the CMU200 above answers *IDN? in 1.4 to 4 ms, while the instrument in the stress test below needs about 14 ms for the same query, whatever adapter is used. Read every KPI in this article as "with this instrument", and measure with yours.

All numbers at a glance

We show all values, including the ones where GPIBEE is not the best. Green marks the best value in a row, orange the weakest, whoever it belongs to, with gradients in between. The best value is also bold. GPIBEE leads in query speed and in the cost per read call, the high-end adapter is ahead in large reads and writes.

GPIBEEHigh-end USB adapter
USBTMCUSB VXI-11Ethernet VXI-11Ethernet ++Prologix
compatible
UART ++Prologix
compatible
Short query (ms)1.422.041.971.713.982.78
Queries per second730501520605252364
Best write speed (kB/s)402405415372496461
Best read speed (kB/s)52841541317199646
Time per read call, smallest buffer172 µs472 µs447 µs––1.45 ms

The two ++ columns are the Prologix compatible protocol mode, where the adapter is addressed directly over a socket or a serial port instead of through a VISA library.

Looking at every single query

A typical value tells you little about how a setup behaves over a long run. So we ran a stress test, this time with a different instrument, not the Rohde & Schwarz CMU200 used above: three short queries, *IDN?, FREQ:CW? and SYST:ERR?, sent again and again. That makes 1.7 million rounds over GPIBEE USB, 0.95 million over GPIBEE Ethernet and 1.2 million with the high-end USB adapter, in total more than 11 million timed transfers. Every one of them went into a time bucket of 0.1 ms. The curves show what share of all queries landed in each bucket.

The three plots below are histograms. For now we leave out the extreme slow cases. More about those at the end.

Histogram: SYST:ERR? – read the error queue

Share of queries per 0.1 ms bucket. A curve further left is faster, a narrow curve is more consistent. Hover for values.

GPIBEE USBGPIBEE EthernetHigh-end USB adapter
0%10%20%30%40%50%2345678time for one query in milliseconds

Histogram: FREQ:CW? – read the frequency setting

Same view for a query that returns a number.

GPIBEE USBGPIBEE EthernetHigh-end USB adapter
0%5%10%15%20%25%23456789time for one query in milliseconds

All three adapters draw the same picture: a sharp peak and a short tail to the right.

  • GPIBEE USB and the high-end adapter are almost identical. A FREQ:CW? query takes about 3.0 ms on GPIBEE and 3.1 ms on the reference, a SYST:ERR? query about 2.9 ms on both.
  • GPIBEE Ethernet is the fastest in this test, with about 2.4 ms for FREQ:CW? and 2.7 ms for SYST:ERR?.
  • Timing is consistent. Out of 100 FREQ:CW? queries, 99 are answered within about 5 ms on every adapter; for SYST:ERR? it is about 4 ms.
  • Ethernet has a longer tail. One in a thousand queries needs more than 9 ms there, against 5 to 7 ms on USB. That is what you expect when a network sits in the path: Ethernet latency also depends on network load. Just like ping times, which vary with the traffic on the network, GPIBEE query times over Ethernet are shorter on a quiet network and longer on a busy one. The Ethernet results here are therefore specific to our test network, and yours will depend on its load.

Why *IDN? takes so much longer

The third query behaves differently. Where the other two finish in about 3 ms, *IDN? needs almost 14 ms.

Histogram: *IDN? – ask for the identification

Note the different time axis: all curves sit around 14 ms.

GPIBEE USBGPIBEE EthernetHigh-end USB adapter
0%5%10%15%121314151617181920time for one query in milliseconds

The curves of all three adapters sit close together, with typical times within a third of a millisecond: about 13.7 ms on GPIBEE Ethernet, 13.8 ms on the high-end adapter and 14.0 ms on GPIBEE USB. Neither the interface nor the adapter changes it. The time is most likely spent in the instrument itself, which has to assemble and send its identification string. It depends on the instrument: the CMU200 in the first test answers *IDN? in 1.4 to 4 ms.

The practical consequence: do not use *IDN? as a quick "is the instrument still there" check inside a measurement loop. Ask once at startup, and use a cheaper query when you need to poll.

One more thing: a lesson for your timeouts

Every chart above has one thing in common. We left something out, and it is worth knowing about when you choose a timeout.

Here is the same data again as a histogram, one per adapter, this time with every measurement and no filter. Both scales are logarithmic: the time axis runs from 1 ms to over a second, and the count axis is stretched so that even a single query is visible.

Histogram of everything we measured

Each bar counts the queries in one time bucket, summed over the three query types. Hover for values.

Histogram of all measured query durations per adapter, time axis logarithmic, count axis logarithmic. A few queries took about one second.110010,0001,000,000GPIBEE via USBGPIBee via USB: 2.5 to 2.7 ms, 9,935 queriesGPIBee via USB: 2.7 to 2.9 ms, 982,355 queriesGPIBee via USB: 2.9 to 3.2 ms, 1,713,386 queriesGPIBee via USB: 3.2 to 3.4 ms, 241,815 queriesGPIBee via USB: 3.4 to 3.7 ms, 211,426 queriesGPIBee via USB: 3.7 to 4.0 ms, 119,095 queriesGPIBee via USB: 4.0 to 4.3 ms, 59,084 queriesGPIBee via USB: 4.3 to 4.6 ms, 35,079 queriesGPIBee via USB: 4.6 to 5.0 ms, 25,336 queriesGPIBee via USB: 5.0 to 5.4 ms, 9,788 queriesGPIBee via USB: 5.4 to 5.8 ms, 4,368 queriesGPIBee via USB: 5.8 to 6.3 ms, 3,778 queriesGPIBee via USB: 6.3 to 6.8 ms, 2,537 queriesGPIBee via USB: 6.8 to 7.4 ms, 1,011 queriesGPIBee via USB: 7.4 to 7.9 ms, 248 queriesGPIBee via USB: 7.9 to 8.6 ms, 230 queriesGPIBee via USB: 8.6 to 9.3 ms, 204 queriesGPIBee via USB: 9.3 to 10.0 ms, 200 queriesGPIBee via USB: 10.0 to 10.8 ms, 100 queriesGPIBee via USB: 10.8 to 11.7 ms, 58 queriesGPIBee via USB: 11.7 to 12.6 ms, 64 queriesGPIBee via USB: 12.6 to 13.6 ms, 182,765 queriesGPIBee via USB: 13.6 to 14.7 ms, 1,390,131 queriesGPIBee via USB: 14.7 to 15.8 ms, 126,748 queriesGPIBee via USB: 15.8 to 17.1 ms, 6,282 queriesGPIBee via USB: 17.1 to 18.5 ms, 3,647 queriesGPIBee via USB: 18.5 to 20.0 ms, 599 queriesGPIBee via USB: 20.0 to 21.5 ms, 58 queriesGPIBee via USB: 21.5 to 23.3 ms, 27 queriesGPIBee via USB: 23.3 to 25.1 ms, 23 queriesGPIBee via USB: 25.1 to 27.1 ms, 9 queriesGPIBee via USB: 27.1 to 29.3 ms, 3 queriesGPIBee via USB: 29.3 to 31.6 ms, 1 queriesGPIBee via USB: 31.6 to 34.1 ms, 2 queriesGPIBee via USB: 36.9 to 39.8 ms, 1 queriesGPIBee via USB: 39.8 to 43.0 ms, 2 queriesGPIBee via USB: 1000.0 to 1079.8 ms, 1 queries1 query110010,0001,000,000GPIBEE via EthernetGPIBee via Ethernet: 1.8 to 2.0 ms, 62 queriesGPIBee via Ethernet: 2.0 to 2.2 ms, 86,583 queriesGPIBee via Ethernet: 2.2 to 2.3 ms, 158,907 queriesGPIBee via Ethernet: 2.3 to 2.5 ms, 296,974 queriesGPIBee via Ethernet: 2.5 to 2.7 ms, 786,816 queriesGPIBee via Ethernet: 2.7 to 2.9 ms, 197,488 queriesGPIBee via Ethernet: 2.9 to 3.2 ms, 175,203 queriesGPIBee via Ethernet: 3.2 to 3.4 ms, 75,533 queriesGPIBee via Ethernet: 3.4 to 3.7 ms, 58,898 queriesGPIBee via Ethernet: 3.7 to 4.0 ms, 24,379 queriesGPIBee via Ethernet: 4.0 to 4.3 ms, 11,709 queriesGPIBee via Ethernet: 4.3 to 4.6 ms, 6,760 queriesGPIBee via Ethernet: 4.6 to 5.0 ms, 4,888 queriesGPIBee via Ethernet: 5.0 to 5.4 ms, 2,615 queriesGPIBee via Ethernet: 5.4 to 5.8 ms, 1,541 queriesGPIBee via Ethernet: 5.8 to 6.3 ms, 1,017 queriesGPIBee via Ethernet: 6.3 to 6.8 ms, 506 queriesGPIBee via Ethernet: 6.8 to 7.4 ms, 232 queriesGPIBee via Ethernet: 7.4 to 7.9 ms, 181 queriesGPIBee via Ethernet: 7.9 to 8.6 ms, 720 queriesGPIBee via Ethernet: 8.6 to 9.3 ms, 439 queriesGPIBee via Ethernet: 9.3 to 10.0 ms, 315 queriesGPIBee via Ethernet: 10.0 to 10.8 ms, 211 queriesGPIBee via Ethernet: 10.8 to 11.7 ms, 380 queriesGPIBee via Ethernet: 11.7 to 12.6 ms, 421 queriesGPIBee via Ethernet: 12.6 to 13.6 ms, 467,136 queriesGPIBee via Ethernet: 13.6 to 14.7 ms, 460,663 queriesGPIBee via Ethernet: 14.7 to 15.8 ms, 14,538 queriesGPIBee via Ethernet: 15.8 to 17.1 ms, 3,567 queriesGPIBee via Ethernet: 17.1 to 18.5 ms, 1,478 queriesGPIBee via Ethernet: 18.5 to 20.0 ms, 606 queriesGPIBee via Ethernet: 20.0 to 21.5 ms, 84 queriesGPIBee via Ethernet: 21.5 to 23.3 ms, 137 queriesGPIBee via Ethernet: 23.3 to 25.1 ms, 8 queriesGPIBee via Ethernet: 25.1 to 27.1 ms, 14 queriesGPIBee via Ethernet: 27.1 to 29.3 ms, 2 queriesGPIBee via Ethernet: 31.6 to 34.1 ms, 1 queriesGPIBee via Ethernet: 34.1 to 36.9 ms, 1 queriesGPIBee via Ethernet: 43.0 to 46.4 ms, 1 queriesGPIBee via Ethernet: 46.4 to 50.1 ms, 2 queriesGPIBee via Ethernet: 1000.0 to 1079.8 ms, 2 queries2 queries110010,0001,000,000High-end USB adapterHigh-end USB adapter: 2.5 to 2.7 ms, 72 queriesHigh-end USB adapter: 2.7 to 2.9 ms, 754,462 queriesHigh-end USB adapter: 2.9 to 3.2 ms, 971,406 queriesHigh-end USB adapter: 3.2 to 3.4 ms, 187,156 queriesHigh-end USB adapter: 3.4 to 3.7 ms, 221,156 queriesHigh-end USB adapter: 3.7 to 4.0 ms, 111,308 queriesHigh-end USB adapter: 4.0 to 4.3 ms, 47,917 queriesHigh-end USB adapter: 4.3 to 4.6 ms, 24,554 queriesHigh-end USB adapter: 4.6 to 5.0 ms, 15,100 queriesHigh-end USB adapter: 5.0 to 5.4 ms, 6,687 queriesHigh-end USB adapter: 5.4 to 5.8 ms, 3,148 queriesHigh-end USB adapter: 5.8 to 6.3 ms, 2,023 queriesHigh-end USB adapter: 6.3 to 6.8 ms, 954 queriesHigh-end USB adapter: 6.8 to 7.4 ms, 326 queriesHigh-end USB adapter: 7.4 to 7.9 ms, 74 queriesHigh-end USB adapter: 7.9 to 8.6 ms, 77 queriesHigh-end USB adapter: 8.6 to 9.3 ms, 93 queriesHigh-end USB adapter: 9.3 to 10.0 ms, 99 queriesHigh-end USB adapter: 10.0 to 10.8 ms, 52 queriesHigh-end USB adapter: 10.8 to 11.7 ms, 20 queriesHigh-end USB adapter: 11.7 to 12.6 ms, 13 queriesHigh-end USB adapter: 12.6 to 13.6 ms, 312,564 queriesHigh-end USB adapter: 13.6 to 14.7 ms, 836,990 queriesHigh-end USB adapter: 14.7 to 15.8 ms, 17,984 queriesHigh-end USB adapter: 15.8 to 17.1 ms, 2,584 queriesHigh-end USB adapter: 17.1 to 18.5 ms, 2,899 queriesHigh-end USB adapter: 18.5 to 20.0 ms, 323 queriesHigh-end USB adapter: 20.0 to 21.5 ms, 29 queriesHigh-end USB adapter: 21.5 to 23.3 ms, 23 queriesHigh-end USB adapter: 23.3 to 25.1 ms, 18 queriesHigh-end USB adapter: 25.1 to 27.1 ms, 7 queriesHigh-end USB adapter: 27.1 to 29.3 ms, 1 queriesHigh-end USB adapter: 31.6 to 34.1 ms, 1 queriesHigh-end USB adapter: 34.1 to 36.9 ms, 1 queriesHigh-end USB adapter: 36.9 to 39.8 ms, 1 queriesHigh-end USB adapter: 39.8 to 43.0 ms, 1 queriesHigh-end USB adapter: 1000.0 to 1079.8 ms, 2 queries2 queries1 ms10 ms100 ms1 stime for one query (logarithmic axis)number of queries (logarithmic)

Almost everything happens within the first few milliseconds, as the charts above showed. Then, far out at about one second, come five lonely queries. Five queries out of more than 11 million took more than 70 times longer than even a typical *IDN?, and several hundred times longer than the other two queries.

It is not a GPIBEE quirk, and it is not an adapter quirk at all. It is instrument behavior. The high-end USB adapter shows it just as well, and all five cases were *IDN? queries. The other two queries never came close to one second, not once in millions of transfers. The behavior belongs to the specific instrument we tested.

Our suspicion: to answer *IDN?, this instrument may ask several internal subsystem boards over slower interfaces. If one of them answers late, the instrument may run into an internal timeout and retry, or do something similar. That is only a guess; the real reason is unknown. What is certain is that it happened, on both adapters, for this instrument. So the lesson is about what a measured transfer time can and cannot tell you:

AdapterQueryTime for this one query
GPIBEE via USB*IDN?1,030.8 ms
GPIBEE via Ethernet*IDN?1,013.9 ms
GPIBEE via Ethernet*IDN?1,030.5 ms
High-end USB adapter*IDN?1,042.8 ms
High-end USB adapter*IDN?1,043.0 ms

Lesson: a typical time is not a worst case. A timeout of 10 ms looks generous next to a typical 3 ms, and 100 ms looks very safe. A timeout of one second, which many people pick as "plenty", would have fired five times in this test.

What to consider when you set timeouts:

  • Never set a timeout close to a transfer time you have measured. A single measurement, or even millions of them, does not show the slowest case.
  • Use seconds for ordinary queries, and add generous margin on top of the longest operation your instrument can legitimately do.
  • Decide in your software what happens when a timeout hits anyway: retry the query, or log it and continue.

Instruments can have rare slow responses of their own that no adapter can remove, and other parts of the chain, such as the bus, driver and operating system, can add their own. Good software expects them.

Measured with the GPIBEE KPI tool. Query speed and throughput come from one run per setup against a Rohde & Schwarz CMU200; the timing histograms come from a separate long-running stress test with the three queries named above, measured with another instrument, not the CMU200. Slow-case times are rounded to the 0.1 ms bucket they fell into.

← All news