Comments (4)
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.
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.
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.
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)
- graphql-ruby 2.0.18 causing tracer breaking changes HOT 2
- Does this gem can work with GraphQL Ruby Multiplex and GraphQL Batch? HOT 22
- context is a Hash instead of GraphQL::Query::Context, causing runtime errors HOT 5
- Adding an additional cache key HOT 4
- Way to conditionally use fragment cache? HOT 4
- Federated queries including cached fields raises an error HOT 2
- Recyclable Cache Keys? HOT 3
- [Unable to use] graphql-ruby-fragment_cache + action_policy-graphql HOT 5
- Fragment cache somtimes returns null despite cached data loading initially HOT 20
- Package not working with graphql-ruby > 1.12.10 HOT 2
- Per request cache? HOT 1
- Namespace issue HOT 2
- How do I expire a cached collection when a sub model changes? HOT 3
- "Failed to implement Post.id" when returning cached RawValue in resolvers HOT 1
- Specs fail when testing cached fields HOT 3
- Make the cache key human-readable HOT 3
- [Question] Programmatically Clear Entire Cache HOT 7
- Upgrade to 1.18.0 version error HOT 2
- Cache connection type using multi HOT 3
- Clarification on cache_key options HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-ruby-fragment_cache.