-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete_at_pointer #1071
base: develop
Are you sure you want to change the base?
delete_at_pointer #1071
Conversation
An automated preview of the documentation is available at https://1071.json.prtest2.cppalliance.org/libs/json/doc/html/index.html |
|
I will try to do another PR with same code, I am confident @vinniefalco that above was just some temporary fluctuation on the vm running the test. |
An automated preview of the documentation is available at https://1071.json.prtest2.cppalliance.org/libs/json/doc/html/index.html |
…on/1791/15/2 ./boost/json/impl/pointer.ipp:457:18: error: 'kind' is not a class, namespace, or enumeration
An automated preview of the documentation is available at https://1071.json.prtest2.cppalliance.org/libs/json/doc/html/index.html |
|
|
Unreachable code removed.
An automated preview of the documentation is available at https://1071.json.prtest2.cppalliance.org/libs/json/doc/html/index.html |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1071 +/- ##
===========================================
- Coverage 93.70% 93.06% -0.65%
===========================================
Files 91 91
Lines 9139 9202 +63
===========================================
Hits 8564 8564
- Misses 575 638 +63
Continue to review full report in Codecov by Sentry.
|
|
@sdarwin once again I question these benchmarks.... |
At least at this moment, there is not a basis to think the benchmark is wrong. I will run a test and attempt to replicate that result. |
Just as expected, the results can be easily replicated. :-) See sdarwin#20 , which shows the image below. |
I'm not entirely sold on this idea. Given that you also want to return the part of the pointer string that was matched (which is not done for other JSON Pointer functions), it appears to me there's a need for lower-level Pointer functionality, with which users could build their own algorithms. Alternative idea for a simple "delete at pointer" API: add a special "undefined" state to |
@sdarwin the question isn't whether benchmark results are random. You showed us several times that they are not. The question is why they are so much affected by random changes. It could be that the benchmark runner program is not very good, but I remember at least in one case a change in a CMake script (that did not relate to the benchmarks) resulted in benchmark performance degradation. The only way I can explain this phenomenon is that the build process itself exhausts some resource, or results in some file loading/unloading and that changes the overall performance of the system. Maybe we could try building the benchmarks, storing the build artifacts, and then launching the benchmarks with those artifacts in a fresh container? |
The current benchmark in this pull request is the following: That is mostly around 3% or less. Some 0%. It's not wildly unexpected. However, @grisumbras you should understand as well as anyone, even a very small code change (a wrongly placed "if", a missing "return", a bit or byte in the wrong place) can generate a detour in the code path, such that the code is very buggy, and the results are anyone's guess. It may be accurate and correct for the benchmarks to deviate by 30% or 100%, or 10000%, when there is a bug, a mistake, in the pull request. |
I wouldn't expect bugs in this PR's code (whether they exist or not) to affect benchmarks, given that none of this new code is ever executed by the benchmarks. Regardless, my comment should have been considered more generally. Consider this PR: #1031. It just causes warnings in certain cases. Shouldn't affect runtime at all. And yet several tests are affected quite dramatically. |
https://learn.microsoft.com/en-us/azure/architecture/antipatterns/noisy-neighbor/noisy-neighbor This is what probably is @grisumbras and @sdarwin . |
Checking notes... that exact week was when the newest server khjson1.cpp.al went into production for the first time.
|
@RoyBellingan , there is no evidence of "noisy neighbors" usually: this is not a virtual machine on shared hardware, it is a separate server. |
@RoyBellingan after some thinking, I'm not sure that producing an error when an element is not found makes much sense. The effect of the operation is that the element is not nested in the value. If it already wasn't there, the effect is the same. So, the function should mostly report an error if the pointer string is invalid. In this case, if error is not set and An aside, I think the function should be called In addition, there's a question of what to do with a pointer that designates the root object (an empty string). As far as I can see your algorithm doesn't handle it in a sensible manner. Even if it did, it obviously cannot actually remove the root value, so I'm inclined to think that this situation should actually be an error. Probably a new one. I also want you to remove the tracking of the consumed part of the Pointer string. None of the other Pointer functions do that right now, and it would be strange to introduce it only for this function. We have a potential idea on how to implement such tracking in the future. Finally, for the PR to be eventually merged, it should also contain all the necessary overloads (similar to |
Some provisional code to add support for the delete_at_pointer functionality.
To test with
https://github.com/RoyBellingan/boostDeleteAtPointer
It should produce this