stage2: update README

This commit is contained in:
Motiejus Jakštys 2023-02-08 16:40:39 +02:00
parent 000080a781
commit 345c38eb61

View File

@ -12,10 +12,10 @@ for environments that have a central user & group database which then needs to
be distributed to many servers/services, and the data does not change very be distributed to many servers/services, and the data does not change very
often (e.g. hourly). often (e.g. hourly).
This is the fastest known NSS passwd/group implementation for *reads*. On a This is the fastest known NSS passwd/group implementation for *reads*. On my
corpus with 10k users, 10k groups and 500 average members per group, `id` takes 2018-era laptop a corpus with 10k users, 10k groups and 500 average members per
17 seconds with the glibc default implementation, 10-17 milliseconds with a group, `id` takes 17 seconds with the glibc default implementation, 10-17
pre-cached `nscd`, ~8 milliseconds with `turbonss`. milliseconds with a pre-cached `nscd`, ~8 milliseconds with `turbonss`.
Project status Project status
-------------- --------------
@ -28,11 +28,17 @@ the hoops of using a nonstandard nss library in the first place.
Yours truly worked on this for about 7 months. This was also my first zig Yours truly worked on this for about 7 months. This was also my first zig
project which I never went to (nor really needed to) come back and clean up. project which I never went to (nor really needed to) come back and clean up.
Update 2022-02: I am reviving it:
- updated to stage2, so it works on nightly again.
- I learned some zig over the last year, will be cleaning it up.
Currently it has not been fuzz-tested, so it will crash on invalid data. Please
use `ReleaseSafe` until it is fuzzed.
Dependencies Dependencies
------------ ------------
1. zig v0.10. turbonss is implemented in stage1, so will not work with zig 1. zig 0.11.0-dev.1580+a5b34a61a or higher.
v0.11+.
2. [cmph][cmph]: bundled with this repository. 2. [cmph][cmph]: bundled with this repository.
Trying it out Trying it out
@ -42,25 +48,23 @@ Clone, compile and test first:
$ git clone --recursive https://git.sr.ht/~motiejus/turbonss $ git clone --recursive https://git.sr.ht/~motiejus/turbonss
$ zig build test $ zig build test
$ zig build -Dtarget=x86_64-linux-gnu.2.16 -Dcpu=baseline -Drelease-safe=true $ zig build -Dtarget=x86_64-linux-gnu.2.16 -Dcpu=baseline -Doptimize=ReleaseSafe
One may choose different options, depending on requirements. Here are some One may choose different options, depending on requirements. Here are some
hints: hints:
1. `-Dcpu=<...>` for the CPU 1. `-Dcpu=<...>` for the CPU
[microarchitecture](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels). [microarchitecture](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels).
2. `-Drelease-fast=true` for max speed 2. `-Dstrip=true` to strip debug symbols.
3. `-Drelease-small=true` for smallest binary sizes.
4. `-Dstrip=true` to strip debug symbols.
For reference, size of the shared library and helper binaries when compiled For reference, size of the shared library and helper binaries when compiled
with `-Dstrip=true -Drelease-small=true`: with `-Dstrip=true -Drelease-small=true`:
17K Nov 30 11:53 turbonss-analyze 28K zig-out/bin/turbonss-analyze
16K Nov 30 11:53 turbonss-getent 20K zig-out/bin/turbonss-getent
17K Nov 30 11:53 turbonss-makecorpus 24K zig-out/bin/turbonss-makecorpus
166K Nov 30 11:53 turbonss-unix2db 140K zig-out/bin/turbonss-unix2db
22K Nov 30 11:53 libnss_turbo.so.2.0.0 24K zig-out/lib/libnss_turbo.so.2.0.0
Many thanks to Ulrich Drepper for [teaching how to link it properly][dso]. Many thanks to Ulrich Drepper for [teaching how to link it properly][dso].
@ -158,6 +162,9 @@ by 10x (to 100k each), the difference becomes even crazier:
user 0m0.000s user 0m0.000s
sys 0m0.008s sys 0m0.008s
Note that to author's knowledge this has not been used on any real production
nor a development machine.
Documentation Documentation
------------- -------------