json
json copied to clipboard
Stream cleanup
Fix #213
Codecov Report
Merging #551 (c1a299a) into develop (aae1863) will decrease coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## develop #551 +/- ##
===========================================
- Coverage 99.10% 99.10% -0.01%
===========================================
Files 67 67
Lines 6058 6040 -18
===========================================
- Hits 6004 5986 -18
Misses 54 54
Impacted Files | Coverage Δ | |
---|---|---|
include/boost/json/basic_parser.hpp | 100.00% <ø> (ø) |
|
include/boost/json/detail/stream.hpp | 100.00% <ø> (ø) |
|
include/boost/json/serializer.hpp | 100.00% <ø> (ø) |
|
include/boost/json/impl/serializer.ipp | 96.92% <100.00%> (-0.06%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update aae1863...c1a299a. Read the comment docs.
Benchmark test results. More info at https://benchmark.cppalliance.org/jsonbenchmarks-pullrequests/551/pullrequest.html
These affect performance
Yeah, I see that. Do you know the reason? The changes should have been purely cosmetical?
The changes should have been purely cosmetical?
The local stream allows the compiler to assume there is no aliasing
@sdkrystian knows more
@grisumbras @vinniefalco is correct -- creating the local streams allows for the compiler to assume no aliasing. Without them, it must operate under the assumption that the referenced stream may be modified by writes through aliasable pointer types within the function (or ones deeper within the call stack).
In retrospect maybe we should have left a comment on the declaration for local_stream
explaining intent.