Benchmark of using JSON to transport query results in node.js

Поиск
Список
Период
Сортировка
От Mitar
Тема Benchmark of using JSON to transport query results in node.js
Дата
Msg-id CAKLmikO1y8LD+8Ugd+cwUW0JWj36tmPfAfn+M33d1G2MHhiOOA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Benchmark of using JSON to transport query results in node.js  (Tony Shelver <tshelver@gmail.com>)
Список pgsql-general
Hi!

I made some benchmarks of using JSON to transport results to node.js
and it seems it really makes a difference over using native or
standard PostgreSQL. So the idea is that you simply wrap all results
into JSON like SELECT to_json(t) FROM (... original query ...) AS t. I
am guessing because node.js/JavaScript has really fast JSON parser but
for everything else there is overhead. See my blog post for more
details [1]. Any feedback welcome.

This makes me wonder. If serialization/deserialization makes such big
impact, where there efforts to improve how results are serialized for
over-the-wire transmission? For example, to use something like
Capnproto [2] to serialize into structure which can be directly used
without any real deserialization?

[1] https://mitar.tnode.com/post/181893159351/in-nodejs-always-query-in-json-from-postgresql
[2] https://capnproto.org/


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: log level of "drop cascade" lists
Следующее
От: Tony Shelver
Дата:
Сообщение: Re: Benchmark of using JSON to transport query results in node.js