Go: SHA-1 Gets a Speed Boost on Loong64

Julian Zhu optimized SHA-1 hashing performance specifically for Loong64 architecture by switching from loading immediate values into registers to using a static memory table for constant keys. The change delivers impressive performance gains of up to 6% faster hashing and 6.5% higher throughput across various data sizes on Loongson-3A5000 processors.

Duration: PT4M2S

Episode overview

This episode is a short developer briefing from Go.

It explains recent repository work in plain language.

  • Show: Go
  • Published: 2026-02-02T11:04:02Z
  • Audio duration: PT4M2S

Transcript excerpt

This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.

Hey there, fellow Go enthusiasts! Welcome back to another episode of Go. I'm your host, and it's February 2nd, 2026. I hope you're having a fantastic start to your week, whether you're debugging that tricky function or planning out your next big feature.

Today we're diving into something really cool that happened in the Go codebase – a perfect example of how thoughtful optimization can make a real difference in performance. Sometimes the best improvements come from understanding the specific hardware you're working with, and today's commit is a beautiful…

So what's the story? Julian Zhu made a targeted optimization to SHA-1 hashing specifically for the Loong64 architecture. Now, before your eyes glaze over thinking this is super niche – stick with me, because this is actually a fascinating look at how performance optimization works in the real world.

Here's what Julian did: instead of loading constant values directly into processor registers, the code now loads those same constants from a static memory table. It sounds like a small change, right? But the results are pretty impressive. We're talking about performance improvements ranging from about 3% to over 6%…

The benchmarks tell…

Wh…

Nearby episodes from Go

  1. The Great Type System Cleanup and Optimization Wins
  2. CGO Gets Cleaner and Cookie Parsing Gets Faster
  3. Compiler Deep Dive & Performance Wins
  4. Connection Reuse Revolution and Performance Wins
  5. PowerPC Progress and Performance Polish
  6. Linker Gets a Memory Diet and Performance Tune-Up
  7. Security Hardening and Low-Level Optimization Bonanza
  8. The Great Equality Overhaul