Run an array of functions in parallel
install
npm install run-parallel
usage
parallel(tasks, [callback])
Run the
tasks
array of functions in parallel, without waiting until the previous function has completed. If any of the functions pass an error to its callback, the maincallback
is immediately called with the value of the error. Once thetasks
have completed, the results are passed to the finalcallback
as an arr
Webpagetest: Test a website’s performance
Run a free website speed test from multiple locations around the globe using real browsers (IE and Chrome) and at real consumer connection speeds. You can run simple tests or perform advanced testing including multi-step transactions, video capture, content blocking and much more. Your results will provide rich diagnostic information including resource loading waterfall charts, Page Speed optimization checks and suggestions for improvements.
1M rows/s from Postgres to Python
asyncpg is a new fully-featured open-source Python client library for PostgreSQL. It is built specifically for asyncio and Python 3.5
async
/await
. asyncpg is the fastest driver among common Python, NodeJS and Go implementations.
python-redis-lock
Lock context manager implemented via redis SETNX/BLPOP
.. You would write your functions like this:
from django.core.cache import cache def function(): val = cache.get(key) if val: return val else: with cache.lock(key): val = cache.get(key) if val: return val else: # DO EXPENSIVE WORK val = ... cache.set(key, value) return val