Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion helloworld/zig/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion transfer-lamports/zig/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down