Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/types: add benchmark for rlp encoding/decoding #23190

Merged
merged 3 commits into from Aug 24, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Jul 10, 2021

This PR just adds a benchmark of how performant the RLP encoding/decoding of core types is.

BenchmarkEncodeRLP/legacy-header-6         	 2306220	       530.7 ns/op	1023.20 MB/s	       0 B/op	       0 allocs/op
BenchmarkEncodeRLP/london-header-6         	 2219181	       545.7 ns/op	1006.04 MB/s	       0 B/op	       0 allocs/op
BenchmarkEncodeRLP/receipt-for-storage-6   	 3012508	       404.4 ns/op	  22.25 MB/s	      64 B/op	       1 allocs/op
BenchmarkEncodeRLP/receipt-full-6          	 2059255	       668.5 ns/op	 403.88 MB/s	     320 B/op	       1 allocs/op
BenchmarkEncodeRLP/legacy-transaction-6    	 2062718	       624.7 ns/op	 163.27 MB/s	       0 B/op	       0 allocs/op
BenchmarkEncodeRLP/access-transaction-6    	 1271258	      1004 ns/op	 105.60 MB/s	      24 B/op	       1 allocs/op
BenchmarkEncodeRLP/1559-transaction-6      	 1212688	       991.2 ns/op	 110.97 MB/s	      24 B/op	       1 allocs/op

decode:

BenchmarkDecodeRLP/legacy-header-6         	  967195	      1313 ns/op	 413.49 MB/s	      80 B/op	       2 allocs/op
BenchmarkDecodeRLP/london-header-6         	 1000000	      1290 ns/op	 425.69 MB/s	      80 B/op	       2 allocs/op
BenchmarkDecodeRLP/receipt-for-storage-6   	 1000000	      1084 ns/op	   8.30 MB/s	     144 B/op	       5 allocs/op
BenchmarkDecodeRLP/receipt-full-6          	 1061335	       984.9 ns/op	 274.14 MB/s	     393 B/op	       4 allocs/op
BenchmarkDecodeRLP/legacy-transaction-6    	  460074	      2890 ns/op	  35.29 MB/s	     488 B/op	      14 allocs/op
BenchmarkDecodeRLP/access-transaction-6    	  333847	      3687 ns/op	  28.75 MB/s	     744 B/op	      19 allocs/op
BenchmarkDecodeRLP/1559-transaction-6      	  375579	      3961 ns/op	  27.77 MB/s	     776 B/op	      20 allocs/op

core/types/types_test.go Outdated Show resolved Hide resolved
core/types/types_test.go Outdated Show resolved Hide resolved
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
@fjl fjl added this to the 1.10.8 milestone Aug 10, 2021
@fjl fjl self-assigned this Aug 10, 2021
@fjl fjl modified the milestones: 1.10.8, 1.10.9 Aug 24, 2021
@fjl fjl merged commit a0a4a15 into ethereum:master Aug 24, 2021
sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Aug 24, 2021
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
reds pushed a commit to reds/go-ethereum that referenced this pull request Aug 28, 2021
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
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.

None yet

3 participants