flow-go
flow-go copied to clipboard
code gen parseRestrict wrappers
Prep work for adding trace/meter logic to the wrapper.
(I don't really like python3 and haven't done any serious development using it, but ppl will probably hate me if I use python2 instead)
FVM Benchstat comparison
This branch with compared with the base branch onflow:master commit 1bc1cb079bab87c90656196c36023da7fc5ce26f
The command (for i in {1..10}; do go test ./fvm ./engine/execution/computation --bench . --tags relic -shuffle=on --benchmem --run ^$; done)
was used.
Collapsed results for better readability
old.txt | new.txt | |||
---|---|---|---|---|
time/op | delta | |||
ComputeBlock/16/cols/128/txes-2 | 5.29s ± 0% | 5.08s ± 0% | ~ | (p=1.000 n=1+1) |
us/tx | delta | |||
ComputeBlock/16/cols/128/txes-2 | 2.58k ± 0% | 2.48k ± 0% | ~ | (p=1.000 n=1+1) |
alloc/op | delta | |||
ComputeBlock/16/cols/128/txes-2 | 1.28GB ± 0% | 1.28GB ± 0% | ~ | (p=1.000 n=1+1) |
allocs/op | delta | |||
ComputeBlock/16/cols/128/txes-2 | 19.9M ± 0% | 19.9M ± 0% | ~ | (p=1.000 n=1+1) |
Codecov Report
Merging #3398 (cfcdb7a) into master (2440283) will decrease coverage by
1.94%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #3398 +/- ##
==========================================
- Coverage 55.47% 53.52% -1.95%
==========================================
Files 752 546 -206
Lines 68494 46466 -22028
==========================================
- Hits 37997 24873 -13124
+ Misses 27424 19423 -8001
+ Partials 3073 2170 -903
Flag | Coverage Δ | |
---|---|---|
unittests | 53.52% <ø> (-1.95%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
network/p2p/dns/resolver.go | 91.51% <0.00%> (-4.85%) |
:arrow_down: |
ledger/complete/wal/wal.go | 55.02% <0.00%> (-1.92%) |
:arrow_down: |
ledger/complete/wal/checkpointer.go | 63.12% <0.00%> (-0.52%) |
:arrow_down: |
ledger/complete/ledger.go | 62.25% <0.00%> (-0.35%) |
:arrow_down: |
cmd/execution_config.go | 0.00% <0.00%> (ø) |
|
cmd/execution_builder.go | 0.00% <0.00%> (ø) |
|
fvm/environment/parse_restricted_checker.go | ||
engine/access/rest/request/script.go | ||
fvm/state/state.go | ||
engine/consensus/approvals/signature_collector.go | ||
... and 214 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
exciting initiative.
- question: why use Python instead of Golang's own
text/template
? if we add new language in flow-go, we may want to update theinstall-tools
target in the main Makefile, though i'd still prefer not to introduce new language dep into the repo, unless there's strong reasons for that. - you may also want to add this new code generation step into https://github.com/onflow/flow-go/blob/master/Makefile#L122
- accidental commit of that binary file ".codes.go.swap"?
-
python cuz i was lazy. but it's a fair point that not everyone will have python install. i'll convert to golang instead (i hate python3, but I hate golang text/template even more)
-
i don't think we need to regenerate these regularly
-
yeah, .codes.go.swap was an accidental commit
did a quick search on github and found this: https://github.com/dave/jennifer. not sure if it's battle-tested though.
(my hobby template generator looks better https://github.com/pattyshack/abc/tree/master/src/template =P)
i'll probably go with (gogo)proto style generation instead of text/template. it works pretty well in practice.
switched to golang based code gen + added to makefile
LGTM - please remove
.codes.go.swp
before merging.
.codes.go.swp is already in the main branch (I merged it accidently in a previous pr). this removes it
bors merge
bors retry
Already running a review
Build succeeded:
- Integration Tests (make -C integration access-tests)
- Integration Tests (make -C integration bft-tests)
- Integration Tests (make -C integration collection-tests)
- Integration Tests (make -C integration consensus-tests)
- Integration Tests (make -C integration epochs-tests)
- Integration Tests (make -C integration execution-tests)
- Integration Tests (make -C integration ghost-tests)
- Integration Tests (make -C integration mvp-tests)
- Integration Tests (make -C integration network-tests)
- Integration Tests (make -C integration verification-tests)
- Lint (./)
- Lint (./crypto/)
- Lint (./integration/)
- Unit Tests (access)
- Unit Tests (admin)
- Unit Tests (cmd)
- Unit Tests (consensus)
- Unit Tests (engine)
- Unit Tests (fvm)
- Unit Tests (ledger)
- Unit Tests (module)
- Unit Tests (network)
- Unit Tests (others)
- Unit Tests (utils)