Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
dde6cb0b
Unverified
Commit
dde6cb0b
authored
Apr 30, 2021
by
aaronbuchwald
Committed by
GitHub
Apr 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: replace repeated string with variable in tests (#22774)
parent
1e57ab5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
34 deletions
+35
-34
instructions_test.go
core/vm/instructions_test.go
+35
-34
No files found.
core/vm/instructions_test.go
View file @
dde6cb0b
...
...
@@ -40,6 +40,7 @@ type twoOperandParams struct {
y
string
}
var
alphabetSoup
=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
var
commonParams
[]
*
twoOperandParams
var
twoOpMethods
map
[
string
]
executionFunc
...
...
@@ -347,8 +348,8 @@ func BenchmarkOpSub256(b *testing.B) {
}
func
BenchmarkOpMul
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opMul
,
x
,
y
)
}
...
...
@@ -379,64 +380,64 @@ func BenchmarkOpSdiv(b *testing.B) {
}
func
BenchmarkOpMod
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opMod
,
x
,
y
)
}
func
BenchmarkOpSmod
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opSmod
,
x
,
y
)
}
func
BenchmarkOpExp
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opExp
,
x
,
y
)
}
func
BenchmarkOpSignExtend
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opSignExtend
,
x
,
y
)
}
func
BenchmarkOpLt
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opLt
,
x
,
y
)
}
func
BenchmarkOpGt
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opGt
,
x
,
y
)
}
func
BenchmarkOpSlt
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opSlt
,
x
,
y
)
}
func
BenchmarkOpSgt
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opSgt
,
x
,
y
)
}
func
BenchmarkOpEq
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opEq
,
x
,
y
)
}
...
...
@@ -446,45 +447,45 @@ func BenchmarkOpEq2(b *testing.B) {
opBenchmark
(
b
,
opEq
,
x
,
y
)
}
func
BenchmarkOpAnd
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opAnd
,
x
,
y
)
}
func
BenchmarkOpOr
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opOr
,
x
,
y
)
}
func
BenchmarkOpXor
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opXor
,
x
,
y
)
}
func
BenchmarkOpByte
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
opBenchmark
(
b
,
opByte
,
x
,
y
)
}
func
BenchmarkOpAddmod
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
z
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
z
:=
alphabetSoup
opBenchmark
(
b
,
opAddmod
,
x
,
y
,
z
)
}
func
BenchmarkOpMulmod
(
b
*
testing
.
B
)
{
x
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
z
:=
"ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
x
:=
alphabetSoup
y
:=
alphabetSoup
z
:=
alphabetSoup
opBenchmark
(
b
,
opMulmod
,
x
,
y
,
z
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment