• Stars
    star
    196
  • Rank 197,400 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💂🏻 Django package that provides hints to optimize database usage by deferring unused fields (and more)

Django Eraserhead

https://travis-ci.org/dizballanze/django-eraserhead.svg?branch=master

Provide hints to optimize database usage by deferring unused fields

https://github.com/dizballanze/django-eraserhead/raw/master/eraserhead.jpg

WARNING use this package only in dev environment!

Documentation

Requirements

  • Django 1.9+
  • Python 2.7, 3.4+

Quickstart

Install Django Eraserhead:

pip install django-eraserhead

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'eraserhead.apps.EraserheadConfig',
    ...
)

ERASERHEAD_ENABLED = True
ERASERHEAD_TRACEBACK_BASE_PATH = BASE_DIR

Settings:

  • ERASERHEAD_ENABLED - enable/disable Django Eraserhead
  • ERASERHEAD_TRACEBACK_BASE_PATH - set base path to filter tracebacks. Set to None to display full traceback.

Features

https://github.com/dizballanze/django-eraserhead/raw/master/screenshot.png

Django Eraserhead monitors:

  • querysets/models fields usage (used and unused fields) with considering deferred fields
  • count of instances created for each queryset
  • corresponding model of each queryset
  • traceback for each queryset to easily find corresponding code
  • calculate memory consumption of unused fields

Based on fields usage Django Eraserhead suggests optimizations for each queryset.

TODO

  • decorator and/or context processor for partial stats collecting
  • detect deferred fields loading
  • auto deferring fields based on usage
  • display deferred fields

Running Tests

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

More Repositories

1

django-admin-env-notice

Visually distinguish environments in Django Admin
Python
308
star
2

m00dbot

Telegram bot for self-testing of anxiety and depression
Python
225
star
3

do-latency

🐳 Digital Ocean regions latency checker
Python
112
star
4

hashtable

Async hash table server in C
C
75
star
5

gray

Less uncompromising Python code formatter
Python
74
star
6

django-migrations-graph

Django-admin command to display migrations with dependencies.
Python
48
star
7

ngx_http_avatars_gen_module

🖼 Generating avatars on-the-fly with Nginx
C
33
star
8

django-compressor-autoprefixer

Django Compressor CSS filter for autoprefixer
Python
23
star
9

debugmail

SMTP testing server
JavaScript
11
star
10

nginx-lua-contact

Nginx + Lua contact form handler
Lua
10
star
11

planner

Python package for drawing 2d plans of a buildings.
Python
9
star
12

mailsender

Python cli-tool for sending emails through specified SMTP server.
Python
9
star
13

chat-app

Chat application for Ukrainian Web Challenge. Developed on php (yii), node.js (socket.io), redis etc
PHP
6
star
14

express-socketio-session-example

Example of using express session in socket.io
JavaScript
3
star
15

blazing-fast-django-tests-example

Example for "Blazing fast Django tests" blog post
Python
3
star
16

django-optimization-guide-2-sample

Python
2
star
17

dizballanze.github.io

my tech blog
CSS
2
star
18

packer-virtualbox-vagrant-debian

Minimal config of packer to build vagrant box for virtualbox with Debian 8
Shell
1
star
19

Encryption

Simple crypt algorithms on PHP
PHP
1
star
20

breaking-point

breaking-point.py helps to find a size of input data where one function starts outperform another function
Python
1
star
21

domainfilter

Domain filtration cli-tool.
CoffeeScript
1
star