diff --git a/README.md b/README.md index b074a61..2e63013 100644 --- a/README.md +++ b/README.md @@ -162,10 +162,11 @@ lets the VM assume it worked. | Language | CU Usage | | --- | --- | | Rust | 464 | -| Zig | 469 | +| Zig | 186 | | C | 103 | | Assembly | 23 | This one starts to get interesting since it requires parsing the instruction input. Since the assembly version knows exactly where to find everything, it can be hyper-optimized. The C version is also very performant. +Zig's version should perform the same as C, but there are some inefficiencies that are currently fixing. diff --git a/helloworld/zig/build.zig b/helloworld/zig/build.zig index 643b417..86514be 100644 --- a/helloworld/zig/build.zig +++ b/helloworld/zig/build.zig @@ -4,7 +4,7 @@ const base58 = @import("base58"); pub fn build(b: *std.Build) !void { const target = b.resolveTargetQuery(solana.sbf_target); - const optimize = .ReleaseSmall; + const optimize = .ReleaseFast; const program = b.addSharedLibrary(.{ .name = "solana_program_rosetta_helloworld", .root_source_file = b.path("main.zig"), diff --git a/transfer-lamports/zig/build.zig b/transfer-lamports/zig/build.zig index 383088c..d0f1535 100644 --- a/transfer-lamports/zig/build.zig +++ b/transfer-lamports/zig/build.zig @@ -4,7 +4,7 @@ const base58 = @import("base58"); pub fn build(b: *std.Build) !void { const target = b.resolveTargetQuery(solana.sbf_target); - const optimize = .ReleaseSmall; + const optimize = .ReleaseFast; const program = b.addSharedLibrary(.{ .name = "solana_program_rosetta_transfer_lamports", .root_source_file = b.path("main.zig"),