update README

This commit is contained in:
Motiejus Jakštys 2022-11-30 12:04:12 +02:00
parent 312e510eff
commit 4493b4408c

View File

@ -20,20 +20,19 @@ pre-cached `nscd`, ~8 milliseconds with `turbonss`.
Project status
--------------
The project is finished and is not recommended for production; just use nscd.
Turbonss duly implements the full user/group API in `src/libnss.zig`: feel free
to copy that. turbonss is only 2-5 times faster than nscd, which usually does
not matter (including for my original use case).
The project is finished and was never used recommended for production. If you
are considering using turbonss, try nscd first. Turbonss is only 2-5 times
faster than pre-warmed nscd, which usually does not matter enough to go through
the hoops of using a nonstandard nss library in the first place.
Yours truly (the author) worked on this for about 7 months. And when this was
finished it turned out that just slapping nscd on top of the existing NSS
implementation is fast enough.
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.
Dependencies
------------
1. zig v0.10. turbonss uses stage1 (the C++ version) and is not compatible with
stage2.
1. zig v0.10. turbonss is implemented in stage1, so will not work with zig
v0.11+.
2. [cmph][cmph]: bundled with this repository.
Trying it out
@ -43,7 +42,7 @@ Clone, compile and test first:
$ git clone --recursive https://git.sr.ht/~motiejus/turbonss
$ zig build test
$ zig build -Dtarget=x86_64-linux-gnu.2.31 -Dcpu=x86_64_v3 -Drelease-safe=true
$ zig build -Dtarget=x86_64-linux-gnu.2.16 -Dcpu=baseline -Drelease-safe=true
One may choose different options, depending on requirements. Here are some
hints:
@ -54,8 +53,19 @@ hints:
3. `-Drelease-small=true` for smallest binary sizes.
4. `-Dstrip=true` to strip debug symbols.
Test it on a real system
------------------------
For reference, size of the shared library and helper binaries when compiled
with `-Dstrip=true -Drelease-small=true`:
17K Nov 30 11:53 turbonss-analyze
16K Nov 30 11:53 turbonss-getent
17K Nov 30 11:53 turbonss-makecorpus
166K Nov 30 11:53 turbonss-unix2db
22K Nov 30 11:53 libnss_turbo.so.2.0.0
Many thanks to Ulrich Drepper for [teaching how to link it properly][dso].
Test turobnss on a real system
------------------------------
`db.turbo` is the TurboNSS database file. To create one from `/etc/group` and
`/etc/passwd`, use `turbonss-unix2db`:
@ -151,9 +161,10 @@ by 10x (to 100k each), the difference becomes even crazier:
Documentation
-------------
Architecture is detailed in `docs/architecture.md`
Development notes are in `docs/development.md`
- Architecture is detailed in `docs/architecture.md`
- Development notes are in `docs/development.md`
[nsswitch]: https://linux.die.net/man/5/nsswitch.conf
[id]: https://linux.die.net/man/1/id
[cmph]: http://cmph.sourceforge.net/
[dso]: https://akkadia.org/drepper/dsohowto.pdf