Skip to content

Conversation

@schultyy
Copy link
Owner

This PR introduces a custom bytecode implementation for the Muster VM, improving performance and memory usage.

Key Changes

  • Implements a custom bytecode format for all VM instructions
  • Adds instruction serialization/deserialization
  • Pre-computes jump positions for labels
  • Optimizes VM execution by removing unnecessary cloning
  • Introduces integer formatting support for printf (%d)
  • Adds comprehensive test coverage for bytecode operations

Technical Details

  • Each instruction is serialized into a compact byte format
  • Label positions are pre-computed and stored in a jump map
  • VM execution now operates directly on bytes instead of instruction enums
  • Added configuration options for print and remote call queue sizes

Performance Improvements

  • Reduced memory usage by removing instruction cloning
  • Faster jump operations using pre-computed positions
  • More efficient string handling in VM operations

Breaking Changes

  • None. All changes are internal to the VM implementation

Test Coverage

Added extensive test cases for all bytecode operations including:

  • Push operations (string and int)
  • Jump operations
  • Printf with integers
  • Variable operations
  • Stack operations
  • Sleep and I/O operations

@schultyy schultyy merged commit 23f0fbb into main Apr 12, 2025
4 checks passed
@schultyy schultyy deleted the custom-bytecode branch April 12, 2025 02:30
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.

1 participant