aboutsummaryrefslogtreecommitdiff
path: root/std/hash/siphash.zig
AgeCommit message (Collapse)Author
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221
2019-08-27Improve siphash performance for small keys by up to 30% (#3124)Marc Tiehuis
This removes the partial buffer handling from the full slice api. `./benchmark --filter siphash --count 1024` old siphash(1,3) iterative: 3388 MiB/s [67532e53a0d210bf] small keys: 1258 MiB/s [948c91176a000000] siphash(2,4) iterative: 2061 MiB/s [f792d39bff42f819] small keys: 902 MiB/s [e1ecba6614000000] new siphash(1,3) iterative: 3410 MiB/s [67532e53a0d210bf] small keys: 1639 MiB/s [948c91176a000000] siphash(2,4) iterative: 2053 MiB/s [f792d39bff42f819] small keys: 1074 MiB/s [e1ecba6614000000]
2019-08-21Inline full slice hashingMarc Tiehuis
This gives moderate speed improvements when hashing small keys. The crc/adler/fnv inlining did not provide enough speed up to warrant the change. OLD: wyhash small keys: 2277 MiB/s [c14617a1e3800000] siphash(1,3) small keys: 937 MiB/s [b2919222ed400000] siphash(2,4) small keys: 722 MiB/s [3c3d974cc2800000] fnv1a small keys: 1580 MiB/s [70155e1cb7000000] adler32 small keys: 1898 MiB/s [00013883ef800000] crc32-slicing-by-8 small keys: 2323 MiB/s [0035bf3dcac00000] crc32-half-byte-lookup small keys: 218 MiB/s [0035bf3dcac00000] NEW: wyhash small keys: 2775 MiB/s [c14617a1e3800000] siphash(1,3) small keys: 1086 MiB/s [b2919222ed400000] siphash(2,4) small keys: 789 MiB/s [3c3d974cc2800000] fnv1a small keys: 1604 MiB/s [70155e1cb7000000] adler32 small keys: 1856 MiB/s [00013883ef800000] crc32-slicing-by-8 small keys: 2336 MiB/s [0035bf3dcac00000] crc32-half-byte-lookup small keys: 218 MiB/s [0035bf3dcac00000]
2019-06-09different array literal syntax when inferring the sizeAndrew Kelley
old syntax: []i32{1, 2, 3} new syntax: [_]i32{1, 2, 3} closes #1797
2019-03-02rename std lib files to new conventionAndrew Kelley
2019-02-08std.debug.assert: remove special case for test buildsAndrew Kelley
Previously, std.debug.assert would `@panic` in test builds, if the assertion failed. Now, it's always `unreachable`. This makes release mode test builds more accurately test the actual code that will be run. However this requires tests to call `std.testing.expect` rather than `std.debug.assert` to make sure output is correct. Here is the explanation of when to use either one, copied from the assert doc comments: Inside a test block, it is best to use the `std.testing` module rather than assert, because assert may not detect a test failure in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert is the correct function to use. closes #1304
2018-12-12breaking API changes to all readInt/writeInt functions & moreAndrew Kelley
* add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-06-17remove integer and float casting syntaxAndrew Kelley
* add `@intCast` * add `@floatCast` * add `@floatToInt` * add `@intToFloat` See #1061
2018-05-31use * for pointer type instead of &Andrew Kelley
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
2018-05-30run zig fmt on the codebaseAndrew Kelley
2018-05-29run zig fmt on the codebaseAndrew Kelley
See #1003
2018-04-06Add common hash/checksum functionsMarc Tiehuis
- SipHash64, SipHash128 - Crc32 (fast + small variants) - Adler32 - Fnv1a (32, 64 and 128 bit variants)