{"id":17205665,"url":"https://github.com/simon0191/fast_priority_queue","last_synced_at":"2025-04-13T22:10:14.846Z","repository":{"id":56846029,"uuid":"70126870","full_name":"simon0191/fast_priority_queue","owner":"simon0191","description":"A blazzingly fast implementation of priority queue using Ruby + Rust + Ruru","archived":false,"fork":false,"pushed_at":"2018-02-28T20:36:43.000Z","size":632,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T19:10:09.166Z","etag":null,"topics":["benchmark","priority-queue","ruby","ruru","rust"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simon0191.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-06T05:56:49.000Z","updated_at":"2020-12-15T11:10:18.000Z","dependencies_parsed_at":"2022-09-09T21:12:05.838Z","dependency_job_id":null,"html_url":"https://github.com/simon0191/fast_priority_queue","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon0191%2Ffast_priority_queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon0191%2Ffast_priority_queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon0191%2Ffast_priority_queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon0191%2Ffast_priority_queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simon0191","download_url":"https://codeload.github.com/simon0191/fast_priority_queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788927,"owners_count":21161727,"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":["benchmark","priority-queue","ruby","ruru","rust"],"created_at":"2024-10-15T02:26:02.319Z","updated_at":"2025-04-13T22:10:14.820Z","avatar_url":"https://github.com/simon0191.png","language":"Ruby","readme":"# FastPriorityQueue\n\n[![Build Status](https://travis-ci.org/simon0191/fast_priority_queue.svg?branch=master)](https://travis-ci.org/simon0191/fast_priority_queue)\n[![Gem Version](https://badge.fury.io/rb/fast_priority_queue.svg)](https://badge.fury.io/rb/fast_priority_queue)\n\nA blazzingly fast implementation of priority queue using [Rust](https://www.rust-lang.org/en-US/) + [Ruru](https://github.com/d-unseductable/ruru)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'fast_priority_queue'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install fast_priority_queue\n\n## Usage\n\n```\nfpq = FastPriorityQueue.new\n# or use a custom comparator function\nfpq = FastPriorityQueue.new { |a,b| a\u003c=\u003eb }\n# add elements to the queue\nfpq.add 5\nfpq.add 4\nfpq.add 3\nfpq.add 2\nfpq.add 1\n# see what's in the top of the queue\nfpq.top # =\u003e 1\n# take the top element\nfpq.pop # =\u003e 1\nfpq.pop # =\u003e 2\n# see how many elements are in the queue\nfpq.length # =\u003e 3\n```\n\n## Benchmarks\nFast Priority Queue is 130 times faster than a pure ruby implementation. Here are some benchmarks against [Algorithms](https://github.com/kanwei/algorithms/):\n\nBenchmark of add and pop with 50'000 numbers:\n\n*(the smallest the number, the better)*\n\n```\n                     user     system      total        real\n\nFast#add         0.440000   0.010000   0.450000 (  0.506917)\nFast#pop         0.590000   0.000000   0.590000 (  0.591405)\n---------------------------------------   total (  1.098322)\n\nAlgorithms#add 135.220000   8.640000 143.860000 (147.354989)\nAlgorithms#pop   0.290000   0.010000   0.300000 (  0.296598)\n---------------------------------------   total (147.651587)\n```\n\n*(the biggest the number, the better)*\n```\n                  ops/sec\nFast#add         98635.48\nFast#pop         84544.43\n-------------------------\nAlgorithms#add     339.31\nAlgorithms#pop  168578.34\n\n```\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 tags, 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/simon0191/fast_priority_queue.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon0191%2Ffast_priority_queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimon0191%2Ffast_priority_queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon0191%2Ffast_priority_queue/lists"}