watermarkchurch / wcc-contentful

An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.
MIT License
2 stars 1 forks source link

Allow garbage collection of intermediate pages #257

Closed gburgett closed 2 years ago

gburgett commented 2 years ago

Previously, the SimpleClient response would memoize each page, constructing a linked list of all the pages. For large spaces this means that by the final page, the entire space is held in memory at once.

This PR breaks the linked list, so the lazy iterator runs through each page one at a time and resolves includes within the context of each page. This should allow the garbage collector to clean up past pages, reducing memory pressure.

watermarkchurch-bot commented 2 years ago
1 Warning
:warning: No issue referenced - please create an issue describing a single unit of work and reference it using "closes #[the issue number]"

Generated by :no_entry_sign: Danger

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.003%) to 94.032% when pulling 5d2ed71278cfcce1e06453a87a3210e02a2fe14e on enumerator_gc into fde9f255f43b1450bbadaf253770cf9aba76d2e2 on master.

gburgett commented 2 years ago

@jpowell this would be nice to get into the next release of Paper signs