First, there is no things like `foreach(i, name, member; value.object)` in the language.
Second, I'm against performance optimizations of text based formats processing as IMO text based formats must not be used in such situations.
Third, there is two `put` calls, `toString` call, and `toValue` call. So one write adds insignificant complexity and so is inconsiderable.
**Fourth**, one should never do such micro optimizations as it is valuable only if every other function is inlined i.e. the complexity of resulting code is comparable to the complexity of write but this mean the compiler know what is happened here and can remvoe dead assignments or perform any other optimizations we can't even imagine.