Skip to content

Conversation

@yangw1234
Copy link

In jdk1.7 TimeZone.getTimeZone() is synchronized, so use an instance variable to hold an GMT TimeZone object instead of instantiate it every time.

@JoshRosen
Copy link
Contributor

Jenkins, this is ok to test.

@SparkQA
Copy link

SparkQA commented Jan 30, 2016

Test build #50444 has finished for PR 10994 at commit 19defc9.

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

@srowen
Copy link
Member

srowen commented Jan 30, 2016

LGTM. Are the other such instances in the code? Best to look for these all at once

@yangw1234
Copy link
Author

@srowen No, just that one in this file.

@rxin
Copy link
Contributor

rxin commented Jan 30, 2016

Thanks - merging this in.

@asfgit asfgit closed this in de28371 Jan 30, 2016
@carsonwang
Copy link
Contributor

I think we should also reusing a Calendar object in each thread. It is expensive to create java Calendar and Timezone objects each time the method is called. I noticed the same problem and I saw performance boost if reusing these objects. The duration of one stage was improved from 1.6 minutes to 1.2 minutes. @wangyang1992 @rxin

@rxin
Copy link
Contributor

rxin commented Feb 4, 2016

Can you submit a patch? Thanks.

@carsonwang
Copy link
Contributor

OK. I will do that.

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.

6 participants