Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing SimpleTemplateEngine with basic string replace to improve performance in mergeProperties #86

Merged

Conversation

pjvelez
Copy link

@pjvelez pjvelez commented Aug 15, 2016

Tested against our Emcee project (which has 97 projects). ./gradlew eclipse runtime drops from 4 minutes to 40 seconds.

into.setProperty(property, propertyValue)
int end = str.indexOf('}', begin)
if (end < 0) {
sb.append(str.substring(start))
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be an error case?

Copy link
Author

Choose a reason for hiding this comment

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

Do you mean should this throw an error? Or account for this situation in a try/catch block? indexOf will return -1 if the character isn't present and not an error, so it'd only hit a catch block if we manually throw an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I'm wondering if this case should generate an exception. In other words, when we encounter a string huihi ${foobar lalala, should we silently leave it as is, or throw an error?

Copy link
Author

Choose a reason for hiding this comment

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

Ah I understand. Exception has been added in most recent commit.

@uschi2000
Copy link
Contributor

Thanks!

@uschi2000 uschi2000 merged commit 4902b28 into palantir:develop Aug 17, 2016
@uschi2000
Copy link
Contributor

will be available as 0.7.2

@pjvelez
Copy link
Author

pjvelez commented Aug 17, 2016

Sweet, thanks @uschi2000 !

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.

2 participants