Skip to content

Commit

Permalink
report 1brc stats
Browse files Browse the repository at this point in the history
  • Loading branch information
briangu committed Jan 7, 2024
1 parent fb8e5bf commit 17f66bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/1brc/par.kg
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.py("par.py")

:" summarize results "
stations::{[s];s::{x@0}'x;s@<s}
result::{(1.1$x@0),"/",(1.1$(:[x@3;(x@2)%x@3;0])),"/",(1.1$x@1)}
stats::{[m r];m::x;r:::{};{r,x,,result(m?x)}'stations(m);r}

r::load(.os.argv@0)
.p(r)
.p(stats(r))
2 changes: 1 addition & 1 deletion examples/1brc/par.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ def process(

def load(fname):
cpu_count, start_end = chunks(fname)
return process(cpu_count, start_end)
return process(cpu_count, start_end)[0]


0 comments on commit 17f66bc

Please sign in to comment.