GitHub user KellenSunderland opened a pull request:
https://github.com/apache/incubator-joshua/pull/11
Removed a few unneeded allocations
This is the last commit from us targeting short lived object allocations.
I've separated this from the other commits because this line might warrant some
discussion.
```
- // create a new vector is critical, because currentAntecedents will
change later
- this.antNodes = new ArrayList<HGNode>(antecedents);
+ this.antNodes = antecedents;
```
When I look at the usages of this I don't see exactly why we need this new
vector. Is this comment still relevant? This line creates a significant
amount of objects during decoding which a. is slow, and b. causes a lot of
garbage collection. I can share some TLAB measurements for this method if
anyone would like to dig into the details. If there are any edge cases I'm
missing we can leave this section as is.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/KellenSunderland/incubator-joshua master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-joshua/pull/11.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11
----
commit 89868747380b7f49811193f78f3e9a42eb617d99
Author: Kellen Sunderland <[email protected]>
Date: 2016-01-27T09:15:48Z
Removed a few unneeded allocations
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---