Gohashtree

RISC-V support

Status: runs a generic slow implementation

Install go in AMD64:

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

As root:

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

Install go in RISC-V64:

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

As root:

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

Make the go binary accessible:

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

Get the source code:

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

Test:

$ go test .

Run the benchmarks in my Intel laptop:

$ 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:
(This requires Run in unsupported architectures by come-maiz · Pull Request #22 · prysmaticlabs/gohashtree · GitHub)

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

Sources: