Network & Storage
Latency, throughput, transfer time, read/seek, and compression functions.
From testdata/eval/success/features/network_functions.cm,
testdata/eval/success/features/storage_functions.cm,
and testdata/eval/success/features/compression.cm.
Network Latency (RTT) #
local_latency = rtt(local)
regional_latency = rtt(regional)
continental_latency = rtt(continental)
global_latency = rtt(global)Results
| local_latency = rtt(local) | → | 0.0005 second |
| regional_latency = rtt(regional) | → | 0.01 second |
| continental_latency = rtt(continental) | → | 0.05 second |
| global_latency = rtt(global) | → | 0.15 second |
Network Throughput #
gigabit_speed = throughput(gigabit)
ten_gig_speed = throughput(ten_gig)
hundred_gig = throughput(hundred_gig)
wifi_speed = throughput(wifi)
four_g_speed = throughput(four_g)
five_g_speed = throughput(five_g)Results
| gigabit_speed = throughput(gigabit) | → | 125 MB/s |
| ten_gig_speed = throughput(ten_gig) | → | 1.22 GB/s |
| hundred_gig = throughput(hundred_gig) | → | 12.2 GB/s |
| wifi_speed = throughput(wifi) | → | 12.5 MB/s |
| four_g_speed = throughput(four_g) | → | 2.5 MB/s |
| five_g_speed = throughput(five_g) | → | 50 MB/s |
Transfer Time (RTT + Transmission) #
api_call = transfer_time(1 KB, regional, gigabit)
file_download = transfer_time(1 GB, global, gigabit)
video_chunk = transfer_time(10 MB, regional, ten_gig)
large_file = transfer_time(500 MB, continental, gigabit)
# Use in calculations
total_latency = rtt(regional) + 5 ms
throughput_check = throughput(gigabit) * 0.9Results
| api_call = transfer_time(1 KB, regional, gigabit) | → | 0.01 second |
| file_download = transfer_time(1 GB, global, gigabit) | → | 8.34 second |
| video_chunk = transfer_time(10 MB, regional, ten_gig) | → | 0.018 second |
| large_file = transfer_time(500 MB, continental, gigabit) | → | 4.05 second |
| total_latency = rtt(regional) + 5 ms | → | 0.015 second |
| throughput_check = throughput(gigabit) * 0.9 | → | 113 MB/s |
Storage Read Times #
ssd_read_100mb = read(100 MB, ssd)
nvme_read_1gb = read(1 GB, nvme)
hdd_read_10mb = read(10 MB, hdd)
pcie_read_500gb = read(500 GB, pcie_ssd)
sata_read = read(50 MB, sata_ssd)Results
| ssd_read_100mb = read(100 MB, ssd) | → | 0.1818 second |
| nvme_read_1gb = read(1 GB, nvme) | → | 0.2926 second |
| hdd_read_10mb = read(10 MB, hdd) | → | 0.0667 second |
| pcie_read_500gb = read(500 GB, pcie_ssd) | → | 1.22 minute |
| sata_read = read(50 MB, sata_ssd) | → | 0.0909 second |
Seek/Access Latency #
hdd_seek = seek(hdd)
ssd_seek = seek(ssd)
nvme_seek = seek(nvme)
pcie_seek = seek(pcie_ssd)
sata_seek = seek(sata_ssd)Results
| hdd_seek = seek(hdd) | → | 0.01 second |
| ssd_seek = seek(ssd) | → | 0.0001 second |
| nvme_seek = seek(nvme) | → | 0 second |
| pcie_seek = seek(pcie_ssd) | → | 0 second |
| sata_seek = seek(sata_ssd) | → | 0.0001 second |
Combined Storage Operations #
db_query_hdd = seek(hdd) + read(5 MB, hdd)
cache_hit_ssd = seek(ssd) + read(1 MB, ssd)
sequential_scan = read(100 GB, nvme)
total_io_time = seek(hdd) * 100 + read(5 GB, hdd)Results
| db_query_hdd = seek(hdd) + read(5 MB, hdd) | → | 0.0433 second |
| cache_hit_ssd = seek(ssd) + read(1 MB, ssd) | → | 0.0019 second |
| sequential_scan = read(100 GB, nvme) | → | 29.3 second |
| total_io_time = seek(hdd) * 100 + read(5 GB, hdd) | → | 35.1 second |
Compression Estimates #
gzip_compressed = compress(1 GB, gzip)
lz4_compressed = compress(100 MB, lz4)
zstd_compressed = compress(500 MB, zstd)
bzip2_compressed = compress(1000 MB, bzip2)
snappy_compressed = compress(300 MB, snappy)
no_compression = compress(200 MB, none)
# Use in calculations
storage_savings = 10 GB - compress(10 GB, gzip)
compressed_transfer = transfer_time(compress(1 GB, lz4), global, gigabit)Results
| gzip_compressed = compress(1 GB, gzip) | → | 341 MB |
| lz4_compressed = compress(100 MB, lz4) | → | 50 MB |
| zstd_compressed = compress(500 MB, zstd) | → | 143 MB |
| bzip2_compressed = compress(1000 MB, bzip2) | → | 250 MB |
| snappy_compressed = compress(300 MB, snappy) | → | 120 MB |
| no_compression = compress(200 MB, none) | → | 200 MB |
| storage_savings = 10 GB - compress(10 GB, gzip) | → | 6.67 GB |
| compressed_transfer = transfer_time(compress(1 GB, lz4), global, gigabit) | → | 4.25 second |
What This Demonstrates #
- All network scope constants:
local,regional,continental,global - All connection types:
gigabit,ten_gig,hundred_gig,wifi,four_g,five_g - All storage types:
ssd,nvme,hdd,pcie_ssd,sata_ssd - All compression algorithms:
gzip,lz4,zstd,bzip2,snappy,none - Composing functions in arithmetic expressions
- Passing function results into other functions