{"action":"created","issue":{"url":"https://api.github.com/repos/node-modules/node-murmurhash/issues/11","labels_url":"https://api.github.com/repos/node-modules/node-murmurhash/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/node-modules/node-murmurhash/issues/11/comments","events_url":"https://api.github.com/repos/node-modules/node-murmurhash/issues/11/events","html_url":"https://github.com/node-modules/node-murmurhash/pull/11","id":116926230,"number":11,"title":"use Math.imul","user":{"login":"alsotang","id":1147375,"avatar_url":"https://avatars.githubusercontent.com/u/1147375?v=3","gravatar_id":"","url":"https://api.github.com/users/alsotang","html_url":"https://github.com/alsotang","followers_url":"https://api.github.com/users/alsotang/followers","following_url":"https://api.github.com/users/alsotang/following{/other_user}","gists_url":"https://api.github.com/users/alsotang/gists{/gist_id}","starred_url":"https://api.github.com/users/alsotang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alsotang/subscriptions","organizations_url":"https://api.github.com/users/alsotang/orgs","repos_url":"https://api.github.com/users/alsotang/repos","events_url":"https://api.github.com/users/alsotang/events{/privacy}","received_events_url":"https://api.github.com/users/alsotang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-14T14:01:21Z","updated_at":"2015-11-14T16:50:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/node-modules/node-murmurhash/pulls/11","html_url":"https://github.com/node-modules/node-murmurhash/pull/11","diff_url":"https://github.com/node-modules/node-murmurhash/pull/11.diff","patch_url":"https://github.com/node-modules/node-murmurhash/pull/11.patch"},"body":"Math.imul is new class method of es6.\r\n\r\n```\r\nmurmurhash should be 335538535: 335538535\r\nmurmurhash utf8 should be 3300337389: 3300337389\r\nmurmurhash with custom key should be 4040304760: 4040304760\r\nmurmurhash('hello 中国') should be 1248731102: 1248731102\r\n\r\n  node version: v4.2.1, date: Sat Nov 14 2015 21:59:18 GMT+0800 (CST)\r\nuse Math.imul\r\n  Starting...\r\n  2 tests completed.\r\n\r\n  murmurhash(new Buffer(ascii)) x 20,148,408 ops/sec ±0.74% (97 runs sampled)\r\n  murmurhash(new Buffer(utf8))  x 12,077,352 ops/sec ±0.86% (100 runs sampled)\r\n```\r\n\r\nalmost 2.5x faster.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/node-modules/node-murmurhash/issues/comments/156718912","html_url":"https://github.com/node-modules/node-murmurhash/pull/11#issuecomment-156718912","issue_url":"https://api.github.com/repos/node-modules/node-murmurhash/issues/11","id":156718912,"user":{"login":"alsotang","id":1147375,"avatar_url":"https://avatars.githubusercontent.com/u/1147375?v=3","gravatar_id":"","url":"https://api.github.com/users/alsotang","html_url":"https://github.com/alsotang","followers_url":"https://api.github.com/users/alsotang/followers","following_url":"https://api.github.com/users/alsotang/following{/other_user}","gists_url":"https://api.github.com/users/alsotang/gists{/gist_id}","starred_url":"https://api.github.com/users/alsotang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alsotang/subscriptions","organizations_url":"https://api.github.com/users/alsotang/orgs","repos_url":"https://api.github.com/users/alsotang/repos","events_url":"https://api.github.com/users/alsotang/events{/privacy}","received_events_url":"https://api.github.com/users/alsotang/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T16:50:48Z","updated_at":"2015-11-14T16:50:48Z","body":"用 Buffer 的思路不是很对。\r\n\r\n```js\r\ncase 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\r\n\t\tcase 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\r\n\t\tcase 1: k1 ^= (key.charCodeAt(i) & 0xff);\r\n```\r\n\r\n看到一句这样的，其实也蛮好。不一定比我们现在的查表慢。我试试。"}}