-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.optimizationregressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Milestone
Description
Zig Version
0.10.0
Steps to Reproduce and Observed Behavior
The speed of Bcrypt with equal/similar parameters as Zig 0.9.x has regressed by about a factor 10 in 0.10.0. This severely reduces the usability of the implementation as we have this now.
Code as tested:
const std2 = @import("std");
const bcrypt = std2.crypto.pwhash.bcrypt;
const time = std2.time;
const begin = time.milliTimestamp();
var params: bcrypt.Params = .{ .rounds_log = 10 };
var hash_options: bcrypt.HashOptions = .{ .allocator = std2.heap.page_allocator, .params = params, .encoding = std2.crypto.pwhash.Encoding.crypt };
var buffer: [bcrypt.hash_length]u8 = undefined;
_ = try bcrypt.strHash("password", hash_options, buffer[0..]);
const end = time.milliTimestamp();
const diff = end - begin;
std2.debug.print("{d}\n", .{diff});This code on my machine has around the following results:
Zig 0.9: 392ms
Zig 0.10: 5128ms
Expected Behavior
The speed of the algorithm should be similar the speed in Zig 0.9.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.optimizationregressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.