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

feat: add temporality #428

Merged
merged 7 commits into from
Jul 19, 2023
Merged

feat: add temporality #428

merged 7 commits into from
Jul 19, 2023

Conversation

gfyrag
Copy link
Contributor

@gfyrag gfyrag commented Jul 13, 2023

refactor so many things for this feature...

@gfyrag gfyrag requested a review from a team as a code owner July 13, 2023 09:31
@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2023 10:39am

@github-actions
Copy link

github-actions bot commented Jul 13, 2023

Run report for a0d25961

Total time: 0ms | Comparison time: 0s | Estimated loss: 0ms (100.0% slower)

Action Time Status Info
Touched files
components/ledger/.gitignore
components/ledger/cmd/container.go
components/ledger/cmd/root.go
components/ledger/cmd/serve.go
components/ledger/go.mod
components/ledger/go.sum
components/ledger/pkg/api/controllers/ledger_controller_test.go
components/ledger/pkg/api/controllers/transaction_controller_test.go
components/ledger/pkg/core/account.go
components/ledger/pkg/core/log.go
components/ledger/pkg/core/transaction.go
components/ledger/pkg/ledger/cache/cache.go
components/ledger/pkg/ledger/cache/cache_test.go
components/ledger/pkg/ledger/command/commander.go
components/ledger/pkg/ledger/command/commander_test.go
components/ledger/pkg/ledger/command/context.go
components/ledger/pkg/ledger/command/errors.go
components/ledger/pkg/ledger/command/inflight.go
components/ledger/pkg/ledger/command/reference.go
components/ledger/pkg/ledger/command/reserve.go
components/ledger/pkg/ledger/command/state.go
components/ledger/pkg/ledger/command/state_test.go
components/ledger/pkg/ledger/command/store.go
components/ledger/pkg/ledger/ledger.go
components/ledger/pkg/ledger/module.go
components/ledger/pkg/ledger/query/worker.go
components/ledger/pkg/ledger/query/worker_test.go
components/ledger/pkg/ledger/resolver.go
components/ledger/pkg/machine/examples/basic.go
components/ledger/pkg/machine/machine.go
components/ledger/pkg/machine/machine_test.go
components/ledger/pkg/machine/vm/machine.go
components/ledger/pkg/machine/vm/machine_test.go
components/ledger/pkg/machine/vm/store.go
components/ledger/pkg/storage/ledgerstore/accounts.go
components/ledger/pkg/storage/ledgerstore/accounts_test.go
components/ledger/pkg/storage/ledgerstore/logs.go
components/ledger/pkg/storage/ledgerstore/logs_test.go
components/ledger/pkg/storage/ledgerstore/logs_worker.go
components/ledger/pkg/storage/ledgerstore/migrates/0-init-schema/any.go
components/ledger/pkg/storage/ledgerstore/migrates/0-init-schema/postgres.sql
components/ledger/pkg/storage/schema/schema.go

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 89.68µ ± 1%   117.56µ ± 2%  +31.09% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  177.5 ± 1%       233.5 ± 1%  +31.55% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.150k ± 1%   8.506k ± 2%  -23.72% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.57Ki ± 0%   34.20Ki ± 0%  +39.20% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  344.0 ± 0%   430.0 ± 0%  +25.00% (p=0.000 n=10)

@gfyrag gfyrag force-pushed the feat/ledger-moves branch from 23a673a to 9df4ddb Compare July 13, 2023 09:50
@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6752.0µ ± 2%  +1258.98% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11512.5 ± 2%  +1071.16% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   148.1 ± 2%  -92.64% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.02Ki ± 0%  +127.46% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   568.0 ± 0%  -40.34% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6741.0µ ± 2%  +1256.77% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11450.5 ± 2%  +1064.85% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   148.3 ± 2%  -92.63% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.01Ki ± 0%  +127.42% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   568.0 ± 0%  -40.34% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 89.68µ ± 1%   118.94µ ± 1%  +32.62% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  177.5 ± 1%       236.0 ± 1%  +32.96% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.150k ± 1%   8.408k ± 1%  -24.60% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.57Ki ± 0%   34.20Ki ± 0%  +39.22% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  344.0 ± 0%   430.0 ± 0%  +25.00% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6737.5µ ± 2%  +1256.07% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11451.0 ± 2%  +1064.90% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   148.4 ± 2%  -92.63% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.25Ki ± 0%  +127.99% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   570.0 ± 0%  -40.13% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 89.68µ ± 1%   118.57µ ± 1%  +32.20% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  177.5 ± 1%       235.5 ± 1%  +32.68% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.150k ± 1%   8.434k ± 1%  -24.36% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.57Ki ± 0%   34.27Ki ± 0%  +39.50% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  344.0 ± 0%   431.0 ± 0%  +25.29% (p=0.000 n=10)

Vars: map[string]any{
"account": fmt.Sprintf("accounts:%d", counter.Add(1)),
},
//script := controllers.Script{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this code

},
}

// script := controllers.Script{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this code


--statement
CREATE TABLE IF NOT EXISTS "VAR_LEDGER_NAME_v2_0_0".logs_v2 (
create table "VAR_LEDGER_NAME_v2_0_0".logs_v2 (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keef "if not exists"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless, it can hide a real problem.
At this step, the table must not exists.

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │          sec/op           │    sec/op     vs base                  │
ParallelWrites-2                 89.68µ ± 1%   118.13µ ± 1%  +31.72% (p=0.000 n=10+9)

                │ ./benchs/main-async.stats │         ./benchs/pr-async.stats          │
                │      ms/transaction       │ ms/transaction  vs base                  │
ParallelWrites-2                  177.5 ± 1%       234.0 ± 1%  +31.83% (p=0.000 n=10+9)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats        │
                │            t/s            │     t/s      vs base                  │
ParallelWrites-2                11.150k ± 1%   8.465k ± 1%  -24.08% (p=0.000 n=10+9)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │           B/op            │     B/op      vs base                  │
ParallelWrites-2                24.57Ki ± 0%   34.24Ki ± 0%  +39.39% (p=0.000 n=10+9)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │         allocs/op         │ allocs/op   vs base                  │
ParallelWrites-2                  344.0 ± 0%   431.0 ± 0%  +25.29% (p=0.000 n=10+9)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6746.9µ ± 1%  +1257.95% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11495.5 ± 2%  +1069.43% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   148.2 ± 1%  -92.64% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.37Ki ± 0%  +128.26% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   570.0 ± 0%  -40.13% (p=0.000 n=10)

@flemzord
Copy link
Member

Link to formancehq/ledger#340

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6796.0µ ± 4%  +1267.85% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11599.5 ± 4%  +1080.01% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   147.2 ± 3%  -92.69% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   98.05Ki ± 1%  +129.87% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   576.0 ± 0%  -39.50% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 89.68µ ± 1%   118.23µ ± 1%  +31.83% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  177.5 ± 1%       235.0 ± 1%  +32.39% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.150k ± 1%   8.459k ± 1%  -24.14% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.57Ki ± 0%   34.29Ki ± 0%  +39.60% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  344.0 ± 0%   432.0 ± 0%  +25.58% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6798.2µ ± 1%  +1268.28% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11613.0 ± 1%  +1081.38% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   147.1 ± 1%  -92.69% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.80Ki ± 0%  +129.27% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   573.0 ± 0%  -39.81% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 89.68µ ± 1%   117.92µ ± 2%  +31.48% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  177.5 ± 1%       233.5 ± 2%  +31.55% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.150k ± 1%   8.480k ± 2%  -23.95% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.57Ki ± 0%   34.26Ki ± 0%  +39.45% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  344.0 ± 0%   429.0 ± 0%  +24.71% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 89.68µ ± 1%   118.36µ ± 2%  +31.97% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  177.5 ± 1%       234.5 ± 2%  +32.11% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.150k ± 1%   8.450k ± 2%  -24.22% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.57Ki ± 0%   34.28Ki ± 0%  +39.53% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  344.0 ± 0%   429.0 ± 0%  +24.71% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6789.6µ ± 2%  +1266.56% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11556.5 ± 2%  +1075.64% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   147.3 ± 2%  -92.68% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.91Ki ± 0%  +129.52% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   573.0 ± 0%  -39.81% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6785.3µ ± 1%  +1265.69% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11577.5 ± 1%  +1077.77% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   147.4 ± 1%  -92.68% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.68Ki ± 0%  +129.00% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   572.5 ± 0%  -39.86% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │          sec/op           │    sec/op     vs base                  │
ParallelWrites-2                 89.68µ ± 1%   119.01µ ± 1%  +32.70% (p=0.000 n=10+8)

                │ ./benchs/main-async.stats │         ./benchs/pr-async.stats          │
                │      ms/transaction       │ ms/transaction  vs base                  │
ParallelWrites-2                  177.5 ± 1%       236.0 ± 1%  +32.96% (p=0.000 n=10+8)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats        │
                │            t/s            │     t/s      vs base                  │
ParallelWrites-2                11.150k ± 1%   8.402k ± 1%  -24.64% (p=0.000 n=10+8)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │           B/op            │     B/op      vs base                  │
ParallelWrites-2                24.57Ki ± 0%   34.29Ki ± 0%  +39.59% (p=0.000 n=10+8)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │         allocs/op         │ allocs/op   vs base                  │
ParallelWrites-2                  344.0 ± 0%   429.0 ± 0%  +24.71% (p=0.000 n=10+8)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                496.8µ ± 1%   6750.2µ ± 1%  +1258.62% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 983.0 ± 1%     11456.5 ± 3%  +1065.46% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2013.0 ± 1%   148.1 ± 1%  -92.64% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.66Ki ± 0%   97.60Ki ± 1%  +128.80% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   572.0 ± 0%  -39.92% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                493.5µ ± 1%   6691.4µ ± 1%  +1255.99% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 976.5 ± 1%     11346.0 ± 1%  +1061.90% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2026.5 ± 1%   149.4 ± 1%  -92.63% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.65Ki ± 0%   97.06Ki ± 0%  +127.60% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.5 ± 0%   572.0 ± 0%  -39.95% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 90.70µ ± 1%   118.75µ ± 2%  +30.93% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  179.5 ± 0%       235.5 ± 1%  +31.20% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                11.025k ± 1%   8.421k ± 2%  -23.63% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.59Ki ± 0%   34.28Ki ± 0%  +39.41% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  345.0 ± 0%   429.0 ± 0%  +24.35% (p=0.000 n=10)

@github-actions
Copy link

Mode async:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │          sec/op           │    sec/op     vs base                │
ParallelWrites-2                 91.01µ ± 1%   117.69µ ± 1%  +29.31% (p=0.000 n=10)

                │ ./benchs/main-async.stats │        ./benchs/pr-async.stats         │
                │      ms/transaction       │ ms/transaction  vs base                │
ParallelWrites-2                  180.0 ± 1%       233.5 ± 1%  +29.72% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats       │
                │            t/s            │     t/s      vs base                │
ParallelWrites-2                10.989k ± 1%   8.497k ± 1%  -22.67% (p=0.000 n=10)

                │ ./benchs/main-async.stats │       ./benchs/pr-async.stats        │
                │           B/op            │     B/op      vs base                │
ParallelWrites-2                24.59Ki ± 0%   34.24Ki ± 0%  +39.27% (p=0.000 n=10)

                │ ./benchs/main-async.stats │      ./benchs/pr-async.stats       │
                │         allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                  345.0 ± 0%   429.0 ± 0%  +24.35% (p=0.000 n=10)

@github-actions
Copy link

Mode sync:

goarch: amd64
pkg: github.com/formancehq/ledger/benchmarks
cpu: AMD EPYC 7R32
                │ ./benchs/main-sync.stats │         ./benchs/pr-sync.stats         │
                │          sec/op          │    sec/op     vs base                  │
ParallelWrites-2                499.4µ ± 1%   6770.6µ ± 3%  +1255.83% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │          ./benchs/pr-sync.stats          │
                │      ms/transaction      │ ms/transaction  vs base                  │
ParallelWrites-2                 989.0 ± 1%     11509.0 ± 4%  +1063.70% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │           t/s            │    t/s      vs base                │
ParallelWrites-2                2002.5 ± 1%   147.7 ± 3%  -92.62% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │        ./benchs/pr-sync.stats         │
                │           B/op           │     B/op      vs base                 │
ParallelWrites-2               42.64Ki ± 0%   97.83Ki ± 0%  +129.45% (p=0.000 n=10)

                │ ./benchs/main-sync.stats │       ./benchs/pr-sync.stats       │
                │        allocs/op         │ allocs/op   vs base                │
ParallelWrites-2                 952.0 ± 0%   573.0 ± 0%  -39.81% (p=0.000 n=10)

@gfyrag gfyrag merged commit 7ae8f1e into main Jul 19, 2023
@gfyrag gfyrag deleted the feat/ledger-moves branch July 19, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants