Why measure it yourself
Shred latency is a property of a path, not of a provider. The same feed reaches a server in one Frankfurt rack sooner than a server two hops further away, so any single number a vendor prints describes their test machine rather than yours. We publish no latency figure for Shreds or for Premium Shreds for exactly that reason.
What you can trust is a race run on the machine you will trade from. This script is that race. It needs Python 3 and nothing else, so there is no package to install and nothing to audit beyond the file shown on this page.
Set it up
- Point your current shred feed at UDP port 20001 on the receiving machine.
- Start a free Premium Shreds trial and register the same machine on UDP port 20002. The trial lasts 2 hours, which is plenty of time for several runs.
- Open both ports in the host firewall and in any cloud security group.
- Run the script for a minute:
sh
python3 first_shred.py 60To use other ports, edit the two numbers in FEEDS at the top of the file. The names in that line are only labels for the printout.
Read the result
The script prints the packet count per feed first. Check that before anything else: a count of zero means a feed is not arriving, and the comparison below it means nothing.
Next comes the number of shreds both feeds delivered. Only those take part in the race, because a shred one feed never sent has no winner.
Last, one line per feed that won at least once: the share of common shreds it delivered first, then its median lead and its 95th percentile lead in milliseconds. The median is the typical head start. The 95th percentile shows how large the lead gets on the slower moments, which is where a race is usually decided.
Accuracy
Python reads the clock after the kernel hands over each packet, so timings carry roughly a millisecond of noise from the interpreter. That is fine for comparing two feeds that differ by a few milliseconds. For finer resolution, read kernel receive timestamps (SO_TIMESTAMPNS on Linux) in a compiled receiver instead.
Run it more than once and at different times of day. Network paths change, and one sample is a moment rather than a pattern.
How it works out the answer
Bind one UDP socket per feed. Skip packets shorter than the 83-byte common header and our SHREDCAST-VERIFY datagram. Key every other packet by slot, index and variant, and keep the first arrival time per feed from a monotonic nanosecond clock. Compare only the shreds both feeds delivered. For each feed, report the share it won and the median and 95th percentile of its lead in milliseconds.
Questions
- Can I race Shreds against Premium Shreds with this script?
- Yes. Shreds and Premium Shreds each come with their own free 2 hour trial, once per person, so both can run on one machine at the same time. Give Shreds port 20001 and Premium Shreds port 20002, and the script reports how often the direct path wins and by what margin. The same setup races either plan against the feed you use today.
- Does the script work with any shred provider?
- Yes, as long as the provider delivers raw shreds as plain UDP datagrams. The script reads only the slot, index and variant from the fixed header at the front of every raw shred, so the source of the packets does not matter. Feeds wrapped in gRPC or another envelope will not parse.
- Why does one feed show more packets than the other?
- Feeds differ in completeness as well as speed. One may forward shreds the other never receives, and UDP loses some packets on the way. The race only counts shreds both feeds delivered, so a gap in counts does not distort the lead figures. Our FEC completeness check measures the difference directly.