A Very Fast IPv4 Parser, in Swift

Tech & AIblog.mahdibm.com

A Very Fast IPv4 Parser, in Swift

No lookup tables, SIMD, or out-of-bounds reads: just SWAR. Beating almost every implementation in ~3 nanoseconds.

Quick read

A blog post describing a new Swift algorithm for parsing IPv4 textual addresses using SWAR (SIMD Within A Register) techniques to achieve very low-latency parsing. Someone would visit to learn the algorithmic approach, implementation details, and performance rationale for a fast, portable IPv4 parser in Swift.

  • Explains a SWAR-based IPv4 parsing algorithm and its assumptions
  • Shows how to fetch and process byte windows for parallel parsing
  • Discusses trade-offs versus lookup tables and SIMD portability

Reactions

No reactions yet. Record a short about this link and it shows up here, in Reels and in the community feed.

Is blog.mahdibm.com your site? Sign in to verify it and get a Verified badge, full stats and a link-back badge.

A closer look at A Very Fast IPv4 Parser, in Swift

What this post is about

A blog post describing a new IPv4 text-parsing algorithm implemented in Swift. The author focuses on achieving high throughput without lookup tables or out-of-bounds reads, using SWAR (SIMD Within A Register) and instruction-level parallelism.

The article explains why existing high-performance parsers that rely on padding, null terminators or platform-specific SIMD are not a great fit for Swift, and motivates a scalar+SWAR approach that leans on compiler-friendly code and predictable performance.

What you can actually do on the page

Read a detailed explanation of the algorithm, including the core observations about where each IPv4 segment must live within the byte window and why fetching short windows is enough to find segments.

See reasoning about using SWAR techniques: packing bytes into 64-bit registers, XORing with 0x30 to normalize ASCII digits, and exploiting independent instructions so the CPU can run multiple operations per cycle. The post outlines the algorithm and includes example implementation sketches.

Who will find this useful

Swift systems programmers and library authors interested in parsing and serializing IP addresses with attention to performance and portability across CPUs.

Anyone comparing IPv4 parsing strategies who cares about avoiding lookup tables, minimizing memory dependence, and writing code that LLVM can auto-vectorize or that uses SWAR-friendly scalar code paths.

Questions people ask about A Very Fast IPv4 Parser, in Swift

Does the article include benchmarks?
Yes - the post mentions benchmark results (Apple M6) and compares the new algorithm to other implementations, and links performance discussion to the swift-endpoint README.
Does the algorithm rely on lookup tables or unsafe memory reads?
No - the author emphasizes avoiding lookup tables and out-of-bounds reads, relying instead on SWAR and instruction-level parallelism.
Is this specific to Apple platforms or Swift only?
The implementation is written in Swift and motivated by Swift's ecosystem, but the discussion covers portability concerns and seeks approaches that do not depend on platform-specific SIMD.

A Very Fast IPv4 Parser, in Swift was shared on NexURLs by Nexis on November 1, 2026, in Tech & AI.

What we found on this site

Served through
Cloudflare
Home page answered in
186 ms
Trackers
None found
Ads
None found
RSS feed
Yes
AI crawlers
Blocks OpenAI, Anthropic, Google, Apple and Meta
Set up for phones
Yes
Real-visitor speed
Not enough visitors for Google data
Popularity
Top 200,000 domain (Cloudflare)
Google safety check
No threats found
Domain registered
2021
Domain renews
May 2035

Checked November 1, 2026 from the site’s own code and public records. See how the rest of the web compares in the NexURLs Internet Report.

Quick answers

What is A Very Fast IPv4 Parser, in Swift?

A Very Fast IPv4 Parser, in Swift (blog.mahdibm.com): A blog post describing a new Swift algorithm for parsing IPv4 textual addresses using SWAR (SIMD Within A Register) techniques to achieve very low-latency parsing. Someone would visit to learn the algorithmic approach, implementation details, and performance rationale for a fast, portable IPv4...

Who shared A Very Fast IPv4 Parser, in Swift on NexURLs?

It was shared by Nexis in November 2026. Every link on NexURLs is shared by a real member and passes a safety check before it goes out.

What are some sites like A Very Fast IPv4 Parser, in Swift?

Members found these close to it: A faster way to compute signed 64-bit floor division by constants, Making dns_erlang Fast, A fast and secure tar parser for the Rust ecosystem. The full list is on this page under Sites like A Very Fast IPv4 Parser, in Swift.

Sites like A Very Fast IPv4 Parser, in Swift

More Tech & AI finds

All Tech & AI websites →

Feeling lucky? Try the random website generator.

Where people went next

Nobody has added a next stop yet. Be the first.

Five finds like this, every morning

Five great websites every morning, picked by people and written up by AI. Free, and one click to stop.

Remember Me
Scroll to Top

More

📰 Latest Posts
📊 Community Stats
👋 New Members
👥 Popular Groups