mackenly / fast-nameserver-lookup

Experiments and benchmarking to compare the speed of a Rust-based nameserver lookup to dig
Apache License 2.0
0 stars 0 forks source link

fast-nameserver-lookup

Experiments and benchmarking to compare the speed of a Rust-based nameserver lookup to dig

Three things are tested:

[!NOTE] Results are highly dependent on the machine and network conditions. Below, you'll find the results a GitHub Actions runner produced.

Average time over 100 iterations of looking up NS records for mackenly.com:

Rust lib code:
- Average elapsed time: 462.738µs
- Median elapsed time: 193.694µs
- Fastest elapsed time: 188.866µs
- Slowest elapsed time: 26.781831ms

Custom Rust code:
- Average elapsed time: 2.823685ms
- Median elapsed time: 2.600598ms
- Fastest elapsed time: 2.262353ms
- Slowest elapsed time: 9.95269ms

Dig command:
- Average elapsed time: 19.073889ms
- Median elapsed time: 18.823442ms
- Fastest elapsed time: 8.433644ms
- Slowest elapsed time: 96.514507ms

The crate returns IP addresses, while the custom code returns the domain names of the nameservers. These are not directly comparable. For my purposes the domain names are more useful. See #4 for more info.

If anyone else goes on this journey, I'd suggest checking out the following resources: