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
#include "duckdb.hpp" | |
#include "duckdb/main/appender.hpp" | |
using namespace duckdb; | |
using namespace std; | |
// clang++ -std=c++11 -Isrc/include -L build/release/src -lduckdb benchmark.cpp -o test_benchmark && rm -rf test.db* && time LD_LIBRARY_PATH=build/release/src ./test_benchmark | |
int main(int argc, char *argv[]) { |
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
// rename chain | |
// c1 starts a transaction now | |
REQUIRE_NO_FAIL(c1.Query("BEGIN TRANSACTION")); | |
// rename in con, c1 should still see "tbl1" | |
REQUIRE_NO_FAIL(con.Query("ALTER TABLE tbl1 RENAME TO tbl2")); | |
// c2 starts a transaction now | |
REQUIRE_NO_FAIL(c2.Query("BEGIN TRANSACTION")); |
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
#include <cstdlib> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
bool is_doomsayer(int nr) { | |
return nr < 22; | |
} |
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
#include <cstdint> | |
#include <cstdio> | |
#include <chrono> | |
#include <iostream> | |
#include <string.h> | |
#include <memory> | |
#include <cmath> | |
#include <vector> |
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
Tests run on three columns (a, b, c) of 100M 4-byte integers, randomly generated between the values 0-100 | |
--------------------------------- | |
SELECT SUM(a+b) | |
FROM table; | |
--------------------------------- | |
JIT | |
57ms | |
Vectorized | |
65ms | |
--------------------------------- |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import numpy | |
import sys | |
import subprocess | |
import shutil | |
import platform |
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
import sys, time, numpy, os | |
if len(sys.argv) < 2: | |
print("Usage: python3 benchmark-mvcc [hyper|monetdb|sqlite|duckdb]") | |
exit(1) | |
try: | |
os.remove('test.db') | |
except: | |
pass |
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
import sqlite3 | |
import os | |
import time | |
# showcase of a bug in the python version of sqlite3 | |
# starting an insert with a comment will result in much slower performance and rowcount not being set properly | |
def test(with_comment): | |
os.system('rm -f test.db') | |
con = sqlite3.connect('test.db') |
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
['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', 'she', 'her', 'hers', 'herself', 'it', 'its', 'itself', 'they', 'them', 'their', 'theirs', 'themselves', 'what', 'which', 'who', 'whom', 'this', 'that', 'these', 'those', 'am', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had', 'having', 'do', 'does', 'did', 'doing', 'a', 'an', 'the', 'and', 'but', 'if', 'or', 'because', 'as', 'until', 'while', 'of', 'at', 'by', 'for', 'with', 'about', 'against', 'between', 'into', 'through', 'during', 'before', 'after', 'above', 'below', 'to', 'from', 'up', 'down', 'in', 'out', 'on', 'off', 'over', 'under', 'again', 'further', 'then', 'once', 'here', 'there', 'when', 'where', 'why', 'how', 'all', 'any', 'both', 'each', 'few', 'more', 'most', 'other', 'some', 'such', 'no', 'nor', 'not', 'only', 'own', 'same', 'so', 'than', 'too', 'very', 's', 't', 'can', 'will', 'just', 'don', 'should', 'now', 'd', 'll', 'm', 'o', |
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
#!/usr/bin/python | |
import os, time, sys, datetime | |
if len(sys.argv) < 3 or ':' not in sys.argv[2]: | |
print("Usage: scpsync [sourcepath] [dest:destpath] [src?]") | |
exit(1) | |
srcheaders = ['.h', '.c', '.py', '.r', '.hpp', '.cpp', '.mal', '.sql', '.malC','.php', '.html'] | |
source = sys.argv[1] |