What's everybody working on? (July Edition)

I’m still working on a succinct data structure library for Zig. So far got the rank-0/rank-1/select-0/select-1 operations performed solidly, after several changes of algorithms and rounds of algorithm evolution. Also a balanced parentheses bit vector built on top of the lower level operations with a Range Min/Max Tree implementation is done, but the performance of RMMTree is atrocious; need another rounds of algorithm evolution. Once that’s done, succinct data structure trees can be implemented.

For demo, not much to show for a low level library. May be some benchmark numbers. It’s run on a single core of a mid tier laptop of last year model (Intel Core Ultra 7 255H).

Benchmark - rank, sequential, various bit sizes and densities

Alg: Popzy, bits: 100.0M, bit density: 0.01%, bit randomization: 10.84ms, vec build: 2.44ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(), 100.0M,   5.0M,   0.01%,          32,     8.38,    1.68
sequential rank(), 100.0M,   5.0M,   0.01%,         128,     9.66,    1.93
sequential rank(), 100.0M,   5.0M,   0.01%,         512,    18.45,    3.69
sequential rank(), 100.0M,   5.0M,   0.01%,        4096,    23.81,    4.77
sequential rank(), 100.0M,   5.0M,   0.01%,       65536,    19.27,    3.87
sequential rank(), 100.0M,   4.7M,   0.01%,      524288,    22.44,    4.76
sequential rank(), 100.0M,   4.2M,   0.01%,     4194304,    21.45,    5.12
sequential rank(), 100.0M,   8.4M,   0.01%,    16777216,    43.22,    5.15
sequential rank(), 100.0M,   8.4M,   0.01%,    67108864,    43.18,    5.15

Alg: Popzy, bits: 100.0M, bit density: 10.00%, bit randomization: 765.02ms, vec build: 3.14ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(), 100.0M,   5.0M,  10.00%,          32,     8.38,    1.68
sequential rank(), 100.0M,   5.0M,  10.00%,         128,     9.68,    1.94
sequential rank(), 100.0M,   5.0M,  10.00%,         512,    17.55,    3.51
sequential rank(), 100.0M,   5.0M,  10.00%,        4096,    25.26,    5.06
sequential rank(), 100.0M,   5.0M,  10.00%,       65536,    26.02,    5.22
sequential rank(), 100.0M,   4.7M,  10.00%,      524288,    24.85,    5.27
sequential rank(), 100.0M,   4.2M,  10.00%,     4194304,    22.40,    5.34
sequential rank(), 100.0M,   8.4M,  10.00%,    16777216,    43.14,    5.14
sequential rank(), 100.0M,   8.4M,  10.00%,    67108864,    44.31,    5.28

Alg: Popzy, bits: 100.0M, bit density: 50.00%, bit randomization: 16.87ms, vec build: 2.73ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(), 100.0M,   5.0M,  50.00%,          32,     8.38,    1.68
sequential rank(), 100.0M,   5.0M,  50.00%,         128,     9.69,    1.94
sequential rank(), 100.0M,   5.0M,  50.00%,         512,    19.87,    3.97
sequential rank(), 100.0M,   5.0M,  50.00%,        4096,    26.51,    5.30
sequential rank(), 100.0M,   5.0M,  50.00%,       65536,    26.55,    5.33
sequential rank(), 100.0M,   4.7M,  50.00%,      524288,    23.97,    5.08
sequential rank(), 100.0M,   4.2M,  50.00%,     4194304,    21.29,    5.08
sequential rank(), 100.0M,   8.4M,  50.00%,    16777216,    42.08,    5.02
sequential rank(), 100.0M,   8.4M,  50.00%,    67108864,    44.98,    5.36

Alg: Popzy, bits: 500.0M, bit density: 0.01%, bit randomization: 73.05ms, vec build: 16.11ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(), 500.0M,   5.0M,   0.01%,          32,     8.38,    1.68
sequential rank(), 500.0M,   5.0M,   0.01%,         128,    10.14,    2.03
sequential rank(), 500.0M,   5.0M,   0.01%,         512,    18.57,    3.71
sequential rank(), 500.0M,   5.0M,   0.01%,        4096,    26.02,    5.21
sequential rank(), 500.0M,   5.0M,   0.01%,       65536,    25.54,    5.13
sequential rank(), 500.0M,   4.7M,   0.01%,      524288,    24.50,    5.19
sequential rank(), 500.0M,   4.2M,   0.01%,     4194304,    21.74,    5.18
sequential rank(), 500.0M,   8.4M,   0.01%,    16777216,    40.02,    4.77
sequential rank(), 500.0M,   8.4M,   0.01%,    67108864,    44.31,    5.28
sequential rank(), 500.0M,  24.4M,   0.01%,   268435456,   124.53,    5.10

Alg: Popzy, bits: 500.0M, bit density: 10.00%, bit randomization: 3931.88ms, vec build: 13.62ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(), 500.0M,   5.0M,  10.00%,          32,     7.19,    1.44
sequential rank(), 500.0M,   5.0M,  10.00%,         128,     7.72,    1.54
sequential rank(), 500.0M,   5.0M,  10.00%,         512,    14.32,    2.86
sequential rank(), 500.0M,   5.0M,  10.00%,        4096,    20.05,    4.01
sequential rank(), 500.0M,   5.0M,  10.00%,       65536,    25.19,    5.06
sequential rank(), 500.0M,   4.7M,  10.00%,      524288,    25.28,    5.36
sequential rank(), 500.0M,   4.2M,  10.00%,     4194304,    21.91,    5.22
sequential rank(), 500.0M,   8.4M,  10.00%,    16777216,    42.96,    5.12
sequential rank(), 500.0M,   8.4M,  10.00%,    67108864,    45.49,    5.42
sequential rank(), 500.0M,  24.4M,  10.00%,   268435456,   125.15,    5.13

Alg: Popzy, bits: 500.0M, bit density: 50.00%, bit randomization: 82.94ms, vec build: 15.01ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(), 500.0M,   5.0M,  50.00%,          32,     8.68,    1.74
sequential rank(), 500.0M,   5.0M,  50.00%,         128,    10.92,    2.18
sequential rank(), 500.0M,   5.0M,  50.00%,         512,    19.10,    3.82
sequential rank(), 500.0M,   5.0M,  50.00%,        4096,    25.18,    5.04
sequential rank(), 500.0M,   5.0M,  50.00%,       65536,    25.07,    5.03
sequential rank(), 500.0M,   4.7M,  50.00%,      524288,    24.84,    5.26
sequential rank(), 500.0M,   4.2M,  50.00%,     4194304,    21.15,    5.04
sequential rank(), 500.0M,   8.4M,  50.00%,    16777216,    43.06,    5.13
sequential rank(), 500.0M,   8.4M,  50.00%,    67108864,    47.06,    5.61
sequential rank(), 500.0M,  24.4M,  50.00%,   268435456,   103.84,    4.26

Alg: Popzy, bits: 1.0B, bit density: 0.01%, bit randomization: 145.83ms, vec build: 31.45ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(),   1.0B,   5.0M,   0.01%,          32,     8.41,    1.68
sequential rank(),   1.0B,   5.0M,   0.01%,         128,     9.65,    1.93
sequential rank(),   1.0B,   5.0M,   0.01%,         512,    17.22,    3.44
sequential rank(),   1.0B,   5.0M,   0.01%,        4096,    24.65,    4.93
sequential rank(),   1.0B,   5.0M,   0.01%,       65536,    25.11,    5.04
sequential rank(),   1.0B,   4.7M,   0.01%,      524288,    19.51,    4.13
sequential rank(),   1.0B,   4.2M,   0.01%,     4194304,    19.61,    4.68
sequential rank(),   1.0B,   8.4M,   0.01%,    16777216,    43.99,    5.24
sequential rank(),   1.0B,   8.4M,   0.01%,    67108864,    44.78,    5.34
sequential rank(),   1.0B,  24.4M,   0.01%,   268435456,   117.80,    4.83
sequential rank(),   1.0B,  48.8M,   0.01%,   536870912,   236.98,    4.86

Alg: Popzy, bits: 1.0B, bit density: 10.00%, bit randomization: 7970.90ms, vec build: 27.95ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(),   1.0B,   5.0M,  10.00%,          32,     6.71,    1.34
sequential rank(),   1.0B,   5.0M,  10.00%,         128,     9.66,    1.93
sequential rank(),   1.0B,   5.0M,  10.00%,         512,    18.54,    3.71
sequential rank(),   1.0B,   5.0M,  10.00%,        4096,    24.82,    4.97
sequential rank(),   1.0B,   5.0M,  10.00%,       65536,    25.06,    5.03
sequential rank(),   1.0B,   4.7M,  10.00%,      524288,    24.95,    5.29
sequential rank(),   1.0B,   4.2M,  10.00%,     4194304,    21.35,    5.09
sequential rank(),   1.0B,   8.4M,  10.00%,    16777216,    42.23,    5.03
sequential rank(),   1.0B,   8.4M,  10.00%,    67108864,    44.09,    5.26
sequential rank(),   1.0B,  24.4M,  10.00%,   268435456,   113.57,    4.65
sequential rank(),   1.0B,  48.8M,  10.00%,   536870912,   225.44,    4.62

Alg: Popzy, bits: 1.0B, bit density: 50.00%, bit randomization: 167.22ms, vec build: 27.63ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(),   1.0B,   5.0M,  50.00%,          32,     6.56,    1.31
sequential rank(),   1.0B,   5.0M,  50.00%,         128,     7.59,    1.52
sequential rank(),   1.0B,   5.0M,  50.00%,         512,    15.90,    3.18
sequential rank(),   1.0B,   5.0M,  50.00%,        4096,    19.42,    3.89
sequential rank(),   1.0B,   5.0M,  50.00%,       65536,    23.16,    4.65
sequential rank(),   1.0B,   4.7M,  50.00%,      524288,    19.97,    4.23
sequential rank(),   1.0B,   4.2M,  50.00%,     4194304,    20.99,    5.01
sequential rank(),   1.0B,   8.4M,  50.00%,    16777216,    36.10,    4.30
sequential rank(),   1.0B,   8.4M,  50.00%,    67108864,    45.12,    5.38
sequential rank(),   1.0B,  24.4M,  50.00%,   268435456,   103.24,    4.23
sequential rank(),   1.0B,  48.8M,  50.00%,   536870912,   204.88,    4.20

Alg: Popzy, bits: 5.0B, bit density: 0.01%, bit randomization: 677.25ms, vec build: 140.22ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(),   5.0B,   5.0M,   0.01%,          32,     8.47,    1.69
sequential rank(),   5.0B,   5.0M,   0.01%,         128,    10.46,    2.09
sequential rank(),   5.0B,   5.0M,   0.01%,         512,    18.86,    3.77
sequential rank(),   5.0B,   5.0M,   0.01%,        4096,    26.26,    5.26
sequential rank(),   5.0B,   5.0M,   0.01%,       65536,    25.13,    5.04
sequential rank(),   5.0B,   4.7M,   0.01%,      524288,    25.66,    5.44
sequential rank(),   5.0B,   4.2M,   0.01%,     4194304,    20.48,    4.88
sequential rank(),   5.0B,   8.4M,   0.01%,    16777216,    42.00,    5.01
sequential rank(),   5.0B,   8.4M,   0.01%,    67108864,    44.85,    5.35
sequential rank(),   5.0B,  24.4M,   0.01%,   268435456,   110.34,    4.52
sequential rank(),   5.0B,  48.8M,   0.01%,   536870912,   221.03,    4.53
sequential rank(),   5.0B,  97.6M,   0.01%,  1073741824,   466.10,    4.78
sequential rank(),   5.0B, 390.5M,   0.01%,  4294967296,  1869.38,    4.79

Alg: Popzy, bits: 5.0B, bit density: 10.00%, bit randomization: 37437.64ms, vec build: 148.12ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(),   5.0B,   5.0M,  10.00%,          32,     6.59,    1.32
sequential rank(),   5.0B,   5.0M,  10.00%,         128,     9.45,    1.89
sequential rank(),   5.0B,   5.0M,  10.00%,         512,    15.15,    3.03
sequential rank(),   5.0B,   5.0M,  10.00%,        4096,    22.07,    4.42
sequential rank(),   5.0B,   5.0M,  10.00%,       65536,    22.49,    4.52
sequential rank(),   5.0B,   4.7M,  10.00%,      524288,    23.42,    4.96
sequential rank(),   5.0B,   4.2M,  10.00%,     4194304,    19.70,    4.70
sequential rank(),   5.0B,   8.4M,  10.00%,    16777216,    37.49,    4.47
sequential rank(),   5.0B,   8.4M,  10.00%,    67108864,    38.69,    4.61
sequential rank(),   5.0B,  24.4M,  10.00%,   268435456,   119.01,    4.88
sequential rank(),   5.0B,  48.8M,  10.00%,   536870912,   248.32,    5.09
sequential rank(),   5.0B,  97.6M,  10.00%,  1073741824,   451.21,    4.62
sequential rank(),   5.0B, 390.5M,  10.00%,  4294967296,  1926.23,    4.93

Alg: Popzy, bits: 5.0B, bit density: 50.00%, bit randomization: 793.55ms, vec build: 142.69ms

Type,                Bits,  Calls, Density,    Bit Span, Run (ms), ns/rank
sequential rank(),   5.0B,   5.0M,  50.00%,          32,     6.75,    1.35
sequential rank(),   5.0B,   5.0M,  50.00%,         128,     7.75,    1.55
sequential rank(),   5.0B,   5.0M,  50.00%,         512,    16.42,    3.28
sequential rank(),   5.0B,   5.0M,  50.00%,        4096,    22.90,    4.58
sequential rank(),   5.0B,   5.0M,  50.00%,       65536,    24.03,    4.82
sequential rank(),   5.0B,   4.7M,  50.00%,      524288,    21.95,    4.65
sequential rank(),   5.0B,   4.2M,  50.00%,     4194304,    18.53,    4.42
sequential rank(),   5.0B,   8.4M,  50.00%,    16777216,    35.44,    4.23
sequential rank(),   5.0B,   8.4M,  50.00%,    67108864,    36.85,    4.39
sequential rank(),   5.0B,  24.4M,  50.00%,   268435456,   120.41,    4.93
sequential rank(),   5.0B,  48.8M,  50.00%,   536870912,   225.48,    4.62
sequential rank(),   5.0B,  97.6M,  50.00%,  1073741824,   422.77,    4.33
sequential rank(),   5.0B, 390.5M,  50.00%,  4294967296,  1832.38,    4.69

-----------------------

Benchmark - rank, random, various bit sizes and densities

Alg: Popzy, bits: 100.0M, bit density: 0.01%, bit randomization: 10.95ms, vec build: 2.54ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 100.0M,  5.0M,   0.01%,          32,     8.06,    1.61
random rank(), 100.0M,  5.0M,   0.01%,         128,    20.86,    4.17
random rank(), 100.0M,  5.0M,   0.01%,         512,    37.74,    7.55
random rank(), 100.0M,  5.0M,   0.01%,        4096,    36.83,    7.37
random rank(), 100.0M,  5.0M,   0.01%,       65536,    43.07,    8.61
random rank(), 100.0M,  5.0M,   0.01%,      524288,    45.44,    9.09
random rank(), 100.0M,  5.0M,   0.01%,     4194304,    44.10,    8.82
random rank(), 100.0M,  5.0M,   0.01%,    16777216,    42.12,    8.42
random rank(), 100.0M,  5.0M,   0.01%,    67108864,    51.31,   10.26

Alg: Popzy, bits: 100.0M, bit density: 10.00%, bit randomization: 779.41ms, vec build: 3.10ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 100.0M,  5.0M,  10.00%,          32,     7.09,    1.42
random rank(), 100.0M,  5.0M,  10.00%,         128,    22.23,    4.45
random rank(), 100.0M,  5.0M,  10.00%,         512,    35.91,    7.18
random rank(), 100.0M,  5.0M,  10.00%,        4096,    39.23,    7.85
random rank(), 100.0M,  5.0M,  10.00%,       65536,    38.43,    7.69
random rank(), 100.0M,  5.0M,  10.00%,      524288,    41.62,    8.32
random rank(), 100.0M,  5.0M,  10.00%,     4194304,    47.23,    9.45
random rank(), 100.0M,  5.0M,  10.00%,    16777216,    49.28,    9.86
random rank(), 100.0M,  5.0M,  10.00%,    67108864,    58.95,   11.79

Alg: Popzy, bits: 100.0M, bit density: 50.00%, bit randomization: 17.16ms, vec build: 2.48ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 100.0M,  5.0M,  50.00%,          32,     8.44,    1.69
random rank(), 100.0M,  5.0M,  50.00%,         128,    22.99,    4.60
random rank(), 100.0M,  5.0M,  50.00%,         512,    43.55,    8.71
random rank(), 100.0M,  5.0M,  50.00%,        4096,    46.12,    9.22
random rank(), 100.0M,  5.0M,  50.00%,       65536,    45.60,    9.12
random rank(), 100.0M,  5.0M,  50.00%,      524288,    47.05,    9.41
random rank(), 100.0M,  5.0M,  50.00%,     4194304,    46.58,    9.32
random rank(), 100.0M,  5.0M,  50.00%,    16777216,    39.75,    7.95
random rank(), 100.0M,  5.0M,  50.00%,    67108864,    52.04,   10.41

Alg: Popzy, bits: 500.0M, bit density: 0.01%, bit randomization: 74.13ms, vec build: 15.42ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 500.0M,  5.0M,   0.01%,          32,     8.53,    1.71
random rank(), 500.0M,  5.0M,   0.01%,         128,    25.02,    5.00
random rank(), 500.0M,  5.0M,   0.01%,         512,    41.17,    8.23
random rank(), 500.0M,  5.0M,   0.01%,        4096,    40.27,    8.05
random rank(), 500.0M,  5.0M,   0.01%,       65536,    43.57,    8.71
random rank(), 500.0M,  5.0M,   0.01%,      524288,    46.73,    9.35
random rank(), 500.0M,  5.0M,   0.01%,     4194304,    44.50,    8.90
random rank(), 500.0M,  5.0M,   0.01%,    16777216,    49.38,    9.88
random rank(), 500.0M,  5.0M,   0.01%,    67108864,    53.21,   10.64
random rank(), 500.0M,  5.0M,   0.01%,   268435456,   207.94,   41.59

Alg: Popzy, bits: 500.0M, bit density: 10.00%, bit randomization: 3825.75ms, vec build: 13.89ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 500.0M,  5.0M,  10.00%,          32,     7.20,    1.44
random rank(), 500.0M,  5.0M,  10.00%,         128,    24.29,    4.86
random rank(), 500.0M,  5.0M,  10.00%,         512,    37.44,    7.49
random rank(), 500.0M,  5.0M,  10.00%,        4096,    39.75,    7.95
random rank(), 500.0M,  5.0M,  10.00%,       65536,    38.36,    7.67
random rank(), 500.0M,  5.0M,  10.00%,      524288,    42.23,    8.45
random rank(), 500.0M,  5.0M,  10.00%,     4194304,    40.48,    8.10
random rank(), 500.0M,  5.0M,  10.00%,    16777216,    42.76,    8.55
random rank(), 500.0M,  5.0M,  10.00%,    67108864,    60.24,   12.05
random rank(), 500.0M,  5.0M,  10.00%,   268435456,   197.78,   39.56

Alg: Popzy, bits: 500.0M, bit density: 50.00%, bit randomization: 88.04ms, vec build: 14.92ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 500.0M,  5.0M,  50.00%,          32,     8.93,    1.79
random rank(), 500.0M,  5.0M,  50.00%,         128,    25.75,    5.15
random rank(), 500.0M,  5.0M,  50.00%,         512,    39.11,    7.82
random rank(), 500.0M,  5.0M,  50.00%,        4096,    39.90,    7.98
random rank(), 500.0M,  5.0M,  50.00%,       65536,    37.46,    7.49
random rank(), 500.0M,  5.0M,  50.00%,      524288,    44.89,    8.98
random rank(), 500.0M,  5.0M,  50.00%,     4194304,    42.09,    8.42
random rank(), 500.0M,  5.0M,  50.00%,    16777216,    45.95,    9.19
random rank(), 500.0M,  5.0M,  50.00%,    67108864,    51.74,   10.35
random rank(), 500.0M,  5.0M,  50.00%,   268435456,   189.72,   37.94

Alg: Popzy, bits: 1.0B, bit density: 0.01%, bit randomization: 159.74ms, vec build: 31.09ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 1.0B,  5.0M,   0.01%,          32,     8.49,    1.70
random rank(), 1.0B,  5.0M,   0.01%,         128,    25.58,    5.12
random rank(), 1.0B,  5.0M,   0.01%,         512,    47.45,    9.49
random rank(), 1.0B,  5.0M,   0.01%,        4096,    44.59,    8.92
random rank(), 1.0B,  5.0M,   0.01%,       65536,    42.59,    8.52
random rank(), 1.0B,  5.0M,   0.01%,      524288,    43.94,    8.79
random rank(), 1.0B,  5.0M,   0.01%,     4194304,    47.72,    9.54
random rank(), 1.0B,  5.0M,   0.01%,    16777216,    41.72,    8.34
random rank(), 1.0B,  5.0M,   0.01%,    67108864,    52.81,   10.56
random rank(), 1.0B,  5.0M,   0.01%,   268435456,   205.82,   41.16
random rank(), 1.0B,  5.0M,   0.01%,   536870912,   231.00,   46.20

Alg: Popzy, bits: 1.0B, bit density: 10.00%, bit randomization: 6702.79ms, vec build: 31.05ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 1.0B,  5.0M,  10.00%,          32,     7.65,    1.53
random rank(), 1.0B,  5.0M,  10.00%,         128,    21.76,    4.35
random rank(), 1.0B,  5.0M,  10.00%,         512,    45.64,    9.13
random rank(), 1.0B,  5.0M,  10.00%,        4096,    41.77,    8.35
random rank(), 1.0B,  5.0M,  10.00%,       65536,    39.48,    7.90
random rank(), 1.0B,  5.0M,  10.00%,      524288,    44.94,    8.99
random rank(), 1.0B,  5.0M,  10.00%,     4194304,    38.94,    7.79
random rank(), 1.0B,  5.0M,  10.00%,    16777216,    50.76,   10.15
random rank(), 1.0B,  5.0M,  10.00%,    67108864,    45.39,    9.08
random rank(), 1.0B,  5.0M,  10.00%,   268435456,   176.98,   35.40
random rank(), 1.0B,  5.0M,  10.00%,   536870912,   230.69,   46.14

Alg: Popzy, bits: 1.0B, bit density: 50.00%, bit randomization: 170.83ms, vec build: 26.43ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 1.0B,  5.0M,  50.00%,          32,     8.93,    1.79
random rank(), 1.0B,  5.0M,  50.00%,         128,    21.96,    4.39
random rank(), 1.0B,  5.0M,  50.00%,         512,    41.40,    8.28
random rank(), 1.0B,  5.0M,  50.00%,        4096,    38.13,    7.63
random rank(), 1.0B,  5.0M,  50.00%,       65536,    41.73,    8.35
random rank(), 1.0B,  5.0M,  50.00%,      524288,    42.79,    8.56
random rank(), 1.0B,  5.0M,  50.00%,     4194304,    43.23,    8.65
random rank(), 1.0B,  5.0M,  50.00%,    16777216,    45.24,    9.05
random rank(), 1.0B,  5.0M,  50.00%,    67108864,    56.31,   11.26
random rank(), 1.0B,  5.0M,  50.00%,   268435456,   182.11,   36.42
random rank(), 1.0B,  5.0M,  50.00%,   536870912,   219.59,   43.92

Alg: Popzy, bits: 5.0B, bit density: 0.01%, bit randomization: 772.96ms, vec build: 153.86ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 5.0B,  5.0M,   0.01%,          32,     8.43,    1.69
random rank(), 5.0B,  5.0M,   0.01%,         128,    25.24,    5.05
random rank(), 5.0B,  5.0M,   0.01%,         512,    47.74,    9.55
random rank(), 5.0B,  5.0M,   0.01%,        4096,    44.78,    8.96
random rank(), 5.0B,  5.0M,   0.01%,       65536,    47.42,    9.48
random rank(), 5.0B,  5.0M,   0.01%,      524288,    48.63,    9.73
random rank(), 5.0B,  5.0M,   0.01%,     4194304,    50.14,   10.03
random rank(), 5.0B,  5.0M,   0.01%,    16777216,    43.03,    8.61
random rank(), 5.0B,  5.0M,   0.01%,    67108864,    50.17,   10.03
random rank(), 5.0B,  5.0M,   0.01%,   268435456,   205.39,   41.08
random rank(), 5.0B,  5.0M,   0.01%,   536870912,   233.29,   46.66
random rank(), 5.0B,  5.0M,   0.01%,  1073741824,   244.06,   48.81
random rank(), 5.0B,  5.0M,   0.01%,  4294967296,   274.50,   54.90

Alg: Popzy, bits: 5.0B, bit density: 10.00%, bit randomization: 37061.15ms, vec build: 157.38ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 5.0B,  5.0M,  10.00%,          32,     6.60,    1.32
random rank(), 5.0B,  5.0M,  10.00%,         128,    21.65,    4.33
random rank(), 5.0B,  5.0M,  10.00%,         512,    45.11,    9.02
random rank(), 5.0B,  5.0M,  10.00%,        4096,    47.33,    9.47
random rank(), 5.0B,  5.0M,  10.00%,       65536,    48.66,    9.73
random rank(), 5.0B,  5.0M,  10.00%,      524288,    47.99,    9.60
random rank(), 5.0B,  5.0M,  10.00%,     4194304,    51.25,   10.25
random rank(), 5.0B,  5.0M,  10.00%,    16777216,    45.76,    9.15
random rank(), 5.0B,  5.0M,  10.00%,    67108864,    44.49,    8.90
random rank(), 5.0B,  5.0M,  10.00%,   268435456,   194.22,   38.84
random rank(), 5.0B,  5.0M,  10.00%,   536870912,   224.47,   44.89
random rank(), 5.0B,  5.0M,  10.00%,  1073741824,   246.36,   49.27
random rank(), 5.0B,  5.0M,  10.00%,  4294967296,   268.75,   53.75

Alg: Popzy, bits: 5.0B, bit density: 50.00%, bit randomization: 857.09ms, vec build: 150.40ms

Type,          Bits, Calls, Density,    Bit Span, Run (ms), ns/rank
random rank(), 5.0B,  5.0M,  50.00%,          32,     8.50,    1.70
random rank(), 5.0B,  5.0M,  50.00%,         128,    26.07,    5.21
random rank(), 5.0B,  5.0M,  50.00%,         512,    45.86,    9.17
random rank(), 5.0B,  5.0M,  50.00%,        4096,    45.88,    9.18
random rank(), 5.0B,  5.0M,  50.00%,       65536,    48.61,    9.72
random rank(), 5.0B,  5.0M,  50.00%,      524288,    48.25,    9.65
random rank(), 5.0B,  5.0M,  50.00%,     4194304,    49.02,    9.80
random rank(), 5.0B,  5.0M,  50.00%,    16777216,    50.08,   10.02
random rank(), 5.0B,  5.0M,  50.00%,    67108864,    54.03,   10.81
random rank(), 5.0B,  5.0M,  50.00%,   268435456,   206.23,   41.25
random rank(), 5.0B,  5.0M,  50.00%,   536870912,   220.71,   44.14
random rank(), 5.0B,  5.0M,  50.00%,  1073741824,   243.24,   48.65
random rank(), 5.0B,  5.0M,  50.00%,  4294967296,   267.92,   53.58

2 Likes

I’ve been working on nnng, a wrapper around nng (https://nng.nanomsg.org/) built on Zig’s new IO model:

Some highlights:

  • Uses Zig’s new IO model throughout.
  • A thin wrapper around nng with protocol-specific socket types.
  • Polling is implemented on top of Zig’s IO.
  • Includes a small RPC abstraction built on top of REQ/REP.

It actually started as infrastructure for another project of mine, zig-omelet (a sqlc-inspired TypeScript binding generator for DuckDB SQL), but ended up becoming its own library.

I’m using both projects to explore what’s possible with Zig’s new IO model.

sounds interesting, I wanted to do something like that but in javascript and/or in lisp. is it public anywhere? i can’t see it in your github.

No, it’s private for now. I was heavily AI-assisted, I didn’t want to make the code public until it’s 100% done.

I originally wanted to do it in a higher-level language, but decided to go with OCaml, as it was much much easier to write the frontend that way. I’m glad I did, because past the frontend, interptered language would be way too slow to actually run the comptime.

For example, with the OCaml version, it takes around 50 minutes on my laptop (old Intel i5-10210U) to parse and analyze (i.e. run comptime / type analysis) the bootstrap version of the Zig compiler. It would be order of magnitude slower in JS.

If there is interest, I might make it public, but I don’t see the point for now. I was doing this from scratch, not by copying the Zig compiler and it was a mistake, the comptime execution rules are pretty much only encoded there. I used a different approach for escape analysis of comptime memory / ptrs, and it causes runtime errors later on, I might need to do yet another pass and change the comptime memory model, if I want to finish it.

Anyway, it is able to run many Zig programs, just not the Zig compiler yet, which was my target.

1 Like

A Simple Introduction to Threads in Zig 0.16 for Beginners.

7 Likes

I am working on a ssg for my website. I have been on a yakshaving adventure and understanding how various allocators matter in this context. Profiling things with valgrind (massif)

2 Likes

this would be awesome, i use python at my job and would like to start sneaking some zig in haha

Hm, I only wanted to do a simple interpreter, and I was thinking about using template literals + eval() for comptime instantiations (poorman’s JIT), and I’d definitely go from scratch too :sweat_smile:

I already have super-simple tokenizer+docblock parser (golfed to ~70 lines) for the purpose of generating docs in tokamak, so I thought I could expand it a bit and build some toy PoC on top of that.

Well, it’s not that easy, because Zig depends on the fact that variables have addresses and that you can slice the backing bytes, etc. So you can’t really express u32 using JS primitives, you actually need to implement the memory model correctly. And runtime/comptime have different rules with regards to taking pointers of variables, for example returning &foo where foo is a local variable is invalid from a runtime function, but it’s perfectly valid in comptime. But yeah, if you want a scripting language that feels like Zig, then it’s much easier. :slight_smile:

hi :waving_hand:

These days, I am preparing a talk for the Zigtoberfest. The primary goal is to create something interesting and informative for all.

I also started learning the alien language so I can understand all questions from the audience. :alien:

1 Like

then proceeds to make which will go down in history, it would be just funny

1 Like

Currently working on decoding Nikon NEF raw image files, since I am no longer happy with darktable in my photography.

The format is basically “just” TIFF with custom vendor extensions. But there are multiple variants of it and no actionable documentation. As such I needed to reverse-engineer the interesting C code of dcraw to understand how the compression works. I suspect there are a few potential performance gains over dcraw’s decoding method, but I’ll probably need to sit down with pen and paper for an hour or two to get them. I am also working on compiling my notes into usable documentation.

Since I now have decoded the pixel grid, I can start with post processing. I think for the next few days I’ll limit myself to working with the grey image to see what can be done without de-bayering and turning it into a colour image. I have already had some fun with tone curves.

Now photography for me is more art than documentation, so I won’t waste time on “accurate” colour representation or similar silliness. Instead my focus currently is on fun 90s dithering and palette-ing techniques. I might try to make it look like film eventually, but that’s a far out goal.

Ultimately I want to try to compile this to webassembly to create a usable in-browser raw editor.

17 Likes

I’m probably late to this post, but I’m working on a project called Zat4, a social media app on the AT protocol with its own app view, so no overlap with Bluesky. connoravila/Zat4: An app made in Zig on the AT Protocol. - Codeberg.org

The primary feature I’ve been working on is algorithmic freedom. After trying out Bluesky’s feeds, I found myself supremely disappointed. They were not a real solution to the algorithm black box society we live in, so for Zat4, all the algorithms are subject to the same rules, no one including myself, can override these rules. All behavioral data is only able to be stored locally. And anyone can create an algorithm. Currently I have it planned for an easy user-friendly option, and a more complicated dev option for serious/complex algorithms.

When you sign up, you’re able to configure if you want to load in with a handful of default algorithms, just the following algo, or none at all.

These algorithms are kept in a “socket,” and every surface on the app that sorts, has its own socket.

Screencast From 2026-07-09 15-56-23.webm video-to-gif output image

For example, here on the main feed, I can change from following to Zat4 Discover, that is more of a conventional algorithm that will track behavioral data, but as mentioned, no one can access it as it’s stored locally.

Then, if we go to the replies, we can see it has its own socket:

(whoops I can only embed one gif since I’m a new user, but imagine something really cool)

And it will be the same for the search function and anything else that requires sorting.

Still quite a lot to sort out, but I think it’s a cool idea. The idealist in me hopes that if the algorithms are an open marketplace, people can compete/grow together as a community to make the overall quality of the algorithms better, and figure out the best way to satisfy different use cases for people, to the point where if you tried to go back to Twitter or Reddit or whatever, that you would actually miss being able to switch algorithms for different days or different moods.

(whoops I can only embed one gif since I’m a new user, but imagine something really cool)

And what the heck, now that I’m ranting, I’m also working on something called “zones” within Zat4. The basic idea is that any first time use of a hashtag creates a zone. If I post #ZigIsAwesome and no one has posted that before, then it will create a new zone. Zones are similar in feel to like a subreddit but are structurally the complete opposite. Zones are completely emergent, there’s no moderators or anything.

(whoops I can only embed one gif since I’m a new user, but imagine something really cool)

And the default zone algorithms will value and weigh the time spent in a zone, aka how active one is using the hashtag and participating within it, and because it is ridiculously easy to create a new zone, if you decide #ZigIsAwesome no longer feels like the community you originally joined for, you can just make another one, #ZigIsGOATED, and your followers can choose to interact or not with the new zone. There’s not the same lock in as you’d find in like a subreddit.

So that’s the gist of it…

But…

most importantly…

There is a filter to make it look like Windows XP!

(whoops I can only embed one gif since I’m a new user, but imagine something really cool)

7 Likes

It’s still July, so not too late. :smiley: Welcome to Ziggit.

1 Like

I just fell in love with Zig past month and started to study it.

I wrote this blog post, it’s not much, but i am committed to keep it up to date, doing the necessary changes on it as new versions come and might change something sampled in it.

2 Likes

ziglings! I am not of a system programmer but I saw Andrew’s interviews recently and felt just a breath of fresh air compared to all that’s happening in the “tech” world in general.

1 Like

July - still working on my offline-first PWA wasm framework.

It taking a while, but I think I have crossed the line now from questioning my life’s choices through to seeing some light at the end of the tunnel at last.

It’s a bit hard to describe yet, but what it does is build a “native” app for Desktop/iOS/Android as a single wasm binary, and a single small html index loader, using PWA.

An app using this framework is a collection of functions/components that manage state, and output html markup for UI rendering. There is no jumping around between wasm and js to manage the DOM .. the app just streams HTML to a buffered writer, and the engine picks this up on the js side and uses idiomorph to patch it into the DOM.

You connect the markup to wasm functions using htmx-style attribs (more Datastar style actually)

So it’s pretty much like immediate mode - components have a render() fn that projects their current state to html through a template. All streams, no allocations needed, no direct DOM lookups. Simple in theory.

Uses OPFS for persistence, using a custom Io.Writer again. I’m generally saving and loading large files (game saves and documents) as .zon format files in the private filesystem sandbox.

It’s pretty cool - can dev and test on local in a browser, then install with 1 click onto an iPad, and it runs as full blown app with no network access needed. The apps run FAST on even cheap devices.

Next couple of months - extending this so that it can bounce data off an online server to do multi-player.

5 Likes

I’ve been rewriting the heck out of my roaring bitmap project lately trying to make it faster. And for the first time its even or slightly faster than CRoaring on all 3 of the benchmarks i’ve shared in my project thread :slightly_smiling_face:.

Still a long way to go before it can do everything CRoaring can. Right now I’ve implemented around 68% of the roaring_bitmap prefixed API methods. So if you need a fast, compressed bitmap which can do logical operations (such as and, or, xor, andnot, flip…), give this project a try.

I’ve been regularly fuzzing it against CRoaring with the zig fuzzer and AFL. And also running “allocation failures” tests. So it should be pretty well behaved. Docs are available although they do need some work :sweat_smile:.

1 Like

Finally managed to make some progress on my modbus gateway.
Now it can recover from network errors and timeouts, which is pretty cool to see in action!
The code is a bit messy imho, I can do better but I really wanted to see it working :slight_smile:
Here’s the code if you’re interested.

And here’s a quick demo:
Screencast_20260711_151715

Next step will be adding MQTT to push data and logs to a remote server!

Continuing my work on family on-prem spreadsheet. As soon as I don’t have much time, I’ve focused on formula engine and its performance this month, no time for UI yet.


1 Like