Closed GoogleCodeExporter closed 9 years ago
I've also played around with the concurrencyLevel, anywhere from 1 to exact
number of threads in the HTTP server. Made no discernible difference either.
Original comment by jace...@gmail.com
on 11 Feb 2014 at 5:15
Curious what your equals/hashCode methods look like on your
ItineraryResultCacheKey POJO...
Original comment by kak@google.com
on 11 Feb 2014 at 5:18
At first I had a default one generated via Lombok. That is how we found the
original issues.
Since that was my first suspicion I overrode it manually to just use the
aforementioned single String representation of all the parts of the POJO, e.g.
private String id;
@Override
public boolean equals(Object obj) {
if (obj instanceof ItineraryResultCacheKey) {
return this.id.equals(((ItineraryResultCacheKey) obj).getId());
} else {
return false;
}
}
@Override
public int hashCode() {
return this.id.hashCode();
}
where "id" gets created in the Constructor by appending all the 6 fields into a
single string using a StringBuilder (with "" put if string is null and the
explicit year/month/day integers put into it for the date part (so no actual
Date.toString() where we could get millsecond/second differences).,
Also, we found this in simple perf testing where we are basically sending the
same 10 requests over and over (using multi-mechanize) so the range of keys
being sent is actually very small. It's not real-life data.
Is there some part of code you could recommend for me to trace or debug
manually (a particular Class/method)?
Unfortunately due to the proprietary nature of the application I am very
limited in what type of code I can post.
Original comment by jace...@gmail.com
on 11 Feb 2014 at 5:30
I hang my head in shame. Equals()/hashCode() are not the problem.
We had previously existing code in a totally different section of the app that
was actually mutating this key during multiple parts of the processing (one of
the fields). This was done as part of a naive attempt to reduce GC pressure by
reusing object instances (instead of instantiating them multiple times with
minor variations).
Once I removed that and made it properly instantiate a new instance every time
every started running properly.
Please close as invalid.
Original comment by jace...@gmail.com
on 11 Feb 2014 at 5:56
Original comment by lowas...@google.com
on 11 Feb 2014 at 5:57
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:10
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:07
Original issue reported on code.google.com by
jace...@gmail.com
on 11 Feb 2014 at 5:13