Skip to content

Instantly share code, notes, and snippets.

View pomidoroshev's full-sized avatar
🎯
Focusing

Dima Doroshev pomidoroshev

🎯
Focusing
  • Lithuania
View GitHub Profile
▶ for ver in "3.7.1" "3.7.2" "3.7.3" "3.7.4" "3.7.5" "3.8"
do
echo "\nPython $ver"
docker run --rm -v `pwd`:/app python:$ver python /app/bench_2.py
done
Python 3.7.1
# components | join_time (μs) | buffer_time (μs) | concat_time (μs)
-----------------------------------------------------------------------------------------
10 | 3.67 (± 0.07) | 4.1 (± 0.1) | 3.53 (± 0.08)
#! -*- coding: utf-8 -*-
import csv
import io
import itertools
import functools
import math
import sys
import timeit
if sys.version_info < (3,):
@pomidoroshev
pomidoroshev / bench.txt
Created November 16, 2019 08:09
String concatenation benchmark
▶ for ver in "3.7.1" "3.7.2" "3.7.3" "3.7.4" "3.7.5" "3.8"
do
echo "\nPython $ver"
docker run --rm -v `pwd`:/app python:$ver python /app/bench.py
done
Python 3.7.1
# components | join_time (μs) | buffer_time (μs) | concat_time (μs)
-----------------------------------------------------------------------------------------
10 | 2.80 (± 0.10) | 3.3 (± 0.1) | 2.45 (± 0.07)
@pomidoroshev
pomidoroshev / bench.go
Last active May 14, 2018 07:07
BoltDB RAM omnomnom
package main
import (
"log"
"runtime"
"strconv"
bolt "github.com/coreos/bbolt"
)