{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4391","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4391/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4391/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4391/events","html_url":"https://github.com/cockroachdb/cockroach/pull/4391","id":133863520,"number":4391,"title":"MVCCResolveWriteIntent{,Range} optimizations.","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-16T02:15:06Z","updated_at":"2016-02-16T18:26:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/4391","html_url":"https://github.com/cockroachdb/cockroach/pull/4391","diff_url":"https://github.com/cockroachdb/cockroach/pull/4391.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/4391.patch"},"body":"Reduce memory allocations. Reuse an iterator between\nMVCCResolveWriteIntentRange and the calls to MVCCResolveWriteIntent\ninstead of creating an iterator on every call to MVCCResolveWriteIntent.\n\n```\nname                   old time/op    new time/op    delta\nInsert1_Cockroach-8       327µs ± 1%     324µs ± 1%   -0.83%         (p=0.003 n=10+9)\nInsert10_Cockroach-8      637µs ± 1%     630µs ± 1%   -1.17%        (p=0.000 n=10+10)\nInsert100_Cockroach-8    3.34ms ± 0%    3.32ms ± 1%   -0.60%         (p=0.028 n=9+10)\nUpdate1_Cockroach-8       468µs ± 1%     467µs ± 1%     ~           (p=0.315 n=10+10)\nUpdate10_Cockroach-8     3.74ms ± 1%    3.71ms ± 2%     ~           (p=0.218 n=10+10)\nUpdate100_Cockroach-8    32.9ms ± 0%    32.7ms ± 1%   -0.61%        (p=0.002 n=10+10)\nDelete1_Cockroach-8       465µs ± 1%     458µs ± 1%   -1.63%         (p=0.000 n=9+10)\nDelete10_Cockroach-8     1.18ms ± 1%    1.07ms ± 1%   -9.79%         (p=0.000 n=9+10)\nDelete100_Cockroach-8    7.53ms ± 1%    6.53ms ± 2%  -13.26%         (p=0.000 n=10+9)\nScan1_Cockroach-8         139µs ± 1%     139µs ± 1%     ~            (p=0.497 n=10+9)\nScan10_Cockroach-8        170µs ± 1%     171µs ± 1%     ~           (p=0.190 n=10+10)\nScan100_Cockroach-8       473µs ± 2%     481µs ± 4%     ~           (p=0.063 n=10+10)\n\nname                   old allocs/op  new allocs/op  delta\nInsert1_Cockroach-8         287 ± 0%       284 ± 0%   -1.05%        (p=0.000 n=10+10)\nInsert10_Cockroach-8        737 ± 0%       707 ± 0%   -4.07%         (p=0.000 n=9+10)\nInsert100_Cockroach-8     5.01k ± 0%     4.71k ± 0%   -5.99%        (p=0.000 n=10+10)\nUpdate1_Cockroach-8         479 ± 0%       475 ± 0%   -0.63%        (p=0.000 n=10+10)\nUpdate10_Cockroach-8      4.38k ± 0%     4.35k ± 0%   -0.68%          (p=0.000 n=6+9)\nUpdate100_Cockroach-8     41.7k ± 0%     41.4k ± 0%   -0.71%        (p=0.000 n=10+10)\nDelete1_Cockroach-8         443 ± 0%       428 ± 0%   -3.39%        (p=0.000 n=10+10)\nDelete10_Cockroach-8      1.18k ± 0%     1.01k ± 0%  -14.23%        (p=0.000 n=10+10)\nDelete100_Cockroach-8     8.08k ± 0%     6.38k ± 0%  -21.02%         (p=0.000 n=10+9)\nScan1_Cockroach-8           161 ± 0%       161 ± 0%     ~     (all samples are equal)\nScan10_Cockroach-8          241 ± 0%       241 ± 0%     ~     (all samples are equal)\nScan100_Cockroach-8         967 ± 0%       968 ± 0%     ~           (p=0.656 n=10+10)\n```\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/4391)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/184812756","html_url":"https://github.com/cockroachdb/cockroach/pull/4391#issuecomment-184812756","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/4391","id":184812756,"user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T18:26:22Z","updated_at":"2016-02-16T18:26:22Z","body":"LGTM\n\n---\n\nReview status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion.\n\n---\n\n*[storage/engine/mvcc.go, line 1362 \\[r1\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/4391#-KAfJtAvmfJGGAVyOEPx:-KAfJtAvmfJGGAVyOEPy:1582641414) ([raw file](https://github.com/cockroachdb/cockroach/blob/dccc190f7e12a5530fa7af13f009881dfc9a3007/storage/engine/mvcc.go#L1362)):*\nShould we also un-defer `iter.Close()` just above?\n\n---\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/cockroachdb/cockroach/4391#-:-KAfKJ9Gxr1Zh86QvcXg:676834233)*\n<!-- Sent from Reviewable.io -->\n"}}