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

make repository rollback safe #239

Merged
merged 3 commits into from
May 3, 2022
Merged

Conversation

DavidBadura
Copy link
Member

  • remove instance cache in repository
  • move snapshot save from repository save into repository load method
  • move batch condition from snapshot store into repository

As a result, neither the repository nor the snapshot store is stateful and can continue to be used after a rollback.

@DavidBadura DavidBadura added this to the 2.0.0 milestone May 3, 2022
@DavidBadura DavidBadura requested a review from DanielBadura May 3, 2022 11:01
@github-actions
Copy link

github-actions bot commented May 3, 2022

Hello 👋

here is the most recent benchmark result:

WriteEventsBench
================

Average iteration times by variant

36.1ms    │    ██ 
31.5ms    │    ██ 
27.0ms    │    ██ 
22.5ms    │    ██ 
18.0ms    │    ██ 
13.5ms    │    ██ 
9.0ms     │    ██ 
4.5ms     │ ▃▃ ██ 
          └───────
            1  2  

[█ <current>] [█ base] 

1: benchSaveOneEvent    2: benchSaveAfterThous᠁ 

Memory by variant

7.0mb     │ ▃▃ ██ 
6.1mb     │ ██ ██ 
5.3mb     │ ██ ██ 
4.4mb     │ ██ ██ 
3.5mb     │ ██ ██ 
2.6mb     │ ██ ██ 
1.8mb     │ ██ ██ 
875.2kb   │ ██ ██ 
          └───────
            1  2  

[█ <current>] [█ base] 

1: benchSaveOneEvent    2: benchSaveAfterThous᠁ 

+---------------------------------+-------------------+-------------------+-----------------+------------+
|                                 | time (kde mode)                       | memory                       |
+---------------------------------+-------------------+-------------------+-----------------+------------+
| subject                         | Tag: <current>    | Tag: base         | Tag: <current>  | Tag: base  |
+---------------------------------+-------------------+-------------------+-----------------+------------+
| benchSaveOneEvent ()            | 1.138ms (±14.51%) | 1.241ms (±2.04%)  | 6.373mb         | 6.374mb    |
| benchSaveAfterThousandEvents () | 36.051ms (±1.79%) | 35.551ms (±1.72%) | 7.000mb         | 7.001mb    |
+---------------------------------+-------------------+-------------------+-----------------+------------+

LoadEventsBench
===============

Average iteration times by variant

82.2ms    │ ██ 
71.9ms    │ ██ 
61.7ms    │ ██ 
51.4ms    │ ██ 
41.1ms    │ ██ 
30.8ms    │ ██ 
20.6ms    │ ██ 
10.3ms    │ ██ 
          └────
            1  

[█ <current>] [█ base] 

1: benchLoadEvents 

Memory by variant

19.1mb    │ ██ 
16.7mb    │ ██ 
14.3mb    │ ██ 
11.9mb    │ ██ 
9.5mb     │ ██ 
7.2mb     │ ██ 
4.8mb     │ ██ 
2.4mb     │ ██ 
          └────
            1  

[█ <current>] [█ base] 

1: benchLoadEvents 

+--------------------+-------------------+-------------------+-----------------+------------+
|                    | time (kde mode)                       | memory                       |
+--------------------+-------------------+-------------------+-----------------+------------+
| subject            | Tag: <current>    | Tag: base         | Tag: <current>  | Tag: base  |
+--------------------+-------------------+-------------------+-----------------+------------+
| benchLoadEvents () | 82.223ms (±0.33%) | 81.998ms (±1.53%) | 19.096mb        | 19.097mb   |
+--------------------+-------------------+-------------------+-----------------+------------+

LoadEventsWithSnapshotsBench
============================

Average iteration times by variant

269.9μs   │ ▇█ 
236.2μs   │ ██ 
202.4μs   │ ██ 
168.7μs   │ ██ 
134.9μs   │ ██ 
101.2μs   │ ██ 
67.5μs    │ ██ 
33.7μs    │ ██ 
          └────
            1  

[█ <current>] [█ base] 

1: benchLoadEvents 

Memory by variant

13.1mb    │ ██ 
11.5mb    │ ██ 
9.8mb     │ ██ 
8.2mb     │ ██ 
6.6mb     │ ██ 
4.9mb     │ ██ 
3.3mb     │ ██ 
1.6mb     │ ██ 
          └────
            1  

[█ <current>] [█ base] 

1: benchLoadEvents 

+--------------------+--------------------+--------------------+-----------------+------------+
|                    | time (kde mode)                         | memory                       |
+--------------------+--------------------+--------------------+-----------------+------------+
| subject            | Tag: <current>     | Tag: base          | Tag: <current>  | Tag: base  |
+--------------------+--------------------+--------------------+-----------------+------------+
| benchLoadEvents () | 262.200μs (±0.38%) | 269.897μs (±0.56%) | 13.106mb        | 13.111mb   |
+--------------------+--------------------+--------------------+-----------------+------------+

This comment gets update everytime a new commit comes in!

@DavidBadura DavidBadura force-pushed the make-repository-rollback-save branch from f95b22b to 3d1499c Compare May 3, 2022 11:15
@DavidBadura DavidBadura linked an issue May 3, 2022 that may be closed by this pull request
@DavidBadura DavidBadura merged commit 757440d into 2.0.x May 3, 2022
@DavidBadura DavidBadura deleted the make-repository-rollback-save branch May 3, 2022 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What if a rollback happens?
2 participants