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
8538d2a6
Commit
8538d2a6
authored
Aug 25, 2021
by
董子豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bench window-post aggregation
parent
4fd5bf1f
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
1019 deletions
+87
-1019
main.go
cmd/bench/main.go
+87
-0
main.go
cmd/lotus-bench/main.go
+0
-1019
No files found.
cmd/bench/main.go
0 → 100644
View file @
8538d2a6
package
main
import
(
"os"
"github.com/urfave/cli/v2"
"github.com/docker/go-units"
"github.com/filecoin-project/go-state-types/abi"
logging
"github.com/ipfs/go-log/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.11.1"
,
Commands
:
[]
*
cli
.
Command
{
testSealCmd
,
testAggregationCmd
,
},
}
if
err
:=
app
.
Run
(
os
.
Args
);
err
!=
nil
{
log
.
Warnf
(
"%+v"
,
err
)
return
}
}
var
testSealCmd
=
&
cli
.
Command
{
Name
:
"test-seal"
,
Usage
:
"Test interface"
,
Action
:
func
(
c
*
cli
.
Context
)
error
{
// Test 8MiB sector
err
:=
seal
.
TestSealAndUnseal
()
if
err
!=
nil
{
return
err
}
return
nil
},
}
var
testAggregationCmd
=
&
cli
.
Command
{
Name
:
"test-aggregation"
,
Usage
:
"Test interface"
,
Flags
:
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"sector-size"
,
Value
:
"2KiB"
,
Usage
:
"size of the sectors in bytes"
,
},
&
cli
.
IntFlag
{
Name
:
"num-sectors"
,
Value
:
4
,
Usage
:
"How many sectors used in single window post"
,
},
&
cli
.
IntFlag
{
Name
:
"num-agg"
,
Value
:
4
,
Usage
:
"How many window-post proofs used to aggregate"
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
log
.
Info
(
"testing"
)
sectorSizeInt
,
err
:=
units
.
RAMInBytes
(
c
.
String
(
"sector-size"
))
if
err
!=
nil
{
return
err
}
sectorSize
:=
abi
.
SectorSize
(
sectorSizeInt
)
numSectors
:=
c
.
Int
(
"num-sectors"
)
numAggregate
:=
c
.
Int
(
"num-agg"
)
err
=
seal
.
TestAggregateWindowPoSt
(
sectorSize
,
numSectors
,
numAggregate
)
if
err
!=
nil
{
return
err
}
return
nil
},
}
\ No newline at end of file
cmd/lotus-bench/main.go
deleted
100644 → 0
View file @
4fd5bf1f
This diff is collapsed.
Click to expand it.
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