Repository navigation
ISSUES-2973 support nested json struct for visitParamExtractRaw - #2974
Conversation
|
Take the best result of the three runs. Compile Parameters:cmake .. -DCMAKE_CXX_COMPILER=`which g++-8 ` -DCMAKE_C_COMPILER="`which gcc-8`" -DENABLE_TESTS=0 -DUSE_UNWIND=0 -DENABLE_CLICKHOUSE_COMPRESSOR=0 -DENABLE_MONGODB=1 -DENABLE_JEMALLOC=0 -DCMAKE_BUILD_TYPE=ReleaseBefore[
{
"hostname": "i-2okyk0c6",
"main_metric": "max_rows_per_second",
"num_cores": 16,
"num_threads": 16,
"parameters": {
"param": ["'{"myparam":"test_string"}'", "'{"myparam":{"nested_1":"test_string","nested_2":"test_2"}}'", "'{"myparam":{"nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2"}}'"]
},
"ram": 33736384512,
"runs": [
{
"max_rows_per_second": 21752173.000000,
"parameters": {
"param": "'{"myparam":"test_string"}'"
},
"query": "SELECT count() FROM system.numbers WHERE NOT ignore(visitParamExtractRaw(materialize('{"myparam":"test_string"}'), 'myparam'))"
},
{
"max_rows_per_second": 7467469.000000,
"parameters": {
"param": "'{"myparam":{"nested_1":"test_string","nested_2":"test_2"}}'"
},
"query": "SELECT count() FROM system.numbers WHERE NOT ignore(visitParamExtractRaw(materialize('{"myparam":{"nested_1":"test_string","nested_2":"test_2"}}'), 'myparam'))"
},
{
"max_rows_per_second": 1936649.000000,
"parameters": {
"param": "'{"myparam":{"nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2"}}'"
},
"query": "SELECT count() FROM system.numbers WHERE NOT ignore(visitParamExtractRaw(materialize('{"myparam":{"nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2"}}'), 'myparam'))"
}
],
"server_version": "18.10.3",
"test_name": "visit_param_extract_raw",
"time": "2018-08-31 15:18:16"
}
]After[
{
"hostname": "i-2okyk0c6",
"main_metric": "max_rows_per_second",
"num_cores": 16,
"num_threads": 16,
"parameters": {
"param": ["'{"myparam":"test_string"}'", "'{"myparam":{"nested_1":"test_string","nested_2":"test_2"}}'", "'{"myparam":{"nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2"}}'"]
},
"ram": 33736384512,
"runs": [
{
"max_rows_per_second": 17394195.000000,
"parameters": {
"param": "'{"myparam":"test_string"}'"
},
"query": "SELECT count() FROM system.numbers WHERE NOT ignore(visitParamExtractRaw(materialize('{"myparam":"test_string"}'), 'myparam'))"
},
{
"max_rows_per_second": 7092361.000000,
"parameters": {
"param": "'{"myparam":{"nested_1":"test_string","nested_2":"test_2"}}'"
},
"query": "SELECT count() FROM system.numbers WHERE NOT ignore(visitParamExtractRaw(materialize('{"myparam":{"nested_1":"test_string","nested_2":"test_2"}}'), 'myparam'))"
},
{
"max_rows_per_second": 2552266.000000,
"parameters": {
"param": "'{"myparam":{"nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2"}}'"
},
"query": "SELECT count() FROM system.numbers WHERE NOT ignore(visitParamExtractRaw(materialize('{"myparam":{"nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2","nested_1":"test_string","nested_2":"test_2"}}'), 'myparam'))"
}
],
"server_version": "18.10.3",
"test_name": "visit_param_extract_raw",
"time": "2018-08-31 15:05:25"
}
] |
|
Thank you! PS. The performance test you quote is incorrect because (it's obvious because otherwise you cannot get 2+ billion rows/sec. on single core.) To be sure, you can transform a string to non-constant with
|
| res_data.push_back(*pos); | ||
| static void extract(const UInt8 * pos, const UInt8 * end, ColumnString::Chars_t & res_data) | ||
| { | ||
| std::vector<char> expect_end; |
There was a problem hiding this comment.
It will lead to allocation/deallocation inside a loop.
We can use PODArray with AllocatorWithStackMemory with for example, 64 bytes of automatic memory.
| struct ExtractRaw | ||
| { | ||
| static void extract(const UInt8 * pos, const UInt8 * end, ColumnString::Chars_t & res_data) | ||
| inline static void skipAfterQuotationIfNeed(const UInt8 *& pos, const UInt8 * end, ColumnString::Chars_t & res_data) |
There was a problem hiding this comment.
It would be more clear if we just put this code where it is called.
PS. I think, it should be named skipAfterBackslashIfNeed.
| @@ -0,0 +1,31 @@ | |||
| <test> | |||
There was a problem hiding this comment.
materialize should be added.
746e6e9 to
a1f2b9a
Compare
|
Done and update #2974 (comment) |
|
Ok. |
0.18.0 and 0.19.0 made `-ftime-trace` uncacheable (mozilla/sccache#2834), which 27 CI build types pass through -DENABLE_BUILD_PROFILING=1, so CI stayed on 0.17.0. 0.20.0 hashes the flag again and writes no trace on a cache hit (mozilla/sccache#2956). It also leaves CARGO_TARGET_DIR and CARGO_BUILD_* out of Rust keys (ClickHouse#3050) and hashes the C/C++ input file name (ClickHouse#2974). Measured locally with CI's cmake flags and a local disk cache, second build from a fresh build directory at the same path: - amd_binary clickhouse-bundle: 1562 s cold, 147 s warm; C/C++ 17715 of 17717 hits (the 2 misses are openldap's generated version files with __DATE__/__TIME__), Rust 603 of 603; no hit wrote a time trace. - amd_asan_ubsan dbms: 1934 s cold, 95 s warm; C/C++ 16237 of 16239, Rust 529 of 529. - PR-build environment (READ_ONLY, anonymous S3): the server starts, a miss compiles, the write is refused, warn_on_low_sccache_hit_rate parses the stats. 0.20.0 additionally counts an anonymous 403 on a missing key as a read error (ClickHouse#2967); it is still a miss. 0.20.0 treats `--embed-dir` as uncacheable, so the 4 _jieba sources (6.9 s of compile) are always compiled. 0.20.0 does not read 0.17.0 entries: every build type is cold once after this lands. Related: ClickHouse#127827 Co-Authored-By: Claude Opus 5.5 <[email protected]>
0.18.0 and 0.19.0 made `-ftime-trace` uncacheable (mozilla/sccache#2834), which 27 CI build types pass through -DENABLE_BUILD_PROFILING=1, so CI stayed on 0.17.0. 0.20.0 hashes the flag again and writes no trace on a cache hit (mozilla/sccache#2956). It also leaves CARGO_TARGET_DIR and CARGO_BUILD_* out of Rust keys (ClickHouse#3050) and hashes the C/C++ input file name (ClickHouse#2974). Measured locally with CI's cmake flags and a local disk cache, second build from a fresh build directory at the same path: - amd_binary clickhouse-bundle: 1562 s cold, 147 s warm; C/C++ 17715 of 17717 hits (the 2 misses are openldap's generated version files with __DATE__/__TIME__), Rust 603 of 603; no hit wrote a time trace. - amd_asan_ubsan dbms: 1934 s cold, 95 s warm; C/C++ 16237 of 16239, Rust 529 of 529. - PR-build environment (READ_ONLY, anonymous S3): the server starts, a miss compiles, the write is refused, warn_on_low_sccache_hit_rate parses the stats. 0.20.0 additionally counts an anonymous 403 on a missing key as a read error (ClickHouse#2967); it is still a miss. 0.20.0 treats `--embed-dir` as uncacheable, so the 4 _jieba sources (6.9 s of compile) are always compiled. 0.20.0 does not read 0.17.0 entries: every build type is cold once after this lands. Related: ClickHouse#127827 Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2973
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en