aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2016-05-31 17:30:03 -0700
committerReynold Xin <rxin@databricks.com>2016-05-31 17:30:03 -0700
commit8ca01a6feb4935b1a3815cfbff1b90ccc6f60984 (patch)
tree12bddab43ccf85e636a8abc5f6b29c6cc040e5b4 /core/src
parent223f1d58c4f4b6eb0f0037a118a0bb635ae20bb1 (diff)
downloadspark-8ca01a6feb4935b1a3815cfbff1b90ccc6f60984.tar.gz
spark-8ca01a6feb4935b1a3815cfbff1b90ccc6f60984.tar.bz2
spark-8ca01a6feb4935b1a3815cfbff1b90ccc6f60984.zip
[SPARK-15680][SQL] Disable comments in generated code in order to avoid perf. issues
## What changes were proposed in this pull request? In benchmarks involving tables with very wide and complex schemas (thousands of columns, deep nesting), I noticed that significant amounts of time (order of tens of seconds per task) were being spent generating comments during the code generation phase. The root cause of the performance problem stems from the fact that calling toString() on a complex expression can involve thousands of string concatenations, resulting in huge amounts (tens of gigabytes) of character array allocation and copying. In the long term, we can avoid this problem by passing StringBuilders down the tree and using them to accumulate output. As a short-term workaround, this patch guards comment generation behind a flag and disables comments by default (for wide tables / complex queries, these comments were being truncated prior to display and thus were not very useful). ## How was this patch tested? This was tested manually by running a Spark SQL query over an empty table with a very wide schema obtained from a real workload. Disabling comments brought the per-task time down from about 16 seconds to 600 milliseconds. Author: Josh Rosen <joshrosen@databricks.com> Closes #13421 from JoshRosen/disable-line-comments-in-codegen.
Diffstat (limited to 'core/src')
0 files changed, 0 insertions, 0 deletions