2 Commits

Author SHA1 Message Date
cf0ccd2f6e refactor(benchmark_test): migrate from github.com/ipfs/go-cid to code.sonr.org/go/cid
Some checks failed
Close Stale Issues / stale (push) Has been cancelled
Close Generated PRs / stale (push) Has been cancelled
Go Checks / go-check (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Releaser / releaser (push) Has been cancelled
Tag Push Checker / releaser (push) Has been cancelled
2026-01-08 15:46:16 -05:00
Masih H. Derkani
28f4a5eab6 Benchmark existing ways to check for IDENTITY CIDs
Add benchmarks that compare two ways of checking for
`multihash.IDENTITY` code:
1. `Cid.Prefix().MhType`
2. Decode of `Cid.Hash()`

This benchmark illustrates that using Cid.Prefix is more efficient than
`multihash.Decode`. Users wishing to perform such a check should use
`Cid.Prefix`.

Consider that `Cid.Prefix` is already efficient enough and introducing a
dedicated API for performing this check will likely result in small
gains.

Relates to #133
2021-11-08 14:52:45 +00:00