{"id":18751205,"url":"https://github.com/sebyx07/native_ruby","last_synced_at":"2025-07-02T06:38:05.176Z","repository":{"id":252469218,"uuid":"840537125","full_name":"sebyx07/native_ruby","owner":"sebyx07","description":"(YJIT) Ruby Standard Lib implemented in pure ruby","archived":false,"fork":false,"pushed_at":"2024-08-27T18:50:16.000Z","size":37,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T00:08:18.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebyx07.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T00:20:06.000Z","updated_at":"2025-02-04T21:44:18.000Z","dependencies_parsed_at":"2024-08-22T22:59:45.076Z","dependency_job_id":null,"html_url":"https://github.com/sebyx07/native_ruby","commit_stats":null,"previous_names":["sebyx07/native_ruby"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebyx07%2Fnative_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebyx07%2Fnative_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebyx07%2Fnative_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebyx07%2Fnative_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebyx07","download_url":"https://codeload.github.com/sebyx07/native_ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647299,"owners_count":21139086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T17:14:55.190Z","updated_at":"2025-04-13T00:08:24.207Z","avatar_url":"https://github.com/sebyx07.png","language":"Ruby","readme":"# NativeRuby 🚀\n\nNativeRuby is a standard library for Ruby implemented in Ruby, designed to take advantage of the YJIT compiler for improved performance. It provides optimized, native Ruby implementations of various core methods and iterators while maintaining the familiar Ruby API. 🔥\n\n## Important Note on Performance ⚠️\n\n**The performance improvements provided by NativeRuby are primarily seen when YJIT is enabled.** Without YJIT, you may not notice significant performance gains. For the best results, always use NativeRuby with YJIT enabled.\n\n## Requirements 📋\n\n- Ruby version: \u003e= 3.0.0\n- YJIT enabled for optimal performance\n\n## Installation 💎\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'native_ruby'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install native_ruby\n\n## Usage 🛠️\n\nTo use NativeRuby in your project, you first need to require it:\n\n```ruby\nrequire 'native_ruby'\n```\n\nThen, you can configure which optimized methods you want to use:\n\n```ruby\nNativeRuby.config do |c|\n  # Load all immutable iterators\n  c.load_all_immutable_iterators!\n\n  # Load all mutable iterators\n  c.load_all_mutable_iterators!\n\n  # Load all optimized methods for a specific class\n  c.require_all_for_class!(Array)\n\n  # Load a specific method for a class\n  c.load(:class, { class: Array, method: :bsearch })\n\n  # Load a specific iterator (mutable or immutable)\n  c.load(:iterators, { class: Array, method: :each, mutable: false })\nend\n```\n\n### Configuration Options ⚙️\n\n- `load_all_immutable_iterators!`: Loads all immutable iterator optimizations.\n- `load_all_mutable_iterators!`: Loads all mutable iterator optimizations.\n- `require_all_for_class!(klass)`: Loads all optimized methods for a given class.\n- `load(type, options)`: Loads a specific optimized method or iterator.\n    - For class methods: `type: :class, class: ClassName, method: :method_name`\n    - For iterators: `type: :iterators, class: ClassName, method: :method_name, mutable: boolean`\n\n## YJIT and Performance 🚀\n\nNativeRuby is specifically designed to work with YJIT (Yet Another Just-In-Time Compiler for Ruby). The performance improvements are primarily realized when YJIT is enabled.\n\nTo use NativeRuby with YJIT and see the performance benefits:\n\n1. Ensure you're using Ruby 3.1 or later.\n2. Enable YJIT when running your Ruby script:\n\n```\nruby --yjit your_script.rb\n```\n\nWithout YJIT enabled, you may not see significant performance improvements. Always use NativeRuby with YJIT for optimal results.\n\n## Development 🔧\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing 🤝\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sebyx07/native_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sebyx07/native_ruby/blob/master/CODE_OF_CONDUCT.md).\n\n## License 📄\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct 🤓\n\nEveryone interacting in the NativeRuby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sebyx07/native_ruby/blob/master/CODE_OF_CONDUCT.md).\n\n## Author 👨‍💻\n\n- **sebi** - [GitHub](https://github.com/sebyx07)\n\n## Links 🔗\n\n- [Homepage](https://github.com/sebyx07/native_ruby)\n- [Source Code](https://github.com/sebyx07/native_ruby)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebyx07%2Fnative_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebyx07%2Fnative_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebyx07%2Fnative_ruby/lists"}