This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
*/ | |
public class SparkJdbcMain { | |
public static void main(String[] args) throws SQLException, ClassNotFoundException { | |
SparkSession spark = SparkSession | |
.builder() | |
.appName("spark-jdbc-test") | |
.enableHiveSupport() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"math/rand" | |
"github.com/RoaringBitmap/roaring" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"instance_id" : 1, | |
"data_dir" : "/data1/clickhouse", | |
"log_dir": "/data/logs/clickhouse-server", | |
"tcp_port": 9000, | |
"http_port": 8123, | |
"interserver_http_port": 9009, | |
"max_concurrent_queries": 500, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ClickHouse的top工具,实时查看运行的SQL,运行了多久,来自哪里 | |
# 注意事项:查询SQL的时候,要把客户端里的空格去掉,要判断是否为空,否则影响while read的读取位置 | |
# TODO:清屏很暴力,鼠标滚动就不见了 limit限制 | |
password="xxxx" | |
ls /usr/bin/clickhouse-client >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::{Mutex, Arc}; | |
use std::env; | |
use std::time::Instant; | |
use std::sync::mpsc::channel; | |
use threadpool::ThreadPool; | |
// test memory bandwidth | |
fn main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::{Mutex, Arc, Barrier}; | |
use std::env; | |
use std::time::Instant; | |
use std::sync::mpsc::channel; | |
use std::ptr::NonNull; | |
use std::ptr; | |
use std::alloc::Layout; | |
use std::mem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2020-2021 The Datafuse Authors. | |
// | |
// SPDX-License-Identifier: Apache-2.0. | |
mod modulo; | |
use std::marker::PhantomData; | |
use crate::prelude::*; | |
use crate::DFNumericType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Licensed to the Apache Software Foundation (ASF) under one | |
// or more contributor license agreements. See the NOTICE file | |
// distributed with this work for additional information | |
// regarding copyright ownership. The ASF licenses this file | |
// to you under the Apache License, Version 2.0 (the | |
// "License"); you may not use this file except in compliance | |
// with the License. You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOF > bench.sql | |
SELECT avg(number) FROM numbers_mt(100000000000) | |
SELECT sum(number) FROM numbers_mt(100000000000) | |
SELECT min(number) FROM numbers_mt(100000000000) | |
SELECT max(number) FROM numbers_mt(100000000000) | |
SELECT count(number) FROM numbers_mt(100000000000) | |
SELECT sum(number+number+number) FROM numbers_mt(100000000000) | |
SELECT sum(number) / count(number) FROM numbers_mt(100000000000) |