{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-protobuf/protobuf/issues/308","repository_url":"https://api.github.com/repos/ruby-protobuf/protobuf","labels_url":"https://api.github.com/repos/ruby-protobuf/protobuf/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/ruby-protobuf/protobuf/issues/308/comments","events_url":"https://api.github.com/repos/ruby-protobuf/protobuf/issues/308/events","html_url":"https://github.com/ruby-protobuf/protobuf/pull/308","id":137068520,"number":308,"title":"Small optimizations","user":{"login":"film42","id":1043908,"avatar_url":"https://avatars.githubusercontent.com/u/1043908?v=3","gravatar_id":"","url":"https://api.github.com/users/film42","html_url":"https://github.com/film42","followers_url":"https://api.github.com/users/film42/followers","following_url":"https://api.github.com/users/film42/following{/other_user}","gists_url":"https://api.github.com/users/film42/gists{/gist_id}","starred_url":"https://api.github.com/users/film42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/film42/subscriptions","organizations_url":"https://api.github.com/users/film42/orgs","repos_url":"https://api.github.com/users/film42/repos","events_url":"https://api.github.com/users/film42/events{/privacy}","received_events_url":"https://api.github.com/users/film42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-28T16:21:19Z","updated_at":"2016-02-29T04:13:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ruby-protobuf/protobuf/pulls/308","html_url":"https://github.com/ruby-protobuf/protobuf/pull/308","diff_url":"https://github.com/ruby-protobuf/protobuf/pull/308.diff","patch_url":"https://github.com/ruby-protobuf/protobuf/pull/308.patch"},"body":"This just adds a few speedups.\r\n\r\n1. `class_eval` string - This turned out to be about 40% faster for setters and 48% faster for getters (for both MRI and Jruby). Here's my benchmark: https://gist.github.com/film42/8efd4810d3c5a5e12291.\r\n2. Varint - This takes the optimized varint out of https://github.com/ruby-protobuf/protobuf/pull/297.\r\n3. `nonzero?` vs `!= 0` - Declarative methods are nice, but simple operators are still very readable and more performant, especially in these hot code paths.\r\n\r\nNote: I also added `benchmark-ips` as a dev dependency because I end up using it a lot when working with protobuf.\r\n\r\ncc @abrandoned @zachmargolis @embark "},"comment":{"url":"https://api.github.com/repos/ruby-protobuf/protobuf/issues/comments/190030771","html_url":"https://github.com/ruby-protobuf/protobuf/pull/308#issuecomment-190030771","issue_url":"https://api.github.com/repos/ruby-protobuf/protobuf/issues/308","id":190030771,"user":{"login":"zachmargolis","id":458784,"avatar_url":"https://avatars.githubusercontent.com/u/458784?v=3","gravatar_id":"","url":"https://api.github.com/users/zachmargolis","html_url":"https://github.com/zachmargolis","followers_url":"https://api.github.com/users/zachmargolis/followers","following_url":"https://api.github.com/users/zachmargolis/following{/other_user}","gists_url":"https://api.github.com/users/zachmargolis/gists{/gist_id}","starred_url":"https://api.github.com/users/zachmargolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachmargolis/subscriptions","organizations_url":"https://api.github.com/users/zachmargolis/orgs","repos_url":"https://api.github.com/users/zachmargolis/repos","events_url":"https://api.github.com/users/zachmargolis/events{/privacy}","received_events_url":"https://api.github.com/users/zachmargolis/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T04:13:57Z","updated_at":"2016-02-29T04:13:57Z","body":"Seems legit, LGTM :+1: "}}