Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface-test
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
董子豪
interface-test
Commits
2ff4cddf
Commit
2ff4cddf
authored
Dec 14, 2021
by
董子豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rm
parent
1a9468b0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
139 deletions
+0
-139
main.go
cmd/bench/main.go
+0
-139
No files found.
cmd/bench/main.go
deleted
100644 → 0
View file @
1a9468b0
package
main
import
(
"os"
"fil_integrate/build/state-types/abi"
"github.com/docker/go-units"
logging
"github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
"fil_integrate/seal"
)
var
log
=
logging
.
Logger
(
"bench"
)
func
main
()
{
logging
.
SetLogLevel
(
"*"
,
"INFO"
)
log
.
Info
(
"Starting bench"
)
app
:=
&
cli
.
App
{
Name
:
"bench"
,
Usage
:
"Benchmark performance of seal and window-post"
,
Version
:
"1.0.1"
,
Commands
:
[]
*
cli
.
Command
{
testSealAndWindowPoSt
,
testSealCmd
,
testSplitDataCmd
,
testCmd
,
},
}
if
err
:=
app
.
Run
(
os
.
Args
);
err
!=
nil
{
log
.
Warnf
(
"%+v"
,
err
)
return
}
}
var
testSealAndWindowPoSt
=
&
cli
.
Command
{
Name
:
"test-all"
,
Usage
:
"Test Seal the sectors and generate window post"
,
Flags
:
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"sector-size"
,
Value
:
"8MiB"
,
Usage
:
"size of the sectors in bytes"
,
},
&
cli
.
IntFlag
{
Name
:
"num-agg"
,
Value
:
8
,
Usage
:
"How many window-post proofs used to aggregate"
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
sectorSizeInt
,
err
:=
units
.
RAMInBytes
(
c
.
String
(
"sector-size"
))
if
err
!=
nil
{
return
err
}
sectorSize
:=
abi
.
SectorSize
(
sectorSizeInt
)
numAggregate
:=
c
.
Int
(
"num-agg"
)
err
=
seal
.
TestSealAndWindowPoSt
(
sectorSize
,
numAggregate
)
if
err
!=
nil
{
return
err
}
return
nil
},
}
var
testSealCmd
=
&
cli
.
Command
{
Name
:
"test-seal"
,
Usage
:
"Test sealing the sectors"
,
Flags
:
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"sector-size"
,
Value
:
"8MiB"
,
Usage
:
"size of the sectors in bytes"
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
sectorSizeInt
,
err
:=
units
.
RAMInBytes
(
c
.
String
(
"sector-size"
))
if
err
!=
nil
{
return
err
}
sectorSize
:=
abi
.
SectorSize
(
sectorSizeInt
)
// Default: Test 8MiB sector
err
=
seal
.
TestSealAndUnseal
(
sectorSize
)
if
err
!=
nil
{
return
err
}
return
nil
},
}
var
testCmd
=
&
cli
.
Command
{
Name
:
"test"
,
Usage
:
"Test"
,
Action
:
func
(
c
*
cli
.
Context
)
error
{
// Test 8MiB sector
err
:=
seal
.
Test
()
if
err
!=
nil
{
return
err
}
return
nil
},
}
var
testSplitDataCmd
=
&
cli
.
Command
{
Name
:
"test-split"
,
Usage
:
"Test encode data into pieces"
,
Flags
:
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"sector-size"
,
Value
:
"8MiB"
,
Usage
:
"size of the sectors in bytes"
,
},
&
cli
.
StringFlag
{
Name
:
"data-size"
,
Value
:
"256MiB"
,
Usage
:
"size of the input file in bytes"
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
// Test 8MiB sector
dataSize
,
err
:=
units
.
RAMInBytes
(
c
.
String
(
"data-size"
))
if
err
!=
nil
{
return
err
}
sectorSizeInt
,
err
:=
units
.
RAMInBytes
(
c
.
String
(
"sector-size"
))
if
err
!=
nil
{
return
err
}
sectorSize
:=
abi
.
SectorSize
(
sectorSizeInt
)
err
=
seal
.
TestSplitDataInToPieces
(
sectorSize
,
uint64
(
dataSize
))
if
err
!=
nil
{
return
err
}
return
nil
},
}
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