Skip to content

Conversation

@JoshRosen
Copy link
Contributor

This is an experiment to see if we can easily speed up HiveCompatibilitySuite by speculatively running without calling TestHive.reset(), then retrying if that fails.

Note: This PR is a bit of a mess since it's now serving as a quick playground for me to rapidly prototype perf. patches and test them with Jenkins.

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34243 has finished for PR 6663 at commit 417f50e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

Cool, HiveCompatibilitySuite now runs in 12 minutes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this, and SerilaizableWritable more generally, may be a huge source of perf. bottlenecks for short tasks. A common use of SerializableWritable is in serializing Hadoop Configurations, but it seems kind of crazy to create and discard a new Configuration in order to be able to deserialize the driver-provided conf. Maybe we can make a substitute for SerializableWritable which only deals with Configuration subclasses and just calls writeFields() and readFields() directly. This would sidestep a lot of the performance penalties involved in creating Configuration objects and having them spend tons of time loading defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently other folks have noticed Configuration's expensive instantiation costs, too: https://issues.apache.org/jira/browse/MAPREDUCE-5399

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34257 has finished for PR 6663 at commit f90dc94.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

Wow, this test suite seems to run an insane number of queries against Derby. From YourKit's performance charts view:

image

That's nearly 2.5 million queries for ~700 test cases or roughly 3500 queries / statements per test. Can this be right or is YourKit measuring something different than I think it is?

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34258 has finished for PR 6663 at commit 480d20a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen JoshRosen force-pushed the hive-compat-suite-speedup branch from 137a0c7 to 55041d2 Compare June 5, 2015 09:09
@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34261 has finished for PR 6663 at commit 137a0c7.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34262 has finished for PR 6663 at commit 55041d2.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34263 has finished for PR 6663 at commit 57c2cb4.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34265 has finished for PR 6663 at commit 9db0abc.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34312 has finished for PR 6663 at commit 3fe16e8.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 5, 2015

Test build #34327 has finished for PR 6663 at commit b1e3f82.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 6, 2015

Test build #34336 has finished for PR 6663 at commit 5113370.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 6, 2015

Test build #34339 has finished for PR 6663 at commit fac08d5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Jun 6, 2015

Test build #34341 has finished for PR 6663 at commit fac08d5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 8, 2015

Test build #34455 has finished for PR 6663 at commit 8c1e1ff.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Jun 9, 2015

Test build #34523 has finished for PR 6663 at commit 8c1e1ff.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #903 has finished for PR 6663 at commit 8c1e1ff.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #34789 has finished for PR 6663 at commit 2b500b9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #904 has finished for PR 6663 at commit 2b500b9.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #905 has finished for PR 6663 at commit 2b500b9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #34793 has finished for PR 6663 at commit fbd3d03.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #906 has finished for PR 6663 at commit fbd3d03.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #34795 has finished for PR 6663 at commit 46dd005.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 12, 2015

Test build #907 has finished for PR 6663 at commit fbd3d03.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen JoshRosen closed this Jun 13, 2015
@JoshRosen JoshRosen deleted the hive-compat-suite-speedup branch November 24, 2015 00:35
@JoshRosen JoshRosen restored the hive-compat-suite-speedup branch November 24, 2015 00:35
ghost pushed a commit to dbtsai/spark that referenced this pull request Dec 1, 2015
…g up TestHive.reset()

When profiling HiveCompatibilitySuite, I noticed that most of the time seems to be spent in expensive `TestHive.reset()` calls. This patch speeds up suites based on HiveComparisionTest, such as HiveCompatibilitySuite, with the following changes:

- Avoid `TestHive.reset()` whenever possible:
  - Use a simple set of heuristics to guess whether we need to call `reset()` in between tests.
  - As a safety-net, automatically re-run failed tests by calling `reset()` before the re-attempt.
- Speed up the expensive parts of `TestHive.reset()`: loading the `src` and `srcpart` tables took roughly 600ms per test, so we now avoid this by using a simple heuristic which only loads those tables by tests that reference them. This is based on simple string matching over the test queries which errs on the side of loading in more situations than might be strictly necessary.

After these changes, HiveCompatibilitySuite seems to run in about 10 minutes.

This PR is a revival of apache#6663, an earlier experimental PR from June, where I played around with several possible speedups for this suite.

Author: Josh Rosen <[email protected]>

Closes apache#10055 from JoshRosen/speculative-testhive-reset.
asfgit pushed a commit that referenced this pull request Dec 1, 2015
…g up TestHive.reset()

When profiling HiveCompatibilitySuite, I noticed that most of the time seems to be spent in expensive `TestHive.reset()` calls. This patch speeds up suites based on HiveComparisionTest, such as HiveCompatibilitySuite, with the following changes:

- Avoid `TestHive.reset()` whenever possible:
  - Use a simple set of heuristics to guess whether we need to call `reset()` in between tests.
  - As a safety-net, automatically re-run failed tests by calling `reset()` before the re-attempt.
- Speed up the expensive parts of `TestHive.reset()`: loading the `src` and `srcpart` tables took roughly 600ms per test, so we now avoid this by using a simple heuristic which only loads those tables by tests that reference them. This is based on simple string matching over the test queries which errs on the side of loading in more situations than might be strictly necessary.

After these changes, HiveCompatibilitySuite seems to run in about 10 minutes.

This PR is a revival of #6663, an earlier experimental PR from June, where I played around with several possible speedups for this suite.

Author: Josh Rosen <[email protected]>

Closes #10055 from JoshRosen/speculative-testhive-reset.

(cherry picked from commit ef6790f)
Signed-off-by: Reynold Xin <[email protected]>
@JoshRosen JoshRosen deleted the hive-compat-suite-speedup branch August 29, 2016 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants