1
Fork 0

bump to zig 0.11.0-dev.2560+602029bb2

This commit is contained in:
Motiejus Jakštys 2023-04-12 22:24:20 +03:00
parent f55fb9f86a
commit abeb25f3e2
2 changed files with 22 additions and 21 deletions

View File

@ -10,35 +10,36 @@ Turbonss is optimized for reading. If the data changes in any way, the whole
file will need to be regenerated. Therefore, it was created, and best suited,
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
often (e.g. hourly).
often.
This is the fastest known NSS passwd/group implementation for *reads*. On my
2018-era laptop a corpus with 10k users, 10k groups and 500 average members per
group, `id` takes 17 seconds with the glibc default implementation, 10-17
milliseconds with a pre-cached `nscd`, ~8 milliseconds with `turbonss`.
milliseconds with a pre-cached `nscd`, ~8 milliseconds with uncached
`turbonss`.
Due to the nature of being built with Zig, this will work on glibc versions as
old as 2.16 (may work with even older ones, I did not test beyond that).
Project status
--------------
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.
This project works, but has never seen real production use. If you want to use
turbonss instead of a battle-tested, albeit slower nscd, keep the following in
mind:
- turbonss has not been fuzzed, so it will crash a program on invalid database
file.
- requires a nightly version of zig (that will change with 0.11).
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.
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.
If you insist on using turbonss in prod, compile with `ReleaseSafe`. It is
plenty as fast with this mode, but an invalid database will lead to defined
behavior (i.e. crash with a stack trace) instead of overwriting memory
wherever.
Dependencies
------------
1. zig 0.11.0-dev.1782+b52be973d or higher.
1. zig around 0.11.0-dev.2560+602029bb2.
2. [cmph][cmph]: bundled with this repository.
Trying it out

View File

@ -83,7 +83,7 @@ pub fn build(b: *zbs.Builder) void {
exe.strip = strip;
exe.want_lto = true;
addCmphDeps(exe, cmph);
exe.install();
b.installArtifact(exe);
}
{
@ -96,7 +96,7 @@ pub fn build(b: *zbs.Builder) void {
exe.compress_debug_sections = .zlib;
exe.strip = strip;
exe.want_lto = true;
exe.install();
b.installArtifact(exe);
}
{
@ -109,7 +109,7 @@ pub fn build(b: *zbs.Builder) void {
exe.compress_debug_sections = .zlib;
exe.strip = strip;
exe.want_lto = true;
exe.install();
b.installArtifact(exe);
}
{
@ -125,7 +125,7 @@ pub fn build(b: *zbs.Builder) void {
exe.linkLibC();
exe.linkLibrary(bdz);
exe.addIncludePath("deps/cmph/src");
exe.install();
b.installArtifact(exe);
}
{
@ -146,7 +146,7 @@ pub fn build(b: *zbs.Builder) void {
so.linkLibC();
so.linkLibrary(bdz);
so.addIncludePath("deps/cmph/src");
so.install();
b.installArtifact(so);
}
{