Skip to content

Conversation

twoeths
Copy link
Collaborator

@twoeths twoeths commented May 9, 2025

Motivation

Description

  • add home "bun" folder
  • compile zig in bun "package.json" by: "bun run build"
  • TBD

TODOs

Copy link

github-actions bot commented May 12, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 993e407 Previous: null Ratio
JS - unshuffleList - 16384 indices 922.25 us/op
Zig - unshuffleList - 16384 indices 608.12 us/op
JS - unshuffleList - 250000 indices 13.312 ms/op
Zig - unshuffleList - 250000 indices 8.9923 ms/op
JS - unshuffleList - 1000000 indices 52.861 ms/op
Zig - unshuffleList - 1000000 indices 35.853 ms/op
get values - 1000 335.00 ns/op
get values - naive - 1000 499.00 ns/op
set values - 1000 299.00 ns/op
set values - naive - 1000 613.00 ns/op
get values - 1000000 926.00 ns/op
get values - naive - 1000000 1.6170 us/op
set values - 1000000 930.00 ns/op
set values - naive - 1000000 2.1100 us/op
JS - computeSyncCommitteeIndices - 16384 indices 296.19 ms/op
Zig - computeSyncCommitteeIndices - 16384 indices 4.0516 ms/op
JS - computeSyncCommitteeIndices - 250000 indices 286.99 ms/op
Zig - computeSyncCommitteeIndices - 250000 indices 16.819 ms/op
JS - computeSyncCommitteeIndices - 1000000 indices 303.88 ms/op
Zig - computeSyncCommitteeIndices - 1000000 indices 31.108 ms/op

by benchmarkbot/action

};

// Load the compiled Zig shared library
const lib = await openLibrary(path.resolve("../bun"), fns);
Copy link
Member

@wemeetagain wemeetagain May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the path.resolve("../bun") is strange here. I don't think it will work when the cwd is another consumer of this package.

maybe better is path.join(import.meta.dirname, '..')

(I'm assuming the dylib would be located at something like bun/libstate-transition-utils.dylib)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified it to const lib = await openLibrary(path.resolve("."), fns); please have a look at the latest change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twoeths check this comment. Try something with import.meta.dirname here instead of path.resolve/cwd

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, just switched to "import.meta.dirname"

@twoeths twoeths force-pushed the te/consume_bun-ffi-z branch from 3c6482f to 6c060fc Compare May 16, 2025 04:09
@twoeths twoeths force-pushed the te/consume_bun-ffi-z branch from 2bc92dd to f28257c Compare May 17, 2025 05:36
@twoeths twoeths force-pushed the te/consume_bun-ffi-z branch from 714a29b to d848013 Compare May 17, 2025 08:14
@twoeths
Copy link
Collaborator Author

twoeths commented May 18, 2025

the publish step was tested successfully with -dry-run flag, this is the generated targetPackages
targetPackages.zip

@twoeths twoeths marked this pull request as ready for review May 18, 2025 08:07
@twoeths twoeths requested a review from wemeetagain May 18, 2025 08:08
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@twoeths twoeths merged commit 284c90e into main May 19, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants