-
Notifications
You must be signed in to change notification settings - Fork 5
Description
After fiddling with mendoza patches, I really appreciate the format.
Observing my deltas I found several of my values changing a little over time.
Especially the numeric fields have a rather obvious optimization potential:
Often the numbers do not diff by much.
Maybe a useful addition of ObjectSetFieldValue would be ObjectIncrementFieldValue, which would only allow numeric (not necessarily positive) values as argument.
The differ would compare whether the patch step was shorter if the increment was used instead of set value.
left
{
"otherbiginfo": "loremipsumdolorsitamet",
"traffic": {
"rx": {
"packets": 652834,
"bytes": 452876795
}
},
"uptime": 13521.02
}right
{
"otherbiginfo": "loremipsumdolorsitamet",
"traffic": {
"rx": {
"packets": 653759,
"bytes": 452949875
}
},
"uptime": 13579.39
}
Currently a patch for this looks like this (80):
[
17,
{
"rx": {
"bytes": 452949875,
"packets": 653759
}
},
"traffic",
17,
13579.39,
"uptime"
]After implementing
24: Increment
and 25: ObjectIncrementFieldValue
A patch could then look like this (70 chars):
[
25,
{
"rx": {
"bytes": 73080,
"packets": 925
}
},
"traffic",
25,
58.37,
"uptime"
]Looking at ArrayAppendValue and StringAppendString this would be a suitable extension of the current format.
What do you think about this?