reaction/rust/datasize.jsonnet
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

30 lines
477 B
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',
},
},
},
},
},
},
}