Giter Site home page Giter Site logo

barseghyanartur / django-eraserhead Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dizballanze/django-eraserhead

0.0 3.0 0.0 158 KB

๐Ÿ’‚๐Ÿป Django package that provides hints to optimize database usage by deferring unused fields (and more)

License: MIT License

Makefile 6.97% Python 91.71% HTML 1.32%

django-eraserhead's Introduction

Django Eraserhead

image

image

image

Provide hints to optimize database usage by deferring unused fields

image

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

image

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

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

TODO

  • calculate memory consumption of unused fields
  • decorator and/or context processor for partial stats collecting
  • detect deferred fields loading
  • auto deferring fields based on usage

Running Tests

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

Credits

Tools used in rendering this package:

django-eraserhead's People

Contributors

dizballanze avatar sobolevn avatar

Watchers

James Cloos avatar Artur Barseghyan avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.