Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Fast and standards compliant DNS zone parser

License

NotificationsYou must be signed in to change notification settings

NLnetLabs/simdzone

Repository files navigation

Build StatusCoverity StatusMastodon Follow

simdzone: Parsing zone files really fast

Fast and standards compliant DNS presentation format parser.

DNS resource records (RRs) can be expressed in text form using thepresentation format. The format is most frequently used to define a zone inmaster files, more commonly known as zone files, and is best considered atabular serialization format with provisions for convenient editing.

The format is originally defined inRFC1035 section 5 andRFC1034 section 3.6.1, but as the DNS isintentionally extensible, the format has been extended over time too.

This project provides a lightning fast presentation format deserializer (andserializer eventually) for other projects to leverage. Learn more aboutsimdzone by reading thedocumentation.

Research paper

Motivation

Zone files can become quite large (.com ~24G, .se ~1.3G) and the parser inNSD left something to be desired. simdjson demonstrates that applying SIMDinstructions for parsing structured text can significantly boost performance.simdzone, whose name is a play onsimdjson, aims to achieve asimilar performance boost for parsing zone data.

Currently SSE4.2 and AVX2 are supported, a fallback is used otherwise.

simdzone copies some code from thesimdjson project, withpermission to use and distribute it under the terms ofThe 3-Clause BSD License.

Results

Runningzone-bench on my system (Intel Core i7-1065G7) against an older.com zone file of 12482791271 bytes under Linux (Fedora 39).

clang version 17.0.6, release mode:

$ time ./zone-bench parse ../../zones/com.zoneSelected target haswellParsed 341535548 recordsreal    0m13.533suser    0m12.355ssys     0m1.160s

There are bound to be bugs and quite possibly smarter ways of implementingsome operations, but the results are promising.

Compiling

Make sure the following tools are installed:

  • C toolchain (the set of tools to compile C code)
  • cmocka (if configured with-DBUILD_TESTING=on)
  • Doxygen (if configured with-DBUILD_DOCUMENTATION=on)
  • Sphinx (if configured with-DBUILD_DOCUMENTATION=on)

To compile in release mode:

$ cd zone-parser$ mkdir build$ cd build$ cmake -DCMAKE_BUILD_TYPE=Release ..$ cmake --build .

To compile in debug mode with testing:

$ cd zone-parser$ mkdir build$ cd build$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=on ..$ cmake --build .

Contributing

Contributions in any way, shape or form are very welcome! Please seeCONTRIBUTING.md to find out how you can help.

Design decisions and notes on theFORMAT.


[8]ページ先頭

©2009-2025 Movatter.jp