... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| CPU | Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz | |
| Runtime | Deno 2.1.3 (x86_64-pc-windows-msvc) | |
| benchmark time/iter (avg) iter/s (min … max) p75 p99 p995 | |
| ----------------------- ----------------------------- --------------------- -------------------------- | |
| group part one | |
| part one 382.0 µs 2,618 (358.9 µs … 964.1 µs) 376.7 µs 536.0 µs 574.4 µs | |
| part one with parsing 1.4 ms 737.2 ( 1.3 ms … 1.9 ms) 1.4 ms 1.7 ms 1.9 ms |
| #!/bin/bash | |
| # | |
| # This file echoes a bunch of color codes to the | |
| # terminal to demonstrate what's available. Each | |
| # line is the color code of one forground color, | |
| # out of 17 (default + 16 escapes), followed by a | |
| # test use of that color on all nine background | |
| # colors (default + 8 escapes). | |
| # |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| reduce(lambda result, (index, name): result + index * reduce(lambda s, l: s + ord(l) - ord('A') + 1, name, 0), enumerate(sorted(open('names.txt').read().replace('"', '').split(',')), 1), 0) |