Giter Site home page Giter Site logo

Comments (5)

WisdomPill avatar WisdomPill commented on June 26, 2024

hello @siovene, if you're looking for performance I would strongly recommend to move away from pickle, maybe plain json would be a good. But if you want to take it further then my suggestion would be to try orjson, not only for redis but also for rendering if you're using django-rest-framework it would be fairly easy.

In some cases you could also decide to not serialise at all.

I do not know how Scout APM works, I have never used it, but it would be nicer to get more insights into which method is taking long.

Imho sentry does do a good job when it comes to performance measurements, I prefer using new relic for that.
Sentry can be misleading because of the number of traces it analyses and it does not do a good job when trying to understand the big picture especially with multiple services.

from django-redis.

siovene avatar siovene commented on June 26, 2024

Hi @WisdomPill,

I appreciate the tip, I will try JSON or orson. However, do you really think that pickling would be so slow that occasionally it takes 5 seconds to deserialize a 20 byte strings?

from django-redis.

WisdomPill avatar WisdomPill commented on June 26, 2024

it depends on the complexity of the class if you're serialising a class... if you're serialising basic objects (int, string and so on) I would maybe even go so far to not even serialise in order to see if there are any differences.

from django-redis.

siovene avatar siovene commented on June 26, 2024

Thanks @WisdomPill.

Is there a way to specify this on a per-key basis? I just looked around my code base and I cache some simple values, some python dictionaries, but also some entire Django models or even querysets. And I also cache template fragments.

from django-redis.

WisdomPill avatar WisdomPill commented on June 26, 2024

then I would definitely drop pickle and write serializers for your querysets. you could give a try to CacheRouter or use caches directly

from django-redis.

Related Issues (20)

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.