AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

bench: add benchmark for GetMappedAS()

Public commit record

What the developer wrote

Authored by 0xb10c

86/100 · Strong
bench: add benchmark for GetMappedAS()

With #28792 merged, we can use the embedded ASMap file to benchmark
the IP -> ASN lookups. Before, this would have been cumbersome as it
required having a real, external ASMap file. We want to benchmark
against a real file, as a smaller test file has significantly faster
lookups.

The benchmarks cover individual IP address lookups of mapped and
unmapped IPv4 and IPv6 addresses along with a multi-IP lookup.
For the IPs we assume to be mapped, we assert that they are mapped.
Updating the embedded ASMap file might change the benchmark results
slightly as some lookups will be a bit faster and others slower.

```
$ ./build/bin/bench_bitcoin --filter=ASMapGetMappedAS.* -min-time=5000

| ns/op | op/s | err% | total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
| 460.41 | 2,171,994.61 | 0.2% | 5.48 | `ASMapGetMappedASCloudflarev4`
| 356.96 | 2,801,460.45 | 0.0% | 5.33 | `ASMapGetMappedASCloudflarev6`
| 476.58 | 2,098,304.01 | 0.1% | 5.51 | `ASMapGetMappedASGooglev4`
| 359.17 | 2,784,224.15 | 0.0% | 5.33 | `ASMapGetMappedASGooglev6`
| 398.82 | 2,507,410.35 | 0.1% | 5.50 | `ASMapGetMappedASMulti`
| 346.11 | 2,889,237.31 | 0.3% | 5.32 | `ASMapGetMappedASQuad9v4`
| 274.21 | 3,646,832.70 | 0.1% | 5.50 | `ASMapGetMappedASQuad9v6`
| 5.32 | 187,875,440.96 | 0.1% | 5.50 | `ASMapGetMappedASUnmappedv4`
| 65.19 | 15,339,680.04 | 0.1% | 5.51 | `ASMapGetMappedASUnmappedv6`
```

Co-authored-by: Fabian Jahr <fjahr@protonmail.com>
Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only adds a new performance benchmark for an existing IP-to-ASN lookup feature. It does not change any production code, network behavior, or security logic. There is no security issue here.

Recommended action

No security action needed. This is a benign benchmark addition.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.