This file contains hidden or 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::cmp::min; | |
use std::sync::Arc; | |
use std::time::Duration; | |
use arrow::array::{ | |
UInt32Array, UInt64Array, | |
}; | |
use arrow::datatypes::Schema; | |
use arrow_schema::{DataType, Field}; | |
use criterion::{black_box, criterion_group, criterion_main, Criterion}; |
This file contains hidden or 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 python3 | |
import subprocess | |
import sys | |
import os | |
import time | |
import threading | |
from typing import List, Tuple | |
def get_peak_memory_usage(cmd: List[str]) -> Tuple[float, int]: |
This file contains hidden or 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 python3 | |
import sys | |
import subprocess | |
import time | |
import re | |
import os | |
from statistics import mean | |
def parse_sql_file(sql_file): |
This file contains hidden or 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
diff --git a/datafusion/functions-aggregate/src/first_last.rs b/datafusion/functions-aggregate/src/first_last.rs | |
index 52b12bbc3..c10a35109 100644 | |
--- a/datafusion/functions-aggregate/src/first_last.rs | |
+++ b/datafusion/functions-aggregate/src/first_last.rs | |
@@ -569,16 +569,17 @@ where | |
let mut ordering_buf = Vec::with_capacity(self.ordering_req.len()); | |
- for (group_idx, idx) in self | |
- .get_filtered_min_of_each_group( |
This file contains hidden or 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
reverse_StringArray_ascii_str_len_8 | |
time: [83.009 µs 83.298 µs 83.589 µs] | |
change: [-28.405% -27.785% -27.234%] (p = 0.00 < 0.05) | |
Performance has improved. | |
reverse_StringArray_utf8_density_0.8_str_len_8 | |
time: [607.34 µs 609.45 µs 611.81 µs] | |
change: [-1.8690% -1.1893% -0.5427%] (p = 0.00 < 0.05) | |
Change within noise threshold. | |
Found 5 outliers among 100 measurements (5.00%) |
This file contains hidden or 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
# from https://stackoverflow.com/questions/7499767/temporarily-disable-auto-now-auto-now-add | |
# my model | |
class FooBar(models.Model): | |
title = models.CharField(max_length=255) | |
updated_at = models.DateTimeField(auto_now=True, auto_now_add=True) | |
# my tests | |
foo = FooBar.objects.get(pk=1) |
This file contains hidden or 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
# coding=utf-8 | |
# 详细语法说明见 https://www.python.org/dev/peps/pep-0318/#current-syntax | |
# 通过装饰器能够获取到调用函数的参数,函数执行的返回值,能够直接运行所装饰的函数 | |
def checkType(*acceptedType): # 检查传入函数的参数类型 | |
print 'calling checkType with %s'%str(acceptedType) | |
def warpper(fun): ## fun为下一个要执行的函数,可以把fun(fun1(fun2...))看作整体 | |
print fun.__name__ | |
def anotherFun(*calledArgs): ## 最外层函数的参数 此处为 传入a的参数 | |
print calledArgs ## | |
for i,j in zip(acceptedType, calledArgs): |
This file contains hidden or 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
# Show the size of all the directories in the current directory and sort them by size. | |
du -h --max-depth=1 | sort -hr | |
# Find Out Which Process Is Listening Upon a Port | |
netstat -tulpn | |
# find all files containing specific text on Linux | |
grep -rnw '/path/to/somewhere/' -e 'pattern' | |
# log CPU load | |
while true; do uptime >> uptime.log; sleep 1; done |
This file contains hidden or 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 logging, sys | |
class SingleLevelFilter(logging.Filter): | |
def __init__(self, passlevel, reject): | |
self.passlevel = passlevel | |
self.reject = reject | |
def filter(self, record): | |
if self.reject: | |
return (record.levelno != self.passlevel) |
This file contains hidden or 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 logging | |
class LogHandler(object): | |
format = '%(levelname)s %(message)s' | |
files = { | |
'ERROR': 'error.log', | |
'CRITICAL': 'error.log', | |
'WARN': 'warn.log', | |
} | |
def write(self, msg): |
NewerOlder