[
https://issues.apache.org/jira/browse/OPENNLP-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Wiesner updated OPENNLP-1759:
------------------------------------
Description:
Right now, StringList#hashCode() computes the hash code in a CPU-intensive way
each time it is called. When used in NgramModel and Dictionary, this causes
many extra CPU cycles. Those can be easily avoided, by simply pre-computing the
hashCode for each StringList object once, that is on first access - if required.
Let's tune this towards being more eco-friendly.
was:
Right now, StringList#hashCode() computes the hash code in a CPU-intensive way
each time it is called. When used in NgramModel and Dictionary, this causes
many extra CPU cycles. Those can be easily avoided, by simply pre-computing the
hashCode for each StringList object once, that is during objection creation as
last step.
Let's tune this towards being more eco-friendly.
> Optimize computation of hashCode in StringList
> ----------------------------------------------
>
> Key: OPENNLP-1759
> URL: https://issues.apache.org/jira/browse/OPENNLP-1759
> Project: OpenNLP
> Issue Type: Improvement
> Affects Versions: 2.5.4
> Reporter: Martin Wiesner
> Assignee: Martin Wiesner
> Priority: Minor
> Fix For: 2.5.5, 3.0.0
>
>
> Right now, StringList#hashCode() computes the hash code in a CPU-intensive
> way each time it is called. When used in NgramModel and Dictionary, this
> causes many extra CPU cycles. Those can be easily avoided, by simply
> pre-computing the hashCode for each StringList object once, that is on first
> access - if required.
> Let's tune this towards being more eco-friendly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)