Skip to content

Instantly share code, notes, and snippets.

View memcpy_test.txt
memcpy.S:
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
│ Copyright 2020 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
│ above copyright notice and this permission notice appear in all copies. │
View docs.py
# -*- coding: utf-8 -*-
import logging
import sandbox.sdk2.helpers
import subprocess
import os
from sandbox import sdk2
import sandbox.common.types.resource as ctr
import sandbox.common.types.client as ctc
from sandbox.projects.clickhouse.BaseOnCommitTask.base import NeedToRunDescription
View datetime64.txt
$ clickhouse-client
ClickHouse client version 21.3.1.1.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.3.1 revision 54447.
milovidov-desktop :) SELECT toDateTime(1234567890, 'Europe/Moscow')
SELECT toDateTime(1234567890, 'Europe/Moscow')
Query id: 99607776-8d7a-47f7-a3ca-ed00baa20c08
View main.cpp
#include <cstddef>
#include <cstdint>
#include <vector>
#include <iostream>
#define ALWAYS_INLINE __attribute__((__always_inline__))
namespace
{
View test_minhash.txt
WITH wordShingleMinhashCaseInsensitiveUTF8(body) AS hashes
SELECT DISTINCT body
FROM github_events
WHERE (event_type = 'IssueCommentEvent') AND (action = 'created') AND ((hashes.1) = 245165191482241124)
Query id: 975b45e6-38fe-4ec6-8524-dad348549cac
┌─body───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option. │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
View gist:e2d44da0a1f9bc848529bdd086139d3f
$ ./clickhouse-test start_and
Using queries from 'queries' directory
Using clickhouse-client as client program (expecting unbundled mode)
Connecting to ClickHouse server... OK
Found 1 parallel tests and 0 sequential tests
Running 1 stateless tests.
01526_client_start_and_exit: [ FAIL ] - result differs with reference:
--- /home/milovidov/work/ClickHouse/tests/queries/0_stateless/01526_client_start_and_exit.reference 2020-12-20 08:29:23.986871802 +0300
View compare
Old:
Queries executed: 14.
localhost:9000, queries 14, QPS: 0.455, RPS: 1420830167.754, MiB/s: 8107.538, result RPS: 0.455, result MiB/s: 0.000.
0.000% 2.072 sec.
10.000% 2.085 sec.
20.000% 2.112 sec.
30.000% 2.121 sec.
View uniq
milovidov-desktop :) SELECT abs(uniq(sipHash64(number)) / 10000000 - 1) FROM numbers(10000000)
SELECT abs((uniq(sipHash64(number)) / 10000000) - 1)
FROM numbers(10000000)
Query id: ea428bba-53ff-40c9-848d-5eaa578c52ec
┌─abs(minus(divide(uniq(sipHash64(number)), 10000000), 1))─┐
│ 0.004632100000000028 │
└──────────────────────────────────────────────────────────┘
View gist:d41902b70e4eb3a0e430e5f88a6ba1e4
milovidov@milovidov-desktop:~/work/ClickHouse$ cat stringstream.cpp
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <unistd.h>
#include <stdexcept>
void * operator new(std::size_t size)
{
View clang-bad-optimization.txt
Clang failed to vectorize the following code:
milovidov@milovidov-desktop:~/work/ClickHouse$ cat xors.cpp
#include <cstddef>
#include <vector>
__attribute__((__noinline__))
void xor10arrays(
const char8_t * arr0,
const char8_t * arr1,