Skip to content

Commit c37ac49

Browse files
perf: change optimize level ReleaseSmall -> ReleaseFast for zig's programs (#2)
change optimize ReleaseSmall -> ReleaseFast
1 parent 19b3947 commit c37ac49

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,11 @@ lets the VM assume it worked.
162162
| Language | CU Usage |
163163
| --- | --- |
164164
| Rust | 464 |
165-
| Zig | 469 |
165+
| Zig | 186 |
166166
| C | 103 |
167167
| Assembly | 23 |
168168

169169
This one starts to get interesting since it requires parsing the instruction
170170
input. Since the assembly version knows exactly where to find everything, it can
171171
be hyper-optimized. The C version is also very performant.
172+
Zig's version should perform the same as C, but there are some inefficiencies that are currently fixing.

helloworld/zig/build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const base58 = @import("base58");
44

55
pub fn build(b: *std.Build) !void {
66
const target = b.resolveTargetQuery(solana.sbf_target);
7-
const optimize = .ReleaseSmall;
7+
const optimize = .ReleaseFast;
88
const program = b.addSharedLibrary(.{
99
.name = "solana_program_rosetta_helloworld",
1010
.root_source_file = b.path("main.zig"),

transfer-lamports/zig/build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const base58 = @import("base58");
44

55
pub fn build(b: *std.Build) !void {
66
const target = b.resolveTargetQuery(solana.sbf_target);
7-
const optimize = .ReleaseSmall;
7+
const optimize = .ReleaseFast;
88
const program = b.addSharedLibrary(.{
99
.name = "solana_program_rosetta_transfer_lamports",
1010
.root_source_file = b.path("main.zig"),

0 commit comments

Comments
 (0)