{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30464","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30464/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30464/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30464/events","html_url":"https://github.com/cockroachdb/cockroach/pull/30464","id":362253200,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDIzNDgx","number":30464,"title":"sql: don't write/parse exprs in local mode","user":{"login":"jordanlewis","id":43821,"node_id":"MDQ6VXNlcjQzODIx","avatar_url":"https://avatars1.githubusercontent.com/u/43821?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanlewis","html_url":"https://github.com/jordanlewis","followers_url":"https://api.github.com/users/jordanlewis/followers","following_url":"https://api.github.com/users/jordanlewis/following{/other_user}","gists_url":"https://api.github.com/users/jordanlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanlewis/subscriptions","organizations_url":"https://api.github.com/users/jordanlewis/orgs","repos_url":"https://api.github.com/users/jordanlewis/repos","events_url":"https://api.github.com/users/jordanlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanlewis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-20T15:53:34Z","updated_at":"2018-09-24T21:45:14Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30464","html_url":"https://github.com/cockroachdb/cockroach/pull/30464","diff_url":"https://github.com/cockroachdb/cockroach/pull/30464.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/30464.patch"},"body":"Note to reviewers: I resurrected this from some work last month. It still needs some cleanup. But it appears to work okay, so I'm sending it out for early feedback. I haven't performance tested against TPCC yet - kv has no change because there's no exprs to serialize in that workload.\r\n\r\nPreviously, expressions that needed to be used in processors were\r\nwritten to a buffer with FmtParsable and re-parsed and type checked\r\nwith the parser, even if the processors were running in the local flow\r\nmode. This was inefficient.\r\n\r\nNow, we use a similar strategy to the \"LocalPlanNode\" system to avoid\r\nthis inefficiency. When we go to save an Expr to a processor spec, if\r\nwe're writing to a spec that will be inflated on the gateway, instead of\r\nformatting the Expr to text, we save the Expr in a slice and record its\r\nindex. Then, at inflation time, instead of parsing the text we would\r\nhave written, we simply look up the Expr in the slice we saved it to.\r\n\r\nThis should eliminate one of the major inefficiences introduced by the\r\ndistsql merge.\r\n\r\nRelease note: None"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/424136373","html_url":"https://github.com/cockroachdb/cockroach/pull/30464#issuecomment-424136373","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30464","id":424136373,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDEzNjM3Mw==","user":{"login":"jordanlewis","id":43821,"node_id":"MDQ6VXNlcjQzODIx","avatar_url":"https://avatars1.githubusercontent.com/u/43821?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanlewis","html_url":"https://github.com/jordanlewis","followers_url":"https://api.github.com/users/jordanlewis/followers","following_url":"https://api.github.com/users/jordanlewis/following{/other_user}","gists_url":"https://api.github.com/users/jordanlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanlewis/subscriptions","organizations_url":"https://api.github.com/users/jordanlewis/orgs","repos_url":"https://api.github.com/users/jordanlewis/repos","events_url":"https://api.github.com/users/jordanlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanlewis/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T21:45:14Z","updated_at":"2018-09-24T21:45:14Z","author_association":"MEMBER","body":"```\r\nname                          old time/op    new time/op    delta\r\nFlowSetup/distribute=true-8     43.1µs ±11%    42.9µs ± 2%     ~     (p=0.853 n=10+10)\r\nFlowSetup/distribute=false-8    37.5µs ± 3%    30.6µs ± 7%  -18.35%  (p=0.000 n=10+10)\r\n\r\nname                          old alloc/op   new alloc/op   delta\r\nFlowSetup/distribute=true-8     38.1kB ± 0%    38.5kB ± 0%   +1.18%  (p=0.000 n=9+9)\r\nFlowSetup/distribute=false-8    32.3kB ± 0%    30.2kB ± 0%   -6.65%  (p=0.000 n=10+8)\r\n\r\nname                          old allocs/op  new allocs/op  delta\r\nFlowSetup/distribute=true-8        342 ± 0%       344 ± 0%   +0.59%  (p=0.000 n=10+10)\r\nFlowSetup/distribute=false-8       296 ± 0%       258 ± 0%  -12.84%  (p=0.000 n=10+10)```\r\n\r\nThe extra allocations in `distribute=true` are unexpected, but will be tamped down by #30556 once that gets cleaned up."}}
{"actor":{"display_login":"jordanlewis"}}