Skip to content

Release cached files after OpenapiFirst.load#468

Merged
ahx merged 4 commits intomainfrom
local-file-loader
Apr 13, 2026
Merged

Release cached files after OpenapiFirst.load#468
ahx merged 4 commits intomainfrom
local-file-loader

Conversation

@ahx
Copy link
Copy Markdown
Owner

@ahx ahx commented Apr 8, 2026

Makes FileLoader and RefResolver classes

after:
                        21.907M memsize (   205.954k retained)
                       236.790k objects (   690.000  retained)
                        50.000  strings (    18.000  retained)
                        
before:
                        20.983M memsize (     1.144M retained)
                       231.069k objects (     8.383k retained)
                        50.000  strings (    50.000  retained)

@ahx
Copy link
Copy Markdown
Owner Author

ahx commented Apr 8, 2026

This removes global file caching, but results in reduced retained memory (if i measured correctly) . Does it just work with your reloading scenario without the need to call clear_cache!, @moberegger ?

@moberegger
Copy link
Copy Markdown
Contributor

@ahx I'll give it a try. I may have to wait until tomorrow, though. Are you in a hurry to merge this?

@ahx
Copy link
Copy Markdown
Owner Author

ahx commented Apr 8, 2026

@ahx I'll give it a try. I may have to wait until tomorrow, though. Are you in a hurry to merge this?

Not at all. Thank you.

@ahx ahx force-pushed the local-file-loader branch from 7b38c75 to 2053183 Compare April 8, 2026 21:08
@ahx ahx force-pushed the local-file-loader branch from 2053183 to 150c39b Compare April 8, 2026 21:15
@moberegger
Copy link
Copy Markdown
Contributor

@ahx This seems to be working like a charm!

Also verified that the files are still only loading once.

Make FileLoader and RefResolver classes
@ahx ahx force-pushed the local-file-loader branch 2 times, most recently from 188c5a4 to d7fa8a3 Compare April 13, 2026 20:15
- Optimized caching towards reducing retained memory after calling `OpenapiFirst.load` without using a global cache. (Removed `OpenapiFirst.clear_cache!`.)
- Require ruby >= 3.3.0
@ahx ahx force-pushed the local-file-loader branch from d7fa8a3 to 2e63abd Compare April 13, 2026 20:18
@ahx ahx merged commit 25d14df into main Apr 13, 2026
32 checks passed
@ahx ahx deleted the local-file-loader branch April 13, 2026 20:48
@ahx
Copy link
Copy Markdown
Owner Author

ahx commented Apr 13, 2026

Nice @moberegger Thanks for pushing this forward.
Released as 3.3.1 (I have silently removed clear_cache! method again 🤐 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants