Skip to content

Instantly share code, notes, and snippets.

View chdorner's full-sized avatar
🦤

Christof Dorner chdorner

🦤
View GitHub Profile
@chdorner
chdorner / fetch_redirects.py
Created June 6, 2016 15:12
Get destination from a redirecting URL
import requests
urls = []
with open('urls.txt', 'r') as f:
urls = f.readlines()
redirects = {}
def find_destination(url):
@chdorner
chdorner / README.md
Last active June 23, 2023 20:13
SQLAlchemy scan large table in batches

my database had 72k annotations at the time I ran these benchmarks, here's the result:

$ python scripts/batch_bench.py conf/development-app.ini dumb
Memory summary: start
      types |   # objects |   total size
=========== | =========== | ============
       dict |       13852 |     12.46 MB
  frozenset |         349 |     11.85 MB
VM: 327.29Mb