3 ms·
You're going to stream a Hello, World value? Why use JSON, at all, when we can just print the resulting JSON text! Benchmarks should be defined, that's all.
by thezilch 13y ago
You're going to stream a Hello, World value? Why use JSON, at all, when we can just print the resulting JSON text! Benchmarks should be defined, that's all.
- haberman 13y ago> Why use JSON, at all, when we can just print the resulting JSON text! Indeed. But if you want to actually force the server to encode some JSON, then make the reply include portions of the request. Then you don't have to have artificial rules about how it is implemented to get interesting/meaningful results: https://news.ycombinator.com/item?id=6650499 https://news.ycombinator.com/item?id=6650499
- emn13 13y agoNo, you still need to, because you can otherwise do a trivial string concat in most cases, even though in reality that would be most unwise for security, robustness, and maintainability reasons.
- haberman 13y agoSince you don't know the inputs ahead of time, the benchmark would be incorrect if it could not handle the corner cases like special characters that need to be escaped in JSON strings. If you wanted you could also make the request specify the key at which a value must be written. Be creative. :) But don't think that apps always have to be written the way they are now to be "legitimate."