Skip to content

Instantly share code, notes, and snippets.

Alexander Karpinsky homm

  • Uploadcare
  • Saint Petersburg
Block or report user

Report or block homm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View yieder.py
import time
import collections
import functools
import itertools
TIMES = 200
N = 200
M = 10
View response to Lilliput.md

First of all, never trust a benchmark which you can't reproduce. You can't reproduce lilliput-bench for the obvious reason: there are no test images. And since this is the benchmark which tests graphics codecs, results heavily depend on exact files modes and even content. So the first, what you need, is create some test data.

Now, with the installation instruction, we can start. This is my results on i5-4430 CPU (the same Haswell architecture as in the original test) and Ubuntu 18.04.1 LTS, running on bare metal. Pillow-SIMD version 5.2.0.post0 compiled with AVX2 running on Python 2.7.

JPEG 1920x1080 header read:  1920x1080,  avg: 0.036190 ms  min: 0.033855 ms  max: 7.170200 ms
PNG 1920x1080 header read:   1920x1080,  avg: 0.040357 ms  min: 0.038862 ms  max: 0.266075 ms
WEBP 1920x1080 header read:  1920x1080,  avg: 0.678090 ms  min: 0.149965 ms  
View ipp_resize_mt.cpp
/*
// Copyright 2012 2016 Intel Corporation All Rights Reserved.
//
// The source code, information and material ("Material") contained herein is
// owned by Intel Corporation or its suppliers or licensors, and title
// to such Material remains with Intel Corporation or its suppliers or
// licensors. The Material contains proprietary information of Intel
// or its suppliers and licensors. The Material is protected by worldwide
// copyright laws and treaty provisions. No part of the Material may be used,
// copied, reproduced, modified, published, uploaded, posted, transmitted,
View vips_bench.py
#!/usr/bin/python
import sys
import time
from PIL import Image, ImageFilter, PILLOW_VERSION
class Timer:
def __init__(self, name):
self.name = name
View getDevicePixelRatio.js
window.getDevicePixelRatio = function () {
var ratio = 1;
// To account for zoom, change to use deviceXDPI instead of systemXDPI
if (window.screen.systemXDPI !== undefined && window.screen.logicalXDPI !== undefined && window.screen.systemXDPI > window.screen.logicalXDPI) {
// Only allow for values > 1
ratio = window.screen.systemXDPI / window.screen.logicalXDPI;
}
else if (window.devicePixelRatio !== undefined) {
ratio = window.devicePixelRatio;
}
View tornado_memtest.py
from __future__ import print_function
import gc
import traceback
import types
from tornado import web, ioloop, gen
from tornado.http1connection import HTTP1ServerConnection
def find_circular_references(garbage=None):
View BitmapScaleBench.cpp
/*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBlurMask.h"
#include "SkCanvas.h"
View recursive_scandir.py
from scandir import scandir
def recursive_scandir(dir):
stack = []
it = scandir(dir)
while it or stack:
it = it or stack.pop()
try:
item = next(it)
View memory.py
#!/usr/bin/env python
from __future__ import print_function
import sys
import gc
from scandir import scandir
def recursive_scandir(dir):
stack = []
View canvas.html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="c"></canvas>
<style type="text/css">
You can’t perform that action at this time.