Commit graph

18 commits

Author SHA1 Message Date
ppom
3dd97523fd Move new rust codebase to root dir 2024-10-24 12:00:00 +02:00
ppom
c42487db5c Update dependencies 2024-10-24 12:00:00 +02:00
ppom
8dbb20efce WIP profiling
performance is veryy bad
2024-10-24 12:00:00 +02:00
ppom
9549a7b3ec use tracing instead of log 2024-10-24 12:00:00 +02:00
ppom
1e6e67a4b3 splitted channels, asyncify 2024-10-24 12:00:00 +02:00
ppom
2c5a781036 Make more things async 2024-10-24 12:00:00 +02:00
ppom
088354e955 untested async version 2024-10-24 12:00:00 +02:00
ppom
9cc702e9c7 Replace postcard by bincode
- The interface is easier
- This permits me to have unbounded buffers.

I did some benchmarking on both options.
I can't see any difference in terms of
- CPU performance,
- memory usage, and
- stockage size.

I used this file: `datasize.jsonnet`
```jsonnet
{
  patterns: {
    num: {
      regex: @'([0-9]+)',
    },
  },
  streams: {
    s1: {
      cmd: ['seq', '-w', '499999'],
      filters: {
        f1: {
          regex: [
            '^<num>$',
          ],
          retry: 10,
          retryperiod: '1m',
          actions: {
            a: {
              cmd: ['true'],
            },
            b: {
              cmd: ['true'],
              after: '1m',
            },
          },
        },
      },
    },
  },
}
```
And this commands:

```
rm reaction-*
sudo systemd-run --wait -p User=ao -p MemoryAccounting=yes -p WorkingDirectory=(pwd) -p Environment=PATH=/run/current-system/sw/bin/ time ./target/release/reaction start -c datasize.jsonnet && ls -l reaction-matches.db
sudo systemd-run --wait -p User=ao -p MemoryAccounting=yes -p WorkingDirectory=(pwd) -p Environment=PATH=/run/current-system/sw/bin/ time ./target/release/reaction start -c datasize.jsonnet && ls -l reaction-matches.db
sudo systemd-run --wait -p User=ao -p MemoryAccounting=yes -p WorkingDirectory=(pwd) -p Environment=PATH=/run/current-system/sw/bin/ time ./target/release/reaction start -c datasize.jsonnet && ls -l reaction-matches.db
```
At the first invocation, reaction reads no DB.
At the second invocation, reaction reads a DB.
At the third invocation, reaction reads a double-sized DB.
2024-10-24 12:00:00 +02:00
ppom
cd206d77a7 Use thiserror macros 2024-10-24 12:00:00 +02:00
ppom
544af2283d Remove anyhow crate 2024-10-24 12:00:00 +02:00
ppom
69d2436847 database tests; better error handling (avoid unwraping) 2024-10-24 12:00:00 +02:00
ppom
4b2f760e12 first draft of database
untested for now
2024-10-24 12:00:00 +02:00
ppom
77be68c3a4 matches_manager unmatch logic
timer implementation
2024-10-24 12:00:00 +02:00
ppom
f8b09faa9a iteration on daemon
- handle interruption signals
- config in Arc
2024-10-24 12:00:00 +02:00
ppom
2b1ee51f97 use log package 2024-10-24 12:00:00 +02:00
ppom
8f132df4ac yaml support 2024-10-24 12:00:00 +02:00
ppom
582ba571dc WIP configuration setup 2024-10-24 12:00:00 +02:00
ppom
b39868b228 initial rust commit 2024-10-24 12:00:00 +02:00