Skip to content

Dev#12

Open
mr-tron wants to merge 2 commits intoharmony-one:masterfrom
mr-tron:dev
Open

Dev#12
mr-tron wants to merge 2 commits intoharmony-one:masterfrom
mr-tron:dev

Conversation

@mr-tron
Copy link
Copy Markdown

@mr-tron mr-tron commented Apr 5, 2026

Improve performance.

Current speed:

cpu: Apple M4
BenchmarkGenerateVDFByTarget
BenchmarkGenerateVDFByTarget/target_500
BenchmarkGenerateVDFByTarget/target_500-10         	       3	 454050319 ns/op	1166237434 B/op	11017709 allocs/op
BenchmarkGenerateVDFByTarget/target_1000
BenchmarkGenerateVDFByTarget/target_1000-10        	       2	 773355584 ns/op	2314514484 B/op	21894998 allocs/op
BenchmarkGenerateVDFByTarget/target_10000
BenchmarkGenerateVDFByTarget/target_10000-10       	       1	7302176333 ns/op	22163331696 B/op	210768079 allocs/op
BenchmarkVerifyVDFByTarget
BenchmarkVerifyVDFByTarget/target_500
BenchmarkVerifyVDFByTarget/target_500-10           	       4	 273855135 ns/op	394709076 B/op	 3589633 allocs/op
BenchmarkVerifyVDFByTarget/target_1000
BenchmarkVerifyVDFByTarget/target_1000-10          	       5	 243496925 ns/op	375638987 B/op	 3431327 allocs/op
BenchmarkVerifyVDFByTarget/target_10000
BenchmarkVerifyVDFByTarget/target_10000-10         	       5	 244052708 ns/op	390264870 B/op	 3552606 allocs/op

After improvment:

cpu: Apple M4
BenchmarkGenerateVDFByTarget
BenchmarkGenerateVDFByTarget/target_500
BenchmarkGenerateVDFByTarget/target_500-10         	       5	 217132292 ns/op	276672008 B/op	 1581233 allocs/op
BenchmarkGenerateVDFByTarget/target_1000
BenchmarkGenerateVDFByTarget/target_1000-10        	       4	 295034708 ns/op	542194624 B/op	 3109582 allocs/op
BenchmarkGenerateVDFByTarget/target_10000
BenchmarkGenerateVDFByTarget/target_10000-10       	       1	1760387958 ns/op	5016660616 B/op	28852262 allocs/op
BenchmarkVerifyVDFByTarget
BenchmarkVerifyVDFByTarget/target_500
BenchmarkVerifyVDFByTarget/target_500-10           	       7	 165926232 ns/op	91265298 B/op	  514340 allocs/op
BenchmarkVerifyVDFByTarget/target_1000
BenchmarkVerifyVDFByTarget/target_1000-10          	       7	 163517387 ns/op	84978422 B/op	  478850 allocs/op
BenchmarkVerifyVDFByTarget/target_10000
BenchmarkVerifyVDFByTarget/target_10000-10         	       7	 164501018 ns/op	82835457 B/op	  466762 allocs/op
PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant