<

Tips & Tricks

layout for the 'tree' btreemap

lk --private watch --bare --mode ${2:-tree-desc} --no-new --write "stdout-expr:[group:str] [domain:str] [depth:str] [spacename:str] [pubkey:str] :: { [create:str] [hash:str] [recv:str] }"

dot graph

lk --private watch --bare --mode ${2:-tree-desc} --no-new --write "stdout-expr:[group:str] [domain:str] [depth:str] [spacename:str] [pubkey:str] :: { [create:str] [hash:str] [recv:str] }"

Reading/Writing large files

export FILE=$2
export CHAN=${3:-default}
export IN=${4:-$FILE}
cat "$IN" | lk data | lk --env collect blobs:$LK_GROUP:/[env:CHAN]/[env:FILE] --write db --forward db
export FILE=$2
export CHAN=${3:-default}
export OUT=${4:-$FILE}
lk --env watch "blobs:$LK_GROUP:/[env:CHAN]/[env:FILE]" --max 1 | \
     lk --env get-links -R --forward null --write "file-expr:[env:OUT]:[data]" pause
      ;;

A poor man's REPL

lk eval [argv:-1] argv -D'\n' --data-eval --data-stdin 

Each read goes into argv, which is added to the context of each read.

hello
[0] world
The value of \[1\] = [1]
# press Ctrl-d to close stdin

prints The value of [1] = hello world

Single thread performance:

FIXME: The debug build is significant slower - especially for keypoint:

lscpu | grep "Model name"
lk --version
echo Datapoints
lk data --data /dev/zero --data-reads 10000 | pv > /dev/null
echo Linkpoints  
lk link :: --data-reads 10000 --create-int 0 --multi --data /dev/zero | pv > /dev/null
echo keypoints
lk keypoint :: --password "my secret" --data-reads 1000 --create-int 0 --multi --data /dev/zero | pv > /dev/null

Created: 2023-11-05 Sun 09:20