# Gohashtree

**URL:** https://collective.flashbots.net/t/gohashtree/4795
**Category:** References
**Tags:** software
**Created:** [March 21, 2025, 3:51pm UTC](https://collective.flashbots.net/t/gohashtree/4795 "2025-03-21T15:51:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![guayabyte](https://collective.flashbots.net/user_avatar/collective.flashbots.net/guayabyte/32/4_2.png) [@guayabyte](https://collective.flashbots.net/u/guayabyte)
#### Post date: [March 21, 2025, 3:58pm UTC](https://collective.flashbots.net/t/gohashtree/4795/2 "2025-03-21T15:58:53Z")

</div>

Install go in AMD64:

```auto
$ wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz

```

As root:

```auto
# rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz

```

Install go in RISC-V64:

```auto
$ wget https://go.dev/dl/go1.24.1.linux-riscv64.tar.gz

```

As root:

```auto
$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz

```

* * *

Make the go binary accessible:

```auto
$ export PATH=$PATH:/usr/local/go/bin

```

Get the source code:

```auto
$ git clone https://github.com/prysmaticlabs/gohashtree
$ cd gohashtree

```

Test:

```auto
$ go test .

```

Run the benchmarks in my Intel laptop:

```auto
$ go test . -bench=.
goos: linux
goarch: amd64
pkg: github.com/prysmaticlabs/gohashtree
cpu: 12th Gen Intel(R) Core(TM) i7-1280P
BenchmarkHash_1_minio-20 10918632 109.5 ns/op
BenchmarkHash_1-20 28387708 41.73 ns/op
BenchmarkHash_4_minio-20 2617243 447.8 ns/op
BenchmarkHash_4-20 7394364 160.6 ns/op
BenchmarkHash_8_minio-20 1286012 923.3 ns/op
BenchmarkHash_8-20 3253250 327.9 ns/op
BenchmarkHash_16_minio-20 574353 1862 ns/op
BenchmarkHash_16-20 1780053 651.1 ns/op
BenchmarkHashLargeList_minio-20 42 25348327 ns/op
BenchmarkHashList-20 130 8855663 ns/op
PASS
ok github.com/prysmaticlabs/gohashtree	15.235s

```

Run the tests in a [RISC-V qemu](https://collective.flashbots.net/t/risc-v-cheat-sheet/3820#p-8094-qemu-1):  
(This requires [Run in unsupported architectures by come-maiz · Pull Request #22 · prysmaticlabs/gohashtree · GitHub](https://github.com/prysmaticlabs/gohashtree/pull/22))

```auto
$ sudo apt install --yes qemu-user-static
$ GOARCH=riscv64 go test -v ./... -c -o test.riscv64
$ qemu-riscv64-static test.riscv64 -test.v

```

* * *

Sources:

- [Download and install - The Go Programming Language](https://go.dev/doc/install)

---

_[View the full topic](https://collective.flashbots.net/t/gohashtree/4795)._
