[JAVA-675] Inefficient object handling Created: 24/Oct/12 Updated: 31/Mar/15 Resolved: 12/Jul/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Performance |
| Affects Version/s: | 2.9.2 |
| Fix Version/s: | 3.0.0 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Nils | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | performance | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Description |
|
I was debugging through the code and noticed this inefficiency. It's probably not the only place. DBCollection: else if ( inner instanceof Map ) { _checkKeys( (Map<String, Object>)inner ); } } |
| Comments |
| Comment by Jeffrey Yemin [ 31/Mar/15 ] |
|
Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released. |
| Comment by Jeffrey Yemin [ 12/Jul/13 ] |
|
In 3.0.x, it's being done during the encoding process. See https://github.com/mongodb/mongo-java-driver/blob/3.0.x/driver-compat/src/main/com/mongodb/codecs/DBObjectCodec.java#L77 |
| Comment by Jeffrey Yemin [ 27/Oct/12 ] |
|
We can't do this in general since DBOBject does not implement Map. Have you seen this show up in profiling? Typically this kind of inefficiency does not, as I/O tends to be the bottleneck. |
| Comment by Nils [ 24/Oct/12 ] |
|
Or even better, wait to do such checks until binary serialization, if possible. |