[SERVER-27171] Add operator<<(bool) to StringBuilderImpl Created: 23/Nov/16  Updated: 05/Apr/17  Resolved: 28/Nov/16

Status: Closed
Project: Core Server
Component/s: Performance
Affects Version/s: 3.4.0-rc4
Fix Version/s: 3.4.1, 3.5.1

Type: Improvement Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-27192 Consider using 'boolalpha' mode for s... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Query 2016-12-12
Participants:
Linked BF Score: 0

 Description   

Running the "Queries.IntNonIdFindOne" mongo-perf test while profiling mongod under VTune shows the StringBuilderImpl operator<<(int) as a significant hotspot. This stems from writing boolean values to StringBuilder in the read/update/delete path during query planning. As we don't implement a boolean stream handler, booleans are handled as type int, and are written inefficiently via snprintf. A boolean operator can be written that will perform the same action in a (much) more efficient manner.



 Comments   
Comment by Githook User [ 06/Dec/16 ]

Author:

{u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}

Message: SERVER-27171 Add operator<<(bool) to StringBuilderImpl

(cherry picked from commit 3c5671874c56a4b7866fda9bec9c233d3f754313)
Branch: v3.4
https://github.com/mongodb/mongo/commit/ced7e509751485e086756a22ab8246e146206cc1

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}

Message: SERVER-27171 Add operator<<(bool) to StringBuilderImpl
Branch: master
https://github.com/mongodb/mongo/commit/3c5671874c56a4b7866fda9bec9c233d3f754313

Generated at Thu Feb 08 04:14:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.