-
-
Notifications
You must be signed in to change notification settings - Fork 41
📦 perf: remove explicit inline keywords to reduce bundle size #1797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace all instances of std.debug.assert with explicit if (\!condition) unreachable; pattern across EVM opcode modules for more explicit error handling. Changed files: - src/evm/opcodes/arithmetic.zig - src/evm/opcodes/bitwise.zig - src/evm/opcodes/comparison.zig - src/evm/opcodes/control.zig - src/evm/opcodes/memory.zig - src/evm/opcodes/stack.zig - src/evm/opcodes/storage.zig Original prompt: "Grep src/**/*.zig for any use of std.debug.assert. Instead use if (\!thing) unreachable; which is the same thing. Make a commit. Include this prompt in the commit message. Use emoji conventional commit. You are not allowed to commit unless \`zig build test-all\` passes" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove inline keywords from performance-optimized functions to let the compiler decide on inlining, balancing performance with bundle size for fast/small EVM builds. Changed files: - src/evm/constants.zig: removed inline from opcode utility functions - src/evm/contract.zig: removed inline from gas management functions - src/evm/jump_table.zig: removed inline from get_operation - src/evm/opcodes/memory.zig: removed inline from bounds checking - src/evm/stack.zig: removed inline from all stack operations Preserved inline for: - Compile-time constructs (inline for loops) - Logging functions that need optimization in release builds - Functions with explicit non-performance reasons for inlining Original prompt: "Inlining is a good idea for performance, but it hurts bundle size. We are going to release fast and small versions of the evm so rather than explicitly writing inline on any src/**/*.zig we want to let compiler decide whether to inline. If the method most be inline for another reason don't change it but for most uses of inline please replace it. After replacing it please make an emoji conventional commit and include this prompt in the commit message" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
Removed
inline
attribute from utility functions in the EVM implementation to better allow compiler reduce binary size. This change affects functions in several modules including constants, contract, jump_table, memory opcodes, and stack operations. In Fast mode compiler will usually be smart enough toinline and the official docs warn against inlining for perf reasonsTesting
The code has been tested to ensure that removing the
inline
attribute doesn't affect functionality. Performance-critical paths have been verified to maintain their efficiency, as the compiler will still automatically inline functions where beneficial.Additional Information
Your ENS/address: