Add caching to load_dag
See original GitHub issueload_dag
is an expensive operation and many times it’s called with the same argument, so we should cache the result
here’s the implementation:
so every time the function is called, we should save the starting_dir
value, and the returned path
:
next time the function is called, check if starting_dir
is the same and the file in path
hasn’t changed. if so, skip the function’s body
add tests here: https://github.com/ploomber/ploomber/blob/master/tests/test_jupyter.py#L901
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Caching strategies - Amazon ElastiCache - AWS Documentation
In the rest of this section, we discuss common cache maintenance strategies and their advantages and disadvantages. Topics. Lazy loading; Write-through; Adding ......
Read more >5 Loading Data Into a Cache - Oracle Help Center
Loading the cache can be made much more efficient by using the putAll method ... Also add the classes and files related to...
Read more >NGINX Content Caching | NGINX Plus
To enable caching, include the proxy_cache_path directive in the top‑level ... Loading the whole cache at once could consume sufficient resources to slow ......
Read more >Scripting API: Caching - Unity - Manual
Returns true if Caching system is ready for use. Static Methods. AddCache, Add a cache with the given path. ClearAllCachedVersions, Removes all the...
Read more >How to load @Cache on startup in spring? - Stack Overflow
Just use the cache as before, add a scheduler to update cache, code snippet is below. @Service public class CacheScheduler { @Autowired ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @kugiyasan, sure. It was more an issue on my end since I didn’t consider the complete picture, and my original description wasn’t clear enough.
Users can create Ploomber pipelines in different ways (from directories, Python modules, or YAML files). Each one has its details, so let’s restrict this feature on YAML, since it’s by far the most common.
My original description wasn’t clear, so let me add more context.
So if you’re up for the challenge we can work on this in two parts: first, update your PR so we cover the points described in 1), then, you can work no covering the edge cases for 2)
There’s a PR open https://github.com/ploomber/ploomber/pull/396
but I found a few edge cases, so it’s pending merge