-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use F14FastMap for protocol::Object::members
Summary: Box with cpp.Ref for protocol::Object::members and use folly::F14FastMap instead. Improve read ~2x and write ~20% for ComplexStruct compared to the original before D45419589 ``` // before ============================================================================================= fbcode/thrift/lib/cpp2/test/ProtocolBench.cpp relative time/iter iters/s serialized_size ============================================================================================= ObjectBinaryProtocol_write_LargeMapInt 29.20ms 34.24 NaN ObjectBinaryProtocol_read_LargeMapInt 289.67ms 3.45 8000010 ObjectBinaryProtocol_write_NestedMap 2.86ms 349.47 NaN ObjectBinaryProtocol_read_NestedMap 26.76ms 37.37 955550 ObjectBinaryProtocol_write_ComplexStruct 148.94ms 6.71 NaN ObjectBinaryProtocol_read_ComplexStruct 1.07s 935.68m 59006614 ObjectCompactProtocol_write_LargeMapInt 31.28ms 31.97 NaN ObjectCompactProtocol_read_LargeMapInt 294.95ms 3.39 7928804 ObjectCompactProtocol_write_NestedMap 3.01ms 332.02 NaN ObjectCompactProtocol_read_NestedMap 29.00ms 34.48 649304 ObjectCompactProtocol_write_ComplexStruct 149.92ms 6.67 NaN ObjectCompactProtocol_read_ComplexStruct 1.13s 885.15m 38637969 ============================================================================================= ``` ``` // after ============================================================================================= fbcode/thrift/lib/cpp2/test/ProtocolBench.cpp relative time/iter iters/s serialized_size ============================================================================================= ObjectBinaryProtocol_write_LargeMapInt 24.88ms 40.19 NaN ObjectBinaryProtocol_read_LargeMapInt 263.72ms 3.79 8000010 ObjectBinaryProtocol_write_NestedMap 2.17ms 461.58 NaN ObjectBinaryProtocol_read_NestedMap 16.32ms 61.26 955550 ObjectBinaryProtocol_write_ComplexStruct 151.73ms 6.59 NaN ObjectBinaryProtocol_read_ComplexStruct 823.07ms 1.21 59006614 ObjectCompactProtocol_write_LargeMapInt 21.45ms 46.61 NaN ObjectCompactProtocol_read_LargeMapInt 241.03ms 4.15 7928804 ObjectCompactProtocol_write_NestedMap 2.25ms 443.92 NaN ObjectCompactProtocol_read_NestedMap 16.22ms 61.67 649304 ObjectCompactProtocol_write_ComplexStruct 153.06ms 6.53 NaN ObjectCompactProtocol_read_ComplexStruct 883.66ms 1.13 38637969 ============================================================================================= ``` Reviewed By: vitaut Differential Revision: D45419590 fbshipit-source-id: 43c55427c846f053520f71119c5050daa3572c68
- Loading branch information
1 parent
272c72b
commit fcbae29
Showing
9 changed files
with
48 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters