<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Radek Ryckowski</title>
    <description>The latest articles on DEV Community by Radek Ryckowski (@radek_ryckowski_cb3149af5).</description>
    <link>https://dev.to/radek_ryckowski_cb3149af5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4264176%2Fcb6ae281-7747-4223-ab18-7cc7becc7dd8.png</url>
      <title>DEV Community: Radek Ryckowski</title>
      <link>https://dev.to/radek_ryckowski_cb3149af5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/radek_ryckowski_cb3149af5"/>
    <language>en</language>
    <item>
      <title>How I Built a Deterministic Neural Compressor in Go to Archive Audit Logs for Years</title>
      <dc:creator>Radek Ryckowski</dc:creator>
      <pubDate>Wed, 25 Nov 2026 08:38:48 +0000</pubDate>
      <link>https://dev.to/radek_ryckowski_cb3149af5/how-i-built-a-deterministic-neural-compressor-in-go-to-archive-audit-logs-for-years-2j83</link>
      <guid>https://dev.to/radek_ryckowski_cb3149af5/how-i-built-a-deterministic-neural-compressor-in-go-to-archive-audit-logs-for-years-2j83</guid>
      <description>&lt;p&gt;If you have ever been responsible for retaining years of audit logs, security events, or OpenTelemetry traces, you know the storage dilemma:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Compliance says keep everything&lt;/strong&gt; for 3, 5, or 7 years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud storage bills grow linearly&lt;/strong&gt; with your traffic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standard compressors (&lt;code&gt;gzip&lt;/code&gt;, &lt;code&gt;zstd&lt;/code&gt;, &lt;code&gt;xz&lt;/code&gt;) treat your logs like mystery bytes.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every single time &lt;code&gt;gzip&lt;/code&gt; or &lt;code&gt;zstd&lt;/code&gt; compresses a batch of audit logs, it starts from scratch. It has no idea that &lt;code&gt;"actor_type":"service_account"&lt;/code&gt; or &lt;code&gt;"status":{"code":1}&lt;/code&gt; appears ten thousand times an hour in your system. It has to rediscover your schema on every single file.&lt;/p&gt;

&lt;p&gt;On the flip side, modern &lt;strong&gt;neural compressors&lt;/strong&gt; can learn your exact data schema and squeeze out dramatically better compression ratios. So why doesn't everyone use them for long-term archives?&lt;/p&gt;

&lt;p&gt;Because in production, neural compression usually comes with three deal-breakers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's painfully slow&lt;/strong&gt; and drags heavy Python/GPU runtimes into your backend.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It breaks when your schema evolves&lt;/strong&gt; (if you retrain the model, old archives become unreadable).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It silently corrupts data across different CPUs&lt;/strong&gt; because floating-point math isn't 100% identical between Intel/AMD (&lt;code&gt;amd64&lt;/code&gt;) and Apple Silicon/Graviton (&lt;code&gt;arm64&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To solve this, I built &lt;strong&gt;&lt;a href="https://github.com/radryc/compressor" rel="noopener noreferrer"&gt;nzip&lt;/a&gt;&lt;/strong&gt;—a zero-dependency Go compressor powered by a tiny, &lt;strong&gt;100% integer-only neural network&lt;/strong&gt; trained on your specific data format.&lt;/p&gt;

&lt;p&gt;Here is how it works, what surprised me during benchmarking, and how you can use the same ideas for custom structured data.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Idea: Split Training from Compression
&lt;/h2&gt;

&lt;p&gt;Instead of shipping a heavy machine learning stack into production, &lt;code&gt;nzip&lt;/code&gt; splits the problem into two clean planes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  [ Control Plane: Python or Pure Go ]
  Sampled Audit Logs ──▶ Train tiny byte-level GRU ──▶ Verify on holdout ──▶ Export Model (.bin)
                                                                                    │
  [ Data Plane: Zero-Dependency Go ]                                                ▼
  Live Audit Stream  ──▶ Integer GRU + Match &amp;amp; Context Models ──▶ Arithmetic Coder ──▶ Archive (.nzip)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Train once on your schema:&lt;/strong&gt; You feed a 10–50 MB sample of your actual audit logs or telemetry JSON into the trainer. It learns the structure of &lt;em&gt;your&lt;/em&gt; payloads—field names, punctuation patterns, enum values, and common prefixes—and exports a tiny model file (typically under a few hundred kilobytes).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compress everywhere with pure Go:&lt;/strong&gt; Your production service loads that model into a dependency-free Go library (&lt;code&gt;stream.Writer&lt;/code&gt; / &lt;code&gt;stream.Reader&lt;/code&gt;). No Python, no CGO, no GPU required.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think of it like generating a custom, learned compression dictionary on steroids.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why "Integer-Only" Matters for 7-Year Archives
&lt;/h2&gt;

&lt;p&gt;When you archive audit data, &lt;strong&gt;decodability years later is non-negotiable&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In neural compression, the encoder and decoder both run the exact same model step-by-step to predict the probability of the next byte. If the decoder's math differs from the encoder's by even &lt;code&gt;0.000001&lt;/code&gt;, their probability tables drift out of sync—and every byte after that turns into garbage.&lt;/p&gt;

&lt;p&gt;During early testing, I ran into a classic systems trap: &lt;strong&gt;floating-point contraction&lt;/strong&gt;. On &lt;code&gt;arm64&lt;/code&gt;, compilers fuse &lt;code&gt;a * b + c&lt;/code&gt; into a single hardware FMA (Fused Multiply-Add) instruction with one rounding step. On &lt;code&gt;amd64&lt;/code&gt;, it executes as two separate instructions with two rounding steps.&lt;/p&gt;

&lt;p&gt;The result? Encoding a file on an x86 machine and decoding it on an ARM machine &lt;strong&gt;corrupted 3,869 out of 4,096 bytes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To make archives truly future-proof, &lt;code&gt;nzip&lt;/code&gt; eliminates floating-point math from the compression hot path completely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All model weights and activations are converted to &lt;strong&gt;fixed-point integers&lt;/strong&gt; (&lt;code&gt;int16&lt;/code&gt; and &lt;code&gt;int32&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Expensive math functions (&lt;code&gt;sigmoid&lt;/code&gt;, &lt;code&gt;tanh&lt;/code&gt;, &lt;code&gt;exp&lt;/code&gt;) are replaced with &lt;strong&gt;precomputed integer lookup tables&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;SIMD assembly (&lt;code&gt;SSE2&lt;/code&gt; on &lt;code&gt;amd64&lt;/code&gt;) and the pure-Go scalar fallback execute the exact same integer arithmetic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you decompress an archive tomorrow on an Intel laptop or in 2033 on an ARM server, the output is guaranteed to be bit-for-bit identical.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Gets Fast: 8 Yes/No Questions Instead of 256
&lt;/h2&gt;

&lt;p&gt;Early versions of neural compressors tried to predict all &lt;strong&gt;256 possible values&lt;/strong&gt; of the next byte at once using a &lt;code&gt;softmax&lt;/code&gt; layer. That required &lt;code&gt;256 × H&lt;/code&gt; matrix multiplications plus 256 &lt;code&gt;exp()&lt;/code&gt; calls &lt;em&gt;for every single byte&lt;/em&gt;. Throughput crawled at &lt;strong&gt;0.05 MB/s per core&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nzip&lt;/code&gt; flips this around by breaking every byte down into &lt;strong&gt;8 binary decisions&lt;/strong&gt; (one bit at a time, MSB to LSB):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Previous Bytes ──▶ [ Integer GRU + Classic Context Models ]
                            │
                            ├──▶ Bit 7 (0 or 1?)
                            ├──▶ Bit 6 (0 or 1?)
                            │      ...
                            └──▶ Bit 0 (0 or 1?) ──▶ Binary Arithmetic Coder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of asking &lt;em&gt;"Which of these 256 characters comes next?"&lt;/em&gt;, the engine asks &lt;em&gt;"Is the next bit a 1 or a 0?"&lt;/em&gt; eight times in a row. That shrinks the neural network math from &lt;code&gt;256 × H&lt;/code&gt; down to &lt;code&gt;8 × H&lt;/code&gt;—a &lt;strong&gt;25×–29× speedup&lt;/strong&gt;, pushing throughput to &lt;strong&gt;~1.2–1.7 MB/s per core&lt;/strong&gt; (and &lt;strong&gt;13.2 MB/s&lt;/strong&gt; across 32 threads).&lt;/p&gt;




&lt;h2&gt;
  
  
  Benchmarks &amp;amp; An Honest Reality Check
&lt;/h2&gt;

&lt;p&gt;To test &lt;code&gt;nzip&lt;/code&gt; against real-world observability and audit workloads, I benchmarked it on &lt;strong&gt;7.4 MB of OpenTelemetry JSON spans&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Crucially, these logs contained &lt;strong&gt;random hex &lt;code&gt;traceId&lt;/code&gt; and &lt;code&gt;spanId&lt;/code&gt; values&lt;/strong&gt;. Roughly 25% of the raw file was pure cryptographic randomness—which is mathematically impossible to compress. All the real savings had to come from exploiting structure.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Compressor&lt;/th&gt;
&lt;th&gt;Compressed Size&lt;/th&gt;
&lt;th&gt;Ratio&lt;/th&gt;
&lt;th&gt;Bits / Byte&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gzip -9&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;791,211 B&lt;/td&gt;
&lt;td&gt;10.65%&lt;/td&gt;
&lt;td&gt;0.85&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;xz -9e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;670,440 B&lt;/td&gt;
&lt;td&gt;9.02%&lt;/td&gt;
&lt;td&gt;0.72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;zstd -19 --long&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;667,324 B&lt;/td&gt;
&lt;td&gt;8.98%&lt;/td&gt;
&lt;td&gt;0.72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bzip2 -9&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;642,858 B&lt;/td&gt;
&lt;td&gt;8.65%&lt;/td&gt;
&lt;td&gt;0.69&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;&lt;code&gt;nzip&lt;/code&gt; (H=32, blocks)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;611,579 B&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;8.23%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.66&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;nzip&lt;/code&gt; produced archives &lt;strong&gt;20% smaller than &lt;code&gt;gzip -9&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;6% smaller than &lt;code&gt;zstd -19&lt;/code&gt; and &lt;code&gt;xz -9e&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;2% smaller than &lt;code&gt;bzip2 -9&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Ablation Twist: Neural Nets Aren't Magic Alone
&lt;/h3&gt;

&lt;p&gt;Here is the most interesting lesson from building this: &lt;strong&gt;if you run the neural network by itself, it actually loses to &lt;code&gt;gzip&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I isolated each component on a 1 MB test slice (&lt;code&gt;gzip -9&lt;/code&gt; = 97.6 KB), the numbers told a very clear story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GRU neural network alone:&lt;/strong&gt; 112.4 KB &lt;em&gt;(worse than gzip!)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Byte-matching alone:&lt;/strong&gt; 158.2 KB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Order-2 context table alone:&lt;/strong&gt; 180.3 KB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;All of them blended together:&lt;/strong&gt; &lt;strong&gt;84.8 KB&lt;/strong&gt; &lt;em&gt;(beats &lt;code&gt;bzip2&lt;/code&gt;, &lt;code&gt;xz&lt;/code&gt;, and &lt;code&gt;zstd&lt;/code&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why? Because a small neural network is great at learning &lt;strong&gt;global schema structure&lt;/strong&gt; (like JSON syntax and field transitions), while classic statistical models are much better at memorizing &lt;strong&gt;exact repeated strings&lt;/strong&gt; that just appeared 500 bytes ago (like a repeated &lt;code&gt;service.name&lt;/code&gt; or user UUID).&lt;/p&gt;

&lt;p&gt;By feeding the neural network's predictions alongside a multi-length match finder, an order-2 context table, and a run-length tracker into a lightweight mixer, each predictor covers the others' blind spots.&lt;/p&gt;




&lt;h2&gt;
  
  
  Built for Real Ingestion Pipelines
&lt;/h2&gt;

&lt;p&gt;Compressing one giant static file is easy. Production audit pipelines rarely work like that—they push thousands of tiny batches over the network, schemas drift over time, and files get corrupted on disk.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nzip&lt;/code&gt; bakes operational safety directly into the wire format (&lt;code&gt;NGR3&lt;/code&gt;) and Go API:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Three Ways to Move Bytes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blocks Mode (Default):&lt;/strong&gt; Splits large archives into independent blocks for multi-core parallel compression and fast random access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session Mode + Keyframes:&lt;/strong&gt; Keeps the neural network's hidden state warm across small streaming batches (with periodic keyframes so you can still seek/resume). In tests with &lt;strong&gt;64 × 2 KB batches&lt;/strong&gt;, session mode shrank the total payload from &lt;strong&gt;18.2 KB down to 7.2 KB&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dictionary Priming:&lt;/strong&gt; Just like &lt;code&gt;zstd&lt;/code&gt;, you can prime both encoder and decoder with a shared dictionary to eliminate cold-start overhead on tiny payloads—cutting a 50 KB stream from &lt;strong&gt;14.2% down to 4.0%&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Schema-Safe Retraining
&lt;/h3&gt;

&lt;p&gt;Every compressed stream header records the &lt;strong&gt;Model ID&lt;/strong&gt; and the &lt;strong&gt;CRC32C content hash&lt;/strong&gt; of the exact model artifact used to write it. When you retrain a model next month, the pipeline publishes a new content-addressed artifact without deleting old ones—so archives written last year never break.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Built-In Drift Detection
&lt;/h3&gt;

&lt;p&gt;Audit schemas evolve when developers add new fields. &lt;code&gt;nzip&lt;/code&gt; includes a rolling EWMA drift monitor (&lt;code&gt;drift.Monitor&lt;/code&gt;) that watches your live compression ratio in bits-per-byte and triggers an alert (or automated retrain) if compression degrades past your threshold.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quickstart: Using &lt;code&gt;nzip&lt;/code&gt; in CLI or Go
&lt;/h2&gt;

&lt;p&gt;You can train a model on your own log format and benchmark it against &lt;code&gt;gzip -9&lt;/code&gt; in four commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Build the zero-dependency Go binary&lt;/span&gt;
go build -o nzip ./cmd/nzip

&lt;span class="c"&gt;# 2. Train a schema-specific model on a sample of your logs&lt;/span&gt;
./nzip train -data audit-sample.ndjson -out models/audit-v1.bin -model-id 1 -hidden 32 -epochs 6

&lt;span class="c"&gt;# 3. Benchmark against gzip -9 on a holdout file it has never seen&lt;/span&gt;
./nzip bench -model models/audit-v1.bin -in holdout.ndjson

&lt;span class="c"&gt;# 4. Compress and verify with full CRC32C integrity checks&lt;/span&gt;
./nzip compress -model models/audit-v1.bin -in audit.ndjson -out audit.nzip
./nzip verify -models ./models -in audit.nzip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you want to embed it directly inside a Go ingestion service, it implements standard &lt;code&gt;io.Writer&lt;/code&gt; and &lt;code&gt;io.Reader&lt;/code&gt; interfaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Streaming compressor: keeps model state warm across small batches&lt;/span&gt;
&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NewWriter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"audit-logs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WithMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ModeSession&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WithDictionary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Fatal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;batch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Flush&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Streaming decompressor: looks up the exact model hash from the stream header&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NewReader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Fatal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;If you are archiving homogeneous, high-volume structured records—audit trails, telemetry spans, financial event logs—general-purpose compression algorithms leave real storage savings on the table.&lt;/p&gt;

&lt;p&gt;You don't need a massive LLM or a GPU cluster to take advantage of learned compression. A tiny, integer-only neural network combined with classic context modeling gives you &lt;strong&gt;better-than-&lt;code&gt;bzip2&lt;/code&gt; ratios&lt;/strong&gt;, &lt;strong&gt;multi-core Go performance&lt;/strong&gt;, and &lt;strong&gt;deterministic cross-CPU safety&lt;/strong&gt; you can trust years down the road.&lt;/p&gt;

&lt;p&gt;Check out the full source code, wire format docs, and benchmarks on GitHub: &lt;strong&gt;&lt;a href="https://github.com/radryc/compressor" rel="noopener noreferrer"&gt;github.com/radryc/compressor&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>performance</category>
      <category>architecture</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
