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 | |
import datetime | |
import fnmatch | |
from functools import partial | |
import gzip | |
import json | |
import os | |
import shutil | |
import socket |
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
FROM ubuntu:14.04 | |
ENV BUCKET your-s3-bucket | |
RUN apt-get update && apt-get install -y wget \ | |
build-essential python-dev \ | |
libssl-dev libffi-dev \ | |
libpcre3-dev \ | |
libmemcached-dev \ | |
libpq-dev \ |
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 | |
import socket | |
import time | |
import psutil | |
PREFIX = [ | |
'server', | |
socket.getfqdn().replace('.', '_'), | |
] |
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
FROM centos:7 | |
ENV VERSION versions/0.9 | |
ENV GO_VERSION 1.4.2 | |
ENV CMAKE_VERSION 3.2.3 | |
ENV PATH=/go/bin:$PATH | |
ENV GOROOT=/go | |
RUN yum install -y git gcc make rpmdevtools mercurial | |
RUN curl -sO https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz && \ |
Making an HTTP request to undefined
is the equivalent of requesting the same page again ('.'
or window.location.href
). The examples below were found in three out of three front-end performance audits we performed for clients at Lincoln Loop over the last two weeks.
Test machine: OS X 10.10.5 w/ 2.4 GHz Intel Core i5
Server:
$ gunicorn -w2 botbot.wsgi:application
Client:
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
#!/bin/bash | |
PYPYVENV="~/db-pypy" | |
CPYVENV="~/db-cpy" | |
virtualenv --python=`which pypy` $PYPYVENV | |
virtualenv $CPYVENV | |
$PYPYVENV/bin/pip install -e git://github.com/django/djangobench.git#egg=djangobench | |
$CPYVENV/bin/pip install -e git://github.com/django/djangobench.git#egg=djangobench |
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
$ manage.py showmigrations | grep "\[" | wc -l | |
85 | |
$ echo "\d" | psql mydb | grep -v sequence | wc -l | |
299 | |
$ time python -m cProfile -s time ./manage.py makemigrations --empty pages | |
Migrations for 'pages': | |
0014_auto_20160107_1356.py: | |
108764127 function calls (108404501 primitive calls) in 264.744 seconds | |
Ordered by: internal time |
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
$ python -m cProfile -s time ./manage.py makemigrations --empty pages | |
Migrations for 'pages': | |
0014_auto_20160107_1519.py: | |
66325365 function calls (65778093 primitive calls) in 157.981 seconds | |
Ordered by: internal time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
306135 10.721 0.000 16.741 0.000 __init__.py:139(__init__) | |
203638 8.801 0.000 14.381 0.000 __init__.py:370(deconstruct) |