Giter VIP home page Giter VIP logo

Comments (4)

DmitryTsepelev avatar DmitryTsepelev commented on June 9, 2024

Hi @duprasa, 27mb is a serious amount of data!

I guess you use Redis as a cache store (am I right?), so it might take some extra time for a network roundtrip. I wonder if it's possible to find out how much time is spent in parser and how long it takes to fetch a cached data (I guess we could compare how much time it takes to execute Rails.cache.fetch against redis.get).

from graphql-ruby-fragment_cache.

duprasa avatar duprasa commented on June 9, 2024

Hi @DmitryTsepelev thanks for the quick reply!

Ya it's a ton of data, we are planning on breaking it up into smaller requests, but I found that it illustrated this issue well.

I'm just using the default caching mechanism and running it locally, looking at the rails logs I can see that most of the processing is done in view_runtime, so the network isn't adding much overhead.

Smaller requests are blazing fast tho and range in the 10-100ms range 👍

I'm not great at rails so I have trouble diagnosing where the issue is exactly, do you think it might be because after cache.fetch, the data needs to be parsed to json (for graphql)? Maybe we can use a faster json parsing libary, I've heard that the deafult one is pretty slow?

Thanks again!

from graphql-ruby-fragment_cache.

DmitryTsepelev avatar DmitryTsepelev commented on June 9, 2024

Yeah, you could try writing a custom cache storage using a faster serialiser (example is is here, you need to implement only #read, #exists? and #write). I think oj should be faster then the default one. Before reimplementing storage, you can just compare how much time Rails.cache.read takes against oj.

from graphql-ruby-fragment_cache.

DmitryTsepelev avatar DmitryTsepelev commented on June 9, 2024

I'm closing the issue for now, feel free to reopen it or open a new one if you have questions 🙂

from graphql-ruby-fragment_cache.

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.