Comments (4)
Does #113 address this issue?
from ch.
We are not using packet: :line
so no, we are not reading line by line, but rather we read all available data on that socket at that moment: https://www.erlang.org/docs/24/man/gen_tcp#recv-2
iex> {:ok, conn} = Ch.start_link
{:ok, #PID<0.240.0>}
iex> {us, :ok} = :timer.tc fn -> Ch.query(conn, "select * from system.numbers limit 40000"); :ok end
{8451, :ok} # 8.5ms
# the current stream implementation emits an element on each `Mint.HTTP1.recv(socket, 0, timeout)`
# here we have 4 elements, so we did 4 recvs
iex> Ch.run(conn, fn conn -> conn |> Ch.stream("select * from system.numbers limit 40000") |> Enum.into([]) end)
[
[
{:status, #Reference<0.3547367938.1947205634.96066>, 200},
{:headers, #Reference<0.3547367938.1947205634.96066>,
[
{"date", "Thu, 03 Aug 2023 15:25:59 GMT"},
{"connection", "Keep-Alive"},
{"content-type", "application/octet-stream"},
{"x-clickhouse-server-display-name", "mac3.local"},
{"transfer-encoding", "chunked"},
{"x-clickhouse-query-id", "93d3e063-84d5-4a4a-bf79-41af9a122034"},
{"x-clickhouse-format", "RowBinaryWithNamesAndTypes"},
{"x-clickhouse-timezone", "UTC"},
{"keep-alive", "timeout=100"},
{"x-clickhouse-summary",
"{\"read_rows\":\"40000\",\"read_bytes\":\"320000\",\"written_rows\":\"0\",\"written_bytes\":\"0\",\"total_rows_to_read\":\"0\",\"result_rows\":\"0\",\"result_bytes\":\"0\"}"}
]},
{:data, #Reference<0.3547367938.1947205634.96066>,
<<1, 6, 110, 117, 109, 98, 101, 114, 6, 85, 73, 110, 116, 54, 52>>}
],
[],
[
{:data, #Reference<0.3547367938.1947205634.96066>,
<<0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, ...>>},
{:data, #Reference<0.3547367938.1947205634.96066>,
<<0, 64, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0,
0, 3, 64, 0, 0, 0, 0, 0, 0, 4, 64, 0, 0, 0, 0, 0, 0, 5, 64, ...>>},
{:data, #Reference<0.3547367938.1947205634.96066>,
<<0, 128, 0, 0, 0, 0, 0, 0, 1, 128, 0, 0, 0, 0, 0, 0, 2, 128, 0, 0, 0, 0,
0, 0, 3, 128, 0, 0, 0, 0, 0, 0, 4, 128, 0, 0, 0, 0, 0, 0, 5, ...>>}
],
[done: #Reference<0.3547367938.1947205634.96066>]
]
from ch.
#113 relevance depends on what exactly your goals are. If you read raw data (like CSV) and don't need parsing, Ch.stream
is already good enough: plausible/ecto_ch#55 (comment)
from ch.
maybe the number of bytes could be configured on request
I don't think it would change much as everything that happens in that recursive call is cheap. You can check it with eprof
on your query:
eprof for select * from system.numbers limit 40000
iex> {:ok, pool} = Ch.start_link
{:ok, #PID<0.1982.0>}
iex> :eprof.start_profiling([self()]); Ch.query(pool, "select * from system.numbers limit 40000"); :eprof.stop_profiling(); :eprof.analyze()
****** Process <0.1980.0> -- 100.00 % of profiled time ***
FUNCTION CALLS % TIME [uS / CALLS]
-------- ----- ------- ---- [----------]
'Elixir.Ch.Connection':ensure_same_server/2 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':get_header/2 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':get_opts_or_private/3 3 0.00 0 [ 0.00]
'Elixir.Ch.Connection':handle_execute/4 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':headers/3 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':maybe_put_header/3 3 0.00 0 [ 0.00]
'Elixir.Ch.Connection':receive_response/3 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':request/6 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':settings/2 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':timeout/1 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':timeout/2 1 0.00 0 [ 0.00]
erl_anno:new/1 5 0.00 0 [ 0.00]
erl_anno:new_location/1 5 0.00 0 [ 0.00]
erl_anno:set_generated/2 3 0.00 0 [ 0.00]
erl_anno:set_anno/3 3 0.00 0 [ 0.00]
erl_anno:reset/2 3 0.00 0 [ 0.00]
erl_anno:reset_simplify/1 3 0.00 0 [ 0.00]
erl_anno:simplify/1 3 0.00 0 [ 0.00]
erl_anno:is_settable/2 3 0.00 0 [ 0.00]
erl_anno:default/2 3 0.00 0 [ 0.00]
elixir_erl:get_ann/1 3 0.00 0 [ 0.00]
'Elixir.Keyword':get/2 9 0.00 0 [ 0.00]
'Elixir.Keyword':merge/2 1 0.00 0 [ 0.00]
prim_inet:send/3 1 0.00 0 [ 0.00]
prim_inet:send_recv_reply/2 1 0.00 0 [ 0.00]
prim_inet:recv/3 5 0.00 0 [ 0.00]
prim_inet:enc_time/1 5 0.00 0 [ 0.00]
elixir_aliases:expand/2 1 0.00 0 [ 0.00]
elixir_aliases:expand_or_concat/2 1 0.00 0 [ 0.00]
elixir_aliases:concat/1 1 0.00 0 [ 0.00]
elixir_aliases:do_concat/1 2 0.00 0 [ 0.00]
elixir_aliases:to_partial/1 1 0.00 0 [ 0.00]
elixir_aliases:lookup/3 1 0.00 0 [ 0.00]
elixir_dispatch:required/1 2 0.00 0 [ 0.00]
elixir_dispatch:is_macro/3 2 0.00 0 [ 0.00]
elixir_dispatch:get_info/2 2 0.00 0 [ 0.00]
elixir:eval_external_handler/1 2 0.00 0 [ 0.00]
'Elixir.DBConnection.Query':decode/3 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Query':encode/3 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Query':'impl_for!'/1 2 0.00 0 [ 0.00]
'Elixir.DBConnection.Query':impl_for/1 2 0.00 0 [ 0.00]
erl_eval:empty_fun_used_vars/0 2 0.00 0 [ 0.00]
erl_eval:exprs/4 2 0.00 0 [ 0.00]
erl_eval:exprs/6 2 0.00 0 [ 0.00]
erl_eval:do_apply/7 2 0.00 0 [ 0.00]
erl_eval:do_apply/4 2 0.00 0 [ 0.00]
erl_eval:expr_list/5 2 0.00 0 [ 0.00]
erl_eval:binding/2 1 0.00 0 [ 0.00]
erl_eval:merge_bindings/4 4 0.00 0 [ 0.00]
erl_eval:'-merge_bindings/4-fun-0-'/6 4 0.00 0 [ 0.00]
lists:member/2 3 0.00 0 [ 0.00]
lists:last/1 1 0.00 0 [ 0.00]
lists:last/2 2 0.00 0 [ 0.00]
lists:keydelete/3 3 0.00 0 [ 0.00]
lists:keydelete3/3 6 0.00 0 [ 0.00]
lists:mapfoldl/3 2 0.00 0 [ 0.00]
lists:mapfoldl_1/3 4 0.00 0 [ 0.00]
'Elixir.System':monotonic_time/1 1 0.00 0 [ 0.00]
'Elixir.System':normalize_time_unit/1 1 0.00 0 [ 0.00]
'Elixir.Ch':'__info__'/1 1 0.00 0 [ 0.00]
'Elixir.Ch':query/2 1 0.00 0 [ 0.00]
'Elixir.Ch':query/4 1 0.00 0 [ 0.00]
'Elixir.DBConnection.ConnectionPool':checkout/3 1 0.00 0 [ 0.00]
erl_internal:bif/3 2 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':abs_timeout/2 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':cancel_deadline/1 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':checkin/1 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':checkout/5 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':checkout_result/3 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':done/4 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':handle/4 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':handle_or_cleanup/5 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Holder':start_deadline/5 1 0.00 0 [ 0.00]
'Elixir.String.Chars.Integer':to_string/1 1 0.00 0 [ 0.00]
'Elixir.DBConnection':checkin/1 1 0.00 0 [ 0.00]
'Elixir.DBConnection':decode/4 1 0.00 0 [ 0.00]
'Elixir.DBConnection':event/2 2 0.00 0 [ 0.00]
'Elixir.DBConnection':log/4 1 0.00 0 [ 0.00]
'Elixir.DBConnection':log/5 1 0.00 0 [ 0.00]
'Elixir.DBConnection':log_result/1 1 0.00 0 [ 0.00]
'Elixir.DBConnection':maybe_encode/4 1 0.00 0 [ 0.00]
'Elixir.DBConnection':meter/1 1 0.00 0 [ 0.00]
'Elixir.DBConnection':past_event/3 2 0.00 0 [ 0.00]
'Elixir.DBConnection':run_execute/5 1 0.00 0 [ 0.00]
elixir_erl_var:translate/4 1 0.00 0 [ 0.00]
elixir_erl_var:from_env/2 2 0.00 0 [ 0.00]
elixir_erl_var:load_binding/2 2 0.00 0 [ 0.00]
elixir_erl_var:load_pair/1 2 0.00 0 [ 0.00]
elixir_erl_var:find_binding/2 2 0.00 0 [ 0.00]
elixir_erl_var:'-dump_binding/4-fun-0-'/7 2 0.00 0 [ 0.00]
elixir_rewrite:inline/3 2 0.00 0 [ 0.00]
elixir_rewrite:rewrite/5 2 0.00 0 [ 0.00]
'Elixir.GenServer':whereis/1 1 0.00 0 [ 0.00]
'Elixir.Ch.RowBinary':decode_rows/1 1 0.00 0 [ 0.00]
'Elixir.Ch.RowBinary':decode_types/1 2 0.00 0 [ 0.00]
'Elixir.Ch.RowBinary':decode_types/3 2 0.00 0 [ 0.00]
'Elixir.Ch.RowBinary':decoding_type/1 1 0.00 0 [ 0.00]
'Elixir.Ch.RowBinary':skip_names/3 2 0.00 0 [ 0.00]
erts_internal:map_next/3 6 0.00 0 [ 0.00]
gen:call/4 1 0.00 0 [ 0.00]
gen:do_for_proc/2 1 0.00 0 [ 0.00]
gen:'-call/4-fun-0-'/4 1 0.00 0 [ 0.00]
elixir_quote:linify/3 2 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':encode/4 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':encode_body/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':encode_headers/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':encode_request_line/2 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':'validate_header_name!'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':'validate_header_value!'/2 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':'validate_target!'/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Request':'validate_target!'/2 3 0.00 0 [ 0.00]
inet_tcp:send/2 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':add_body/3 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':add_body_to_buffer/2 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':add_content_length_or_transfer_encoding/2 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':add_default_headers/2 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':add_trailing_headers/3 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':enqueue_request/2 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':get_private/2 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':lower_header_keys/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':new_request/4 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':next_request/3 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-lower_header_keys/1-fun-0-'/2 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-17-'/3 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-16-'/3 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-15-'/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-19-'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-18-'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-5-'/1 3 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-4-'/1 3 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-3-'/1 3 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-13-'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode_body/5-fun-12-'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode/4-fun-2-'/2 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-decode/4-fun-1-'/2 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-collapse_body_buffer/2-fun-1-'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-collapse_body_buffer/2-fun-0-'/1 4 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-add_content_length_or_transfer_encoding/2-fun-0-'/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-add_body_to_buffer/2-fun-1-'/2 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1':'-add_body_to_buffer/2-fun-0-'/2 5 0.00 0 [ 0.00]
'Elixir.Mint.Core.Util':maybe_concat/2 5 0.00 0 [ 0.00]
'Elixir.Mint.Core.Util':put_new_header/3 2 0.00 0 [ 0.00]
'Elixir.Mint.Core.Util':put_new_header_lazy/3 1 0.00 0 [ 0.00]
'Elixir.Mint.Core.Util':remove_unallowed_trailing_headers/1 1 0.00 0 [ 0.00]
'Elixir.URI':'char_reserved?'/1 2 0.00 0 [ 0.00]
'Elixir.URI':'char_unescaped?'/1 2 0.00 0 [ 0.00]
'Elixir.URI':default_port/1 1 0.00 0 [ 0.00]
'Elixir.URI':encode_query/1 1 0.00 0 [ 0.00]
'Elixir.URI':encode_query/2 1 0.00 0 [ 0.00]
elixir_env:trace/2 3 0.00 0 [ 0.00]
elixir_env:with_vars/2 2 0.00 0 [ 0.00]
elixir_env:env_to_ex/1 2 0.00 0 [ 0.00]
elixir_env:reset_read/2 1 0.00 0 [ 0.00]
elixir_env:prepare_write/1 2 0.00 0 [ 0.00]
elixir_env:close_write/2 2 0.00 0 [ 0.00]
elixir_env:'-trace/2-lc$^0/1-0-'/3 3 0.00 0 [ 0.00]
'Elixir.Code':eval_quoted_with_env/3 2 0.00 0 [ 0.00]
'Elixir.Code':eval_quoted_with_env/4 2 0.00 0 [ 0.00]
'Elixir.Code':eval_verify/2 2 0.00 0 [ 0.00]
elixir_erl_pass:translate_args/3 2 0.00 0 [ 0.00]
elixir_erl_pass:'-translate_args/3-fun-0-'/3 2 0.00 0 [ 0.00]
'Elixir.Process':get/1 1 0.00 0 [ 0.00]
'Elixir.Process':get/2 1 0.00 0 [ 0.00]
'Elixir.Enum':map/2 1 0.00 0 [ 0.00]
'Elixir.Enum':map_intersperse/3 1 0.00 0 [ 0.00]
'Elixir.Enum':map_intersperse_list/3 1 0.00 0 [ 0.00]
'Elixir.Enum':map_join/3 1 0.00 0 [ 0.00]
'Elixir.Enum':'member?'/2 1 0.00 0 [ 0.00]
'Elixir.Enum':reduce/3 2 0.00 0 [ 0.00]
'Elixir.Enum':reject/2 1 0.00 0 [ 0.00]
'Elixir.Enum':reject_list/2 1 0.00 0 [ 0.00]
'Elixir.Enum':reverse/1 6 0.00 0 [ 0.00]
'Elixir.Enum':with_index/1 1 0.00 0 [ 0.00]
'Elixir.Enum':with_index/2 1 0.00 0 [ 0.00]
'Elixir.Enum':with_index_list/2 1 0.00 0 [ 0.00]
'Elixir.Enum':'-map/2-lists^map/1-0-'/2 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Query.Ch.Query':encode/3 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Query.Ch.Query':get_header/2 1 0.00 0 [ 0.00]
'Elixir.DBConnection.Query.Ch.Query':query_params/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Response':decode_status_line/1 1 0.00 0 [ 0.00]
elixir_utils:var_context/2 1 0.00 0 [ 0.00]
proplists:get_value/3 2 0.00 0 [ 0.00]
elixir_config:get/2 1 0.00 0 [ 0.00]
'Elixir.String.Chars':'impl_for!'/1 1 0.00 0 [ 0.00]
'Elixir.String.Chars':impl_for/1 1 0.00 0 [ 0.00]
queue:out/1 1 0.00 0 [ 0.00]
'Elixir.Mint.Core.Transport.TCP':send/2 1 0.00 0 [ 0.00]
gen_server:call/3 1 0.00 0 [ 0.00]
'Elixir.Map':get/3 6 0.00 0 [ 0.00]
eval_bits:expr_grp/4 1 0.00 0 [ 0.00]
eval_bits:expr_grp/5 1 0.00 0 [ 0.00]
eval_bits:expr_grp1/6 2 0.00 0 [ 0.00]
eval_bits:create_binary/2 2 0.00 0 [ 0.00]
eval_bits:eval_field/5 1 0.00 0 [ 0.00]
eval_bits:'-eval_field/5-fun-3-'/1 1 0.00 0 [ 0.00]
maps:find/2 1 0.00 0 [ 0.00]
maps:from_list/1 4 0.00 0 [ 0.00]
maps:fold/3 2 0.00 0 [ 0.00]
maps:fold_1/3 4 0.00 0 [ 0.00]
maps:iterator/1 6 0.00 0 [ 0.00]
maps:'-merge_with/3-fun-0-'/4 4 0.00 0 [ 0.00]
elixir_expand:expand_arg/3 2 0.00 0 [ 0.00]
elixir_expand:mapfold/4 2 0.00 0 [ 0.00]
elixir_expand:mapfold/5 4 0.00 0 [ 0.00]
elixir_expand:var_used/4 1 0.00 0 [ 0.00]
elixir_expand:maybe_warn_underscored_var_access/4 1 0.00 0 [ 0.00]
elixir_expand:should_warn/1 1 0.00 0 [ 0.00]
elixir_expand:assert_no_clauses/4 2 0.00 0 [ 0.00]
elixir_expand:assert_arg_with_no_clauses/4 1 0.00 0 [ 0.00]
elixir_expand:attach_context_module/3 2 0.00 0 [ 0.00]
elixir_expand:rewrite/7 2 0.00 0 [ 0.00]
elixir_expand:maybe_warn_comparison/3 2 0.00 0 [ 0.00]
elixir_expand:'-expand/3-fun-3-'/8 2 0.00 0 [ 0.00]
'Elixir.Ch.Types':decode/1 1 0.00 0 [ 0.00]
'Elixir.List':first/1 1 0.00 0 [ 0.00]
'Elixir.List':first/2 1 0.00 0 [ 0.00]
'Elixir.List':keyfind/3 2 0.00 0 [ 0.00]
'Elixir.List':keyfind/4 2 0.00 0 [ 0.00]
'Elixir.List':'keymember?'/3 3 0.00 0 [ 0.00]
erlang:binary_to_atom/2 1 0.00 0 [ 0.00]
erlang:binary_to_list/1 1 0.00 0 [ 0.00]
erlang:erase/1 2 0.00 0 [ 0.00]
erlang:integer_to_binary/1 2 0.00 0 [ 0.00]
erlang:integer_to_list/1 2 0.00 0 [ 0.00]
erlang:iolist_size/1 1 0.00 0 [ 0.00]
erlang:make_ref/0 2 0.00 0 [ 0.00]
erlang:monotonic_time/0 2 0.00 0 [ 0.00]
erlang:monotonic_time/1 1 0.00 0 [ 0.00]
erlang:put/2 2 0.00 0 [ 0.00]
erlang:split_binary/2 5 0.00 0 [ 0.00]
erlang:whereis/1 1 0.00 0 [ 0.00]
erlang:setelement/3 6 0.00 0 [ 0.00]
erlang:port_command/3 1 0.00 0 [ 0.00]
erlang:min/2 1 0.00 0 [ 0.00]
erlang:'++'/2 5 0.00 0 [ 0.00]
'Elixir.IEx.Evaluator':maybe_expand/2 2 0.00 0 [ 0.00]
'Elixir.IEx.Evaluator':'-eval_expr_by_expr/3-fun-0-'/2 2 0.00 0 [ 0.00]
'Elixir.Integer':count_digits/2 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':connection_header/1 1 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':ignore_until_crlf/1 5 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':split_into_downcase_tokens/1 2 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':token_list_downcase/1 2 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':token_list_downcase/2 2 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':token_list_sep_downcase/2 2 0.00 0 [ 0.00]
'Elixir.Mint.HTTP1.Parse':transfer_encoding_header/1 1 0.00 0 [ 0.00]
'Elixir.Ch.Connection':handle_responses/3 11 0.01 1 [ 0.09]
'Elixir.Ch.Connection':path/3 1 0.01 1 [ 1.00]
'Elixir.Ch.Connection':recv/4 5 0.01 1 [ 0.20]
erl_anno:set/3 3 0.01 1 [ 0.33]
elixir_erl:get_ann/3 7 0.01 1 [ 0.14]
elixir_erl:elixir_to_erl/2 3 0.01 1 [ 0.33]
prim_inet:ctl_cmd/3 5 0.01 1 [ 0.20]
elixir_aliases:expand/3 1 0.01 1 [ 1.00]
elixir_dispatch:dispatch_require/7 2 0.01 1 [ 0.50]
elixir_dispatch:expand_require/6 2 0.01 1 [ 0.50]
elixir_dispatch:get_deprecations/1 2 0.01 1 [ 0.50]
elixir_dispatch:check_deprecated/6 2 0.01 1 [ 0.50]
elixir:eval_quoted/4 2 0.01 1 [ 0.50]
elixir:'-eval_external_handler/1-fun-2-'/4 2 0.01 1 [ 0.50]
gen_tcp:send/2 1 0.01 1 [ 1.00]
erl_eval:ret_expr/3 8 0.01 1 [ 0.13]
erl_eval:expr_list/7 4 0.01 1 [ 0.25]
lists:keymember/3 10 0.01 1 [ 0.10]
'Elixir.DBConnection.Holder':checkout/3 1 0.01 1 [ 1.00]
'Elixir.DBConnection.Holder':holder_apply/4 1 0.01 1 [ 1.00]
'Elixir.DBConnection':execute/4 1 0.01 1 [ 1.00]
'Elixir.DBConnection':run/6 1 0.01 1 [ 1.00]
'Elixir.Ch.Query':build/2 1 0.01 1 [ 1.00]
'Elixir.Ch.Query':extract_command/1 1 0.01 1 [ 1.00]
elixir_erl_var:to_erl_var/1 2 0.01 1 [ 0.50]
elixir_erl_var:dump_binding/4 2 0.01 1 [ 0.50]
inet_db:lookup_socket/1 6 0.01 1 [ 0.17]
elixir_quote:'-do_linify/3-lc$^0/1-0-'/3 12 0.01 1 [ 0.08]
elixir_quote:'-linify/3-fun-0-'/2 6 0.01 1 [ 0.17]
code:ensure_loaded/1 2 0.01 1 [ 0.50]
'Elixir.Mint.HTTP1.Request':'-encode_headers/1-fun-0-'/2 4 0.01 1 [ 0.25]
inet_tcp:recv/3 5 0.01 1 [ 0.20]
'Elixir.Mint.HTTP1':collapse_body_buffer/2 5 0.01 1 [ 0.20]
'Elixir.Mint.HTTP1':decode_trailer_headers/4 1 0.01 1 [ 1.00]
'Elixir.Mint.HTTP1':default_host_header/1 1 0.01 1 [ 1.00]
'Elixir.Mint.HTTP1':get_private/3 6 0.01 1 [ 0.17]
'Elixir.Mint.HTTP1':message_body/1 5 0.01 1 [ 0.20]
'Elixir.Mint.HTTP1':pop_request/1 1 0.01 1 [ 1.00]
'Elixir.Mint.HTTP1':request_done/1 1 0.01 1 [ 1.00]
'Elixir.Code':'-eval_verify/2-fun-0-'/2 2 0.01 1 [ 0.50]
elixir_erl_pass:translate_remote/5 2 0.01 1 [ 0.50]
'Elixir.Mint.HTTP1.Response':header_name/1 10 0.01 1 [ 0.10]
'Elixir.String.Chars':to_string/1 1 0.01 1 [ 1.00]
'Elixir.Mint.Core.Transport.TCP':recv/3 5 0.01 1 [ 0.20]
'Elixir.Mint.Core.Transport.TCP':wrap_err/1 6 0.01 1 [ 0.17]
maps:merge_with/3 4 0.01 1 [ 0.25]
maps:merge_with_1/4 8 0.01 1 [ 0.13]
maps:next/1 12 0.01 1 [ 0.08]
elixir_expand:expand_aliases/4 1 0.01 1 [ 1.00]
erlang:atom_to_binary/1 6 0.01 1 [ 0.17]
erlang:atom_to_binary/2 6 0.01 1 [ 0.17]
erlang:atom_to_list/1 2 0.01 1 [ 0.50]
erlang:binary_to_integer/2 5 0.01 1 [ 0.20]
erlang:function_exported/3 2 0.01 1 [ 0.50]
erlang:list_to_binary/1 1 0.01 1 [ 1.00]
erlang:module_loaded/1 2 0.01 1 [ 0.50]
erlang:port_control/3 5 0.01 1 [ 0.20]
erlang:port_get_data/1 6 0.01 1 [ 0.17]
'Elixir.IEx.Evaluator':eval_expr_by_expr/3 2 0.01 1 [ 0.50]
'Elixir.Integer':count_digits_nosign/3 21 0.01 1 [ 0.05]
'Elixir.Module.ParallelChecker':verify/1 2 0.01 1 [ 0.50]
'Elixir.Module.ParallelChecker':'-verify/1-after$^0/0-0-'/1 2 0.01 1 [ 0.50]
'Elixir.Keyword':get/3 16 0.02 2 [ 0.13]
prim_inet:async_recv/3 5 0.02 2 [ 0.40]
elixir_aliases:do_concat/2 2 0.02 2 [ 1.00]
elixir:quoted_to_erl/4 2 0.02 2 [ 1.00]
gen_tcp:recv/3 5 0.02 2 [ 0.40]
lists:keyfind/3 28 0.02 2 [ 0.07]
'Elixir.DBConnection.Holder':checkout_call/5 1 0.02 2 [ 2.00]
'Elixir.Mint.HTTP1':recv/3 5 0.02 2 [ 0.40]
'Elixir.Mint.HTTP1':request/5 1 0.02 2 [ 2.00]
elixir_erl_pass:translate/3 5 0.02 2 [ 0.40]
'Elixir.Enum':'-reduce/3-lists^foldl/2-0-'/3 9 0.02 2 [ 0.22]
'Elixir.Mint.HTTP1.Response':decode_header/1 12 0.02 2 [ 0.17]
ordsets:is_element/2 7 0.02 2 [ 0.29]
ets:give_away/3 1 0.02 2 [ 2.00]
elixir_expand:expand_remote/8 2 0.02 2 [ 1.00]
erlang:system_info/1 2 0.02 2 [ 1.00]
'Elixir.Integer':parse/2 5 0.02 2 [ 0.40]
prim_inet:recv0/3 5 0.02 3 [ 0.60]
elixir:eval_forms/4 2 0.02 3 [ 1.50]
'Elixir.DBConnection':checkout/3 1 0.02 3 [ 3.00]
elixir_quote:do_linify/3 21 0.02 3 [ 0.14]
'Elixir.Mint.HTTP1.Request':'-validate_header_name!/1-lc$^0/1-0-'/2 51 0.02 3 [ 0.06]
'Elixir.Mint.HTTP1':decode/4 7 0.02 3 [ 0.43]
'Elixir.Mint.HTTP1':decode_headers/5 11 0.02 3 [ 0.27]
'Elixir.Mint.HTTP1':handle_data/2 5 0.02 3 [ 0.60]
'Elixir.Mint.Core.Util':downcase_ascii/1 11 0.02 3 [ 0.27]
ets:lookup/2 3 0.02 3 [ 1.00]
erlang:cancel_timer/2 1 0.02 3 [ 3.00]
erlang:monitor/2 2 0.02 3 [ 1.50]
'Elixir.Mint.HTTP1.Parse':token_downcase/3 19 0.02 3 [ 0.16]
gen:do_call/4 1 0.03 4 [ 4.00]
'Elixir.Mint.HTTP1.Request':'-validate_header_value!/2-lc$^0/1-0-'/3 56 0.03 4 [ 0.07]
'Elixir.Mint.HTTP1':store_header/3 10 0.03 4 [ 0.40]
elixir_expand:expand/3 5 0.03 4 [ 0.80]
erlang:list_to_atom/1 3 0.03 4 [ 1.33]
erlang:start_timer/4 1 0.03 4 [ 4.00]
erl_eval:expr/6 8 0.04 5 [ 0.63]
elixir_erl_var:load_binding/6 4 0.04 5 [ 1.25]
eval_bits:'-eval_field/5-lc$^2/1-2-'/1 41 0.04 5 [ 0.12]
erlang:decode_packet/3 13 0.04 5 [ 0.38]
erlang:demonitor/2 2 0.04 5 [ 2.50]
erlang:send/2 1 0.05 6 [ 6.00]
'Elixir.Mint.HTTP1':decode_body/5 23 0.06 7 [ 0.30]
ets:update_element/3 3 0.07 9 [ 3.00]
'Elixir.Map':'update!'/3 56 0.10 12 [ 0.21]
'Elixir.Mint.Core.Util':downcase_ascii_char/1 202 0.17 21 [ 0.10]
'Elixir.Mint.Core.Util':'-downcase_ascii/1-lbc$^0/2-0-'/2 196 0.20 24 [ 0.12]
erts_internal:port_command/3 1 0.26 32 [ 32.00]
'Elixir.DBConnection.Query.Ch.Query':decode/3 1 0.56 68 [ 68.00]
erlang:iolist_to_binary/1 7 0.66 80 [ 11.43]
erts_internal:port_control/3 5 0.97 118 [ 23.60]
lists:reverse/2 4 1.16 141 [ 35.25]
lists:reverse/1 40013 28.27 3432 [ 0.09]
'Elixir.Ch.RowBinary':decode_rows/5 80000 65.94 8004 [ 0.10]
------------------------------------------------------------------------- ------ ------- ----- [----------]
Total: 121648 100.00% 12138 [ 0.10]
If you provide a reproducible example, I'll look into what is causing the slow down.
from ch.
Related Issues (15)
- finalise Ch.stream
- Can't cast `SimpleAggregateFunction(groupArrayArray, Array(DateTime('UTC')))` HOT 4
- faster invalid utf8 escaping
- Possible memory leak when driver fails to connect due to failed auth HOT 3
- QUESTION: do you recommend using this package or your fork of clickhousex? HOT 2
- Better error/support message for standard Decimal type usage HOT 4
- raise on UNION with OFFSET / LIMIT
- use RowBinaryWithNamesAndTypes for better error messages
- check how much (if any) slowdown comes from Ecto.Type casting, dumping, loading
- add timezones in query params caveat + non-utc server timezone
- table of contents in readme HOT 1
- Ideas - Feel free to post ideas. HOT 5
- mix ecto.ch.schema fails for columns with type `AggregateFunction` HOT 30
- maybe trim newlines in SQL when RowBinary is used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ch.