Skip to content

Add second patch to imcompress.c limiting cache to one tile#493

Open
esheldon wants to merge 1 commit into
masterfrom
fixed-sized-cache
Open

Add second patch to imcompress.c limiting cache to one tile#493
esheldon wants to merge 1 commit into
masterfrom
fixed-sized-cache

Conversation

@esheldon

@esheldon esheldon commented May 8, 2026

Copy link
Copy Markdown
Owner

The old compressed tile cache could grow large. This limits it to size one tile, addressing the main performance gain from the cache.

closes #492

The old compressed tile cache could grow large.  This
limits it to size one tile, addressing the main performance
gain from the cache.

@beckermr beckermr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we should merge this fix.

We should be carrying patches that fix critical bugs etc. We should not carry patches for new features. The intent is that the patch is eventually merged upstream.

Downstream users should probably close and reopen their fits file on a regular basis maybe instead?

@esheldon

esheldon commented May 8, 2026

Copy link
Copy Markdown
Owner Author

I think of this as an implementation detail not a feature.

@erykoff

erykoff commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Right now this cfitsio "feature" is making it impossible to read DP2 healsparse maps in notebooks. I was going to just change to astropy fits reading because of it. Though I haven't checked what the overhead is of closing/opening. So I'll compare the speed/memory of astropy vs close/open vs this patch.

@beckermr

beckermr commented May 8, 2026

Copy link
Copy Markdown
Collaborator

OK. Even if you think this patch is an implementation detail, it needs to be combined with the existing patches etc.

@esheldon

esheldon commented May 8, 2026

Copy link
Copy Markdown
Owner Author

This patch works as is. Do you mean to do the other method instead, using a PR against cfitsio?

@beckermr

beckermr commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Yes. The code here is more or less a hack of the build system. I refactored the patching code to make it clearer and easier to understand.

@esheldon

esheldon commented May 8, 2026

Copy link
Copy Markdown
Owner Author

OK, if we decide we want this I'll redo it. Let's see what Eli finds

@esheldon

Copy link
Copy Markdown
Owner Author

Superceded by #495

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.

Limit memory usage of cached reads from compressed images

3 participants