{"action":"created","issue":{"url":"https://api.github.com/repos/chaijs/type-detect/issues/79","repository_url":"https://api.github.com/repos/chaijs/type-detect","labels_url":"https://api.github.com/repos/chaijs/type-detect/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/chaijs/type-detect/issues/79/comments","events_url":"https://api.github.com/repos/chaijs/type-detect/issues/79/events","html_url":"https://github.com/chaijs/type-detect/pull/79","id":181828739,"number":79,"title":"perf: do not lowercase returned values","user":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-08T14:24:34Z","updated_at":"2016-10-08T22:00:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chaijs/type-detect/pulls/79","html_url":"https://github.com/chaijs/type-detect/pull/79","diff_url":"https://github.com/chaijs/type-detect/pull/79.diff","patch_url":"https://github.com/chaijs/type-detect/pull/79.patch"},"body":"We're sacrificing a lot of performance just to lowercase the string values, which is not ideal as it's not always necessary. Here are some numbers demonstrating the difference in performance:\r\n\r\nWith `.toLowerCase()`:\r\n```\r\nstring literal     x 31,742,089 ops/sec ±6.85% (70 runs sampled)\r\narray literal      x 12,508,545 ops/sec ±3.86% (67 runs sampled)\r\nboolean literal    x 33,502,011 ops/sec ±3.58% (66 runs sampled)\r\nobject literal     x 1,178,855 ops/sec ±2.06% (79 runs sampled)\r\nobject from null   x 3,356,249 ops/sec ±2.03% (81 runs sampled)\r\nregex literal      x 2,738,477 ops/sec ±1.95% (80 runs sampled)\r\nnumber literal     x 30,119,855 ops/sec ±2.04% (78 runs sampled)\r\npromise            x 7,260,140 ops/sec ±1.79% (81 runs sampled)\r\nnull               x 34,793,675 ops/sec ±1.58% (84 runs sampled)\r\nundefined          x 31,537,228 ops/sec ±1.77% (81 runs sampled)\r\nfunction           x 35,571,426 ops/sec ±1.69% (82 runs sampled)\r\nbuffer             x 5,468,033 ops/sec ±2.19% (83 runs sampled)\r\ndate               x 4,402,505 ops/sec ±1.47% (83 runs sampled)\r\nerror              x 932,833 ops/sec ±2.16% (80 runs sampled)\r\nmap                x 7,298,659 ops/sec ±1.64% (81 runs sampled)\r\nregex constructor  x 3,042,918 ops/sec ±2.28% (80 runs sampled)\r\nset                x 6,075,985 ops/sec ±1.91% (82 runs sampled)\r\nstring constructor x 1,077,682 ops/sec ±2.32% (82 runs sampled)\r\nweakmap            x 5,949,120 ops/sec ±1.99% (83 runs sampled)\r\nweakset            x 5,574,794 ops/sec ±1.89% (78 runs sampled)\r\narguments          x 1,065,249 ops/sec ±1.37% (83 runs sampled)\r\narrow function     x 28,776,605 ops/sec ±1.61% (81 runs sampled)\r\ngenerator function x 34,581,601 ops/sec ±2.11% (79 runs sampled)\r\nFloat64Array       x 5,306,129 ops/sec ±1.64% (83 runs sampled)\r\nFloat32Array       x 5,635,134 ops/sec ±1.37% (84 runs sampled)\r\nUint32Array        x 5,584,889 ops/sec ±1.72% (83 runs sampled)\r\nUint16Array        x 5,024,561 ops/sec ±1.40% (85 runs sampled)\r\nUint8Array         x 5,032,024 ops/sec ±1.93% (81 runs sampled)\r\nInt32Array         x 6,261,825 ops/sec ±2.21% (78 runs sampled)\r\nInt16Array         x 6,380,182 ops/sec ±1.68% (81 runs sampled)\r\nInt8Array          x 6,156,981 ops/sec ±2.27% (78 runs sampled)\r\nUint8ClampedArray  x 5,911,482 ops/sec ±1.85% (80 runs sampled)\r\nDataView           x 7,308,534 ops/sec ±1.83% (78 runs sampled)\r\n```\r\n\r\nWithout `.toLowerCase()`:\r\n```\r\nstring literal     x 47,522,814 ops/sec ±1.93% (80 runs sampled)\r\narray literal      x 18,729,054 ops/sec ±1.88% (81 runs sampled)\r\nboolean literal    x 33,037,749 ops/sec ±2.17% (83 runs sampled)\r\nobject literal     x 1,536,749 ops/sec ±2.99% (80 runs sampled)\r\nobject from null   x 3,148,007 ops/sec ±2.39% (83 runs sampled)\r\nregex literal      x 3,373,384 ops/sec ±1.82% (82 runs sampled)\r\nnumber literal     x 33,096,650 ops/sec ±1.43% (85 runs sampled)\r\npromise            x 13,416,347 ops/sec ±1.62% (80 runs sampled)\r\nnull               x 32,376,000 ops/sec ±1.70% (82 runs sampled)\r\nundefined          x 30,734,992 ops/sec ±1.60% (82 runs sampled)\r\nfunction           x 35,044,726 ops/sec ±1.87% (81 runs sampled)\r\nbuffer             x 10,831,858 ops/sec ±1.93% (82 runs sampled)\r\ndate               x 4,511,245 ops/sec ±1.99% (81 runs sampled)\r\nerror              x 836,481 ops/sec ±2.31% (79 runs sampled)\r\nmap                x 14,289,403 ops/sec ±1.72% (83 runs sampled)\r\nregex constructor  x 3,764,635 ops/sec ±2.69% (78 runs sampled)\r\nset                x 12,494,254 ops/sec ±1.95% (82 runs sampled)\r\nstring constructor x 1,282,794 ops/sec ±1.92% (80 runs sampled)\r\nweakmap            x 15,418,935 ops/sec ±1.84% (79 runs sampled)\r\nweakset            x 14,768,545 ops/sec ±1.60% (82 runs sampled)\r\narguments          x 993,064 ops/sec ±1.88% (81 runs sampled)\r\narrow function     x 30,511,620 ops/sec ±2.07% (79 runs sampled)\r\ngenerator function x 35,487,241 ops/sec ±1.53% (81 runs sampled)\r\nFloat64Array       x 9,666,668 ops/sec ±1.75% (79 runs sampled)\r\nFloat32Array       x 9,286,265 ops/sec ±1.66% (81 runs sampled)\r\nUint32Array        x 9,352,490 ops/sec ±1.37% (82 runs sampled)\r\nUint16Array        x 8,404,961 ops/sec ±2.03% (80 runs sampled)\r\nUint8Array         x 8,635,152 ops/sec ±1.81% (80 runs sampled)\r\nInt32Array         x 10,569,543 ops/sec ±1.67% (82 runs sampled)\r\nInt16Array         x 9,444,358 ops/sec ±1.53% (80 runs sampled)\r\nInt8Array          x 7,235,174 ops/sec ±2.43% (76 runs sampled)\r\nUint8ClampedArray  x 8,055,645 ops/sec ±1.67% (82 runs sampled)\r\nDataView           x 15,014,475 ops/sec ±2.08% (79 runs sampled)\r\n```\r\n\r\nBREAKING CHANGE:\r\n\r\nAll strings will no longer be lowercase. If you want them in lowercase,\r\nsimply add `.toLowerCase()` to the return value.\r\n\r\n@meeber @lucasfcosta this should be released as `v3.0.0` due to `BREAKING CHANGE:` in the commit."},"comment":{"url":"https://api.github.com/repos/chaijs/type-detect/issues/comments/252450883","html_url":"https://github.com/chaijs/type-detect/pull/79#issuecomment-252450883","issue_url":"https://api.github.com/repos/chaijs/type-detect/issues/79","id":252450883,"user":{"login":"lucasfcosta","id":6868147,"avatar_url":"https://avatars.githubusercontent.com/u/6868147?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasfcosta","html_url":"https://github.com/lucasfcosta","followers_url":"https://api.github.com/users/lucasfcosta/followers","following_url":"https://api.github.com/users/lucasfcosta/following{/other_user}","gists_url":"https://api.github.com/users/lucasfcosta/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasfcosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasfcosta/subscriptions","organizations_url":"https://api.github.com/users/lucasfcosta/orgs","repos_url":"https://api.github.com/users/lucasfcosta/repos","events_url":"https://api.github.com/users/lucasfcosta/events{/privacy}","received_events_url":"https://api.github.com/users/lucasfcosta/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T22:00:47Z","updated_at":"2016-10-08T22:00:47Z","body":"LGTM! I agree with that, it should be a user's responsibility to sanitize the output of this module.\r\n\r\nAlso, when committing a breaking change you just gotta add `BREAKING CHANGE: <description>` to the commit right?"}}
{"actor":{"display_login":"lucasfcosta"}}