Closed matrixx567 closed 8 years ago
Spacing is inconsistent (compare 459 and 462).
There is no benchmarking, just a promise. After fixing the spacing, the change seems worth merging, as I would also say that this is the right way of doing it. But at least a microbenchmarking is expected if you are going to claim a performance improvement.
Interesting! Did you get a chance to measure how much this increases throughput?
I executed the benchmarks on my machine this morning and here are the results:
Another slight improvement to the original code of the Array's and Object's write method is to put the first=false;
statement into the IF statement. So it will be only called once for the loop.
Another slight improvement to the original code of the Array's and Object's write method is to put the first=false; statement into the IF statement.
@matrixx567 Sorry, do we even need it? What you proposed for void write(JsonWriter)
seems better.
Thanks for the change @matrixx567! Performance aside, the code is clearer and better.
Fixed the formatting in https://github.com/ralfstx/minimal-json/commit/0ff90d9a73630495f26522aa81e047004362c73c
Performance aside, the code is clearer and better.
I agree.
Fixed the formatting in https://github.com/ralfstx/minimal-json/commit/0ff90d9a73630495f26522aa81e047004362c73c
Thank you for also caring about this.
Hello Ralf,
I improved the performance of writing JsonObjects and JsonArray a little bit. Therefore I handle the first element of the array before the loop and this allows to remove the IF statement within the WHILE-loop.
BR Martin