[JAVA-2303] Regression in LazyBSONObject.entrySet() performance in the 3.x driver Created: 09/Sep/16 Updated: 19/Oct/16 Resolved: 22/Sep/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON, Performance |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.4.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Steve Briskin (Inactive) | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
There is a regression in the performance of LazyBSONObject.entrySet() in the 3.x driver vs. the 2.x driver. The below runs in ~80ms with the 2.14 driver and ~8000ms with the 3.3 driver.
|
| Comments |
| Comment by Githook User [ 22/Sep/16 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: The root cause of the performance problem was that the entrySet The fix is two-fold. The first is to use a private Set implementation The second change is to ensure that LazyBSONObject.hashCode only examines the |
| Comment by Jeffrey Yemin [ 09/Sep/16 ] |
|
Tracked it down to a badly implemented hash function in LazyBSONObject, which is being utilized indirectly in LazyBSONObject.entrySet when it stick the value in a hash map |