{"action":"created","issue":{"url":"https://api.github.com/repos/whitequark/parser/issues/248","labels_url":"https://api.github.com/repos/whitequark/parser/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/whitequark/parser/issues/248/comments","events_url":"https://api.github.com/repos/whitequark/parser/issues/248/events","html_url":"https://github.com/whitequark/parser/pull/248","id":127305332,"number":248,"title":"It's time to sizzle","user":{"login":"alexdowad","id":1067359,"avatar_url":"https://avatars.githubusercontent.com/u/1067359?v=3","gravatar_id":"","url":"https://api.github.com/users/alexdowad","html_url":"https://github.com/alexdowad","followers_url":"https://api.github.com/users/alexdowad/followers","following_url":"https://api.github.com/users/alexdowad/following{/other_user}","gists_url":"https://api.github.com/users/alexdowad/gists{/gist_id}","starred_url":"https://api.github.com/users/alexdowad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexdowad/subscriptions","organizations_url":"https://api.github.com/users/alexdowad/orgs","repos_url":"https://api.github.com/users/alexdowad/repos","events_url":"https://api.github.com/users/alexdowad/events{/privacy}","received_events_url":"https://api.github.com/users/alexdowad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":72,"created_at":"2016-01-18T20:28:58Z","updated_at":"2016-01-20T13:39:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/whitequark/parser/pulls/248","html_url":"https://github.com/whitequark/parser/pull/248","diff_url":"https://github.com/whitequark/parser/pull/248.diff","patch_url":"https://github.com/whitequark/parser/pull/248.patch"},"body":"The object of this (not yet complete) PR is to turn `parser` from this:\r\n\r\n![tricycle-small](https://cloud.githubusercontent.com/assets/1067359/12401580/0ac720d8-be30-11e5-83fc-c906e5ca9ddd.jpg)\r\n\r\n...into this:\r\n\r\n![nissan_skyline](https://cloud.githubusercontent.com/assets/1067359/12401504/76edadc8-be2f-11e5-858e-1c73fef6cfa2.png)\r\n\r\nI have ported `parser`'s lexer, which is far hungrier for CPU cycles than any other part, to C. Specifically, it's a Ragel file which compiles to a Ruby C extension.\r\n\r\nNo profiling and tuning whatsoever has been done on the extension yet. (I just got all the tests passing about 10 minutes ago.) But already, it lexes `lib/parser/lexer.rb` almost 8 times faster than the existing pure-Ruby lexer. Hopefully, it can be made to go significantly faster than that again. (10 would be a nice number... OK, no question about it, it will have to be made at least 10 times faster.)\r\n\r\nBesides getting the extension all tuned up and ready to race, I need to clean up the code formatting, work on coding style and readability, do more thorough testing and verification to ensure correctness, and so on. If any interested parties are willing to help with some of this work, please pitch in.\r\n\r\nOne important thing which I have **not** worked out is how to build platform-specific gems, so that gem users will get the C extension on MRI, but pure Ruby on JRuby/RBX/etc. An alternative would be to release it as a different gem.\r\n\r\nAll feedback is appreciated."},"comment":{"url":"https://api.github.com/repos/whitequark/parser/issues/comments/173207176","html_url":"https://github.com/whitequark/parser/pull/248#issuecomment-173207176","issue_url":"https://api.github.com/repos/whitequark/parser/issues/248","id":173207176,"user":{"login":"chrisseaton","id":341094,"avatar_url":"https://avatars.githubusercontent.com/u/341094?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisseaton","html_url":"https://github.com/chrisseaton","followers_url":"https://api.github.com/users/chrisseaton/followers","following_url":"https://api.github.com/users/chrisseaton/following{/other_user}","gists_url":"https://api.github.com/users/chrisseaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisseaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisseaton/subscriptions","organizations_url":"https://api.github.com/users/chrisseaton/orgs","repos_url":"https://api.github.com/users/chrisseaton/repos","events_url":"https://api.github.com/users/chrisseaton/events{/privacy}","received_events_url":"https://api.github.com/users/chrisseaton/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T13:39:59Z","updated_at":"2016-01-20T13:39:59Z","body":"@whitequark ah sorry I skimmed the issue too lightly.\r\n\r\nWe may be able to do a little better than JRuby due to the OSR that @headius already mentioned, but yeah there's a limit to how big a method anyone can JIT."}}