Skip to content

Allocate memory for image cache once.#1508

Merged
confluence merged 6 commits intodevfrom
confluence/fix_image_cache_reallocation
Oct 13, 2025
Merged

Allocate memory for image cache once.#1508
confluence merged 6 commits intodevfrom
confluence/fix_image_cache_reallocation

Conversation

@confluence
Copy link
Copy Markdown
Collaborator

@confluence confluence commented Sep 9, 2025

Description

This fixes the unnecessary reallocation of the image cache memory every time the cache is filled. The cache code will be refactored soon, but there's no reason not to fix this in the meantime.

  • Cache memory is allocated once in the constructor
  • _image_cache_size should never have been a signed long long. On 64-bit architectures size_t should be equivalent to unsigned long long. We pass this value to functions which take a size_t parameter.
  • To check if the cache has been allocated, it's more idiomatic to check if it's a nullptr than to check if the size is zero.

Checklist

  • changelog updated
  • e2e test passing / corresponding fix added / new e2e test created
  • ICD test passing / corresponding fix added / new ICD test created
  • no protobuf update needed
  • protobuf version not bumped
  • added reviewers and assignee
  • GitHub Project estimate added

@confluence confluence self-assigned this Sep 9, 2025
@confluence confluence added awaiting testing For pull requests that require testing awaiting code review For pull requests that require code review labels Sep 9, 2025
@confluence
Copy link
Copy Markdown
Collaborator Author

@veggiesaurus @kswang1029 Here's some profiling output (animating channels in a 20480 x 20480 x 10 image).

dev:

[2025-09-15 14:44:11.423Z] [debug] [performance] Load 20480x20480 image to cache in 1124.754 ms at 372.909 MPix/s
[2025-09-15 14:44:16.642Z] [debug] [performance] Load 20480x20480 image to cache in 1146.143 ms at 365.949 MPix/s
[2025-09-15 14:44:18.249Z] [debug] [performance] Load 20480x20480 image to cache in 1124.325 ms at 373.051 MPix/s
[2025-09-15 14:44:19.834Z] [debug] [performance] Load 20480x20480 image to cache in 1106.932 ms at 378.913 MPix/s
[2025-09-15 14:44:21.438Z] [debug] [performance] Load 20480x20480 image to cache in 1141.200 ms at 367.535 MPix/s
[2025-09-15 14:44:23.048Z] [debug] [performance] Load 20480x20480 image to cache in 1123.787 ms at 373.229 MPix/s
[2025-09-15 14:44:24.624Z] [debug] [performance] Load 20480x20480 image to cache in 1109.048 ms at 378.190 MPix/s
[2025-09-15 14:44:26.187Z] [debug] [performance] Load 20480x20480 image to cache in 1095.524 ms at 382.858 MPix/s
[2025-09-15 14:44:27.783Z] [debug] [performance] Load 20480x20480 image to cache in 1122.213 ms at 373.753 MPix/s
[2025-09-15 14:44:29.392Z] [debug] [performance] Load 20480x20480 image to cache in 1111.798 ms at 377.254 MPix/s
[2025-09-15 14:44:30.984Z] [debug] [performance] Load 20480x20480 image to cache in 1107.018 ms at 378.883 MPix/s
[2025-09-15 14:44:32.394Z] [debug] [performance] Load 20480x20480 image to cache in 1133.006 ms at 370.193 MPix/s
[2025-09-15 14:44:33.869Z] [debug] [performance] Load 20480x20480 image to cache in 1190.498 ms at 352.315 MPix/s
[2025-09-15 14:44:35.301Z] [debug] [performance] Load 20480x20480 image to cache in 1156.584 ms at 362.646 MPix/s
[2025-09-15 14:44:36.741Z] [debug] [performance] Load 20480x20480 image to cache in 1162.713 ms at 360.734 MPix/s
[2025-09-15 14:44:38.198Z] [debug] [performance] Load 20480x20480 image to cache in 1182.875 ms at 354.586 MPix/s
[2025-09-15 14:44:39.574Z] [debug] [performance] Load 20480x20480 image to cache in 1098.307 ms at 381.888 MPix/s
[2025-09-15 14:44:40.963Z] [debug] [performance] Load 20480x20480 image to cache in 1108.693 ms at 378.311 MPix/s
[2025-09-15 14:44:42.345Z] [debug] [performance] Load 20480x20480 image to cache in 1099.486 ms at 381.479 MPix/s
[2025-09-15 14:44:43.785Z] [debug] [performance] Load 20480x20480 image to cache in 1160.377 ms at 361.460 MPix/s
[2025-09-15 14:44:45.183Z] [debug] [performance] Load 20480x20480 image to cache in 1121.997 ms at 373.825 MPix/s
[2025-09-15 14:44:46.623Z] [debug] [performance] Load 20480x20480 image to cache in 1164.098 ms at 360.305 MPix/s

This branch:

[2025-09-15 14:45:13.086Z] [debug] [performance] Load 20480x20480 image to cache in 652.395 ms at 642.909 MPix/s
[2025-09-15 14:45:16.126Z] [debug] [performance] Load 20480x20480 image to cache in 661.179 ms at 634.367 MPix/s
[2025-09-15 14:45:17.247Z] [debug] [performance] Load 20480x20480 image to cache in 622.919 ms at 673.331 MPix/s
[2025-09-15 14:45:18.338Z] [debug] [performance] Load 20480x20480 image to cache in 619.306 ms at 677.259 MPix/s
[2025-09-15 14:45:19.441Z] [debug] [performance] Load 20480x20480 image to cache in 639.631 ms at 655.738 MPix/s
[2025-09-15 14:45:20.524Z] [debug] [performance] Load 20480x20480 image to cache in 621.230 ms at 675.161 MPix/s
[2025-09-15 14:45:21.621Z] [debug] [performance] Load 20480x20480 image to cache in 623.719 ms at 672.467 MPix/s
[2025-09-15 14:45:22.719Z] [debug] [performance] Load 20480x20480 image to cache in 602.522 ms at 696.125 MPix/s
[2025-09-15 14:45:23.774Z] [debug] [performance] Load 20480x20480 image to cache in 596.189 ms at 703.519 MPix/s
[2025-09-15 14:45:24.840Z] [debug] [performance] Load 20480x20480 image to cache in 598.133 ms at 701.233 MPix/s
[2025-09-15 14:45:25.972Z] [debug] [performance] Load 20480x20480 image to cache in 635.754 ms at 659.737 MPix/s
[2025-09-15 14:45:26.893Z] [debug] [performance] Load 20480x20480 image to cache in 644.075 ms at 651.214 MPix/s
[2025-09-15 14:45:27.796Z] [debug] [performance] Load 20480x20480 image to cache in 627.709 ms at 668.192 MPix/s
[2025-09-15 14:45:28.697Z] [debug] [performance] Load 20480x20480 image to cache in 626.792 ms at 669.170 MPix/s
[2025-09-15 14:45:29.601Z] [debug] [performance] Load 20480x20480 image to cache in 626.249 ms at 669.750 MPix/s
[2025-09-15 14:45:30.501Z] [debug] [performance] Load 20480x20480 image to cache in 619.949 ms at 676.556 MPix/s
[2025-09-15 14:45:31.397Z] [debug] [performance] Load 20480x20480 image to cache in 619.509 ms at 677.037 MPix/s
[2025-09-15 14:45:32.280Z] [debug] [performance] Load 20480x20480 image to cache in 605.523 ms at 692.675 MPix/s
[2025-09-15 14:45:33.174Z] [debug] [performance] Load 20480x20480 image to cache in 617.864 ms at 678.839 MPix/s
[2025-09-15 14:45:34.048Z] [debug] [performance] Load 20480x20480 image to cache in 596.839 ms at 702.753 MPix/s
[2025-09-15 14:45:34.971Z] [debug] [performance] Load 20480x20480 image to cache in 647.786 ms at 647.483 MPix/s
[2025-09-15 14:45:35.891Z] [debug] [performance] Load 20480x20480 image to cache in 643.999 ms at 651.290 MPix/s

@veggiesaurus
Copy link
Copy Markdown
Collaborator

@confluence can you run with psrecord to make some pretty graphs?

@confluence
Copy link
Copy Markdown
Collaborator Author

confluence commented Sep 15, 2025

@veggiesaurus here you go. Note the scale of the memory usage -- because of the reallocation, we're actually frequently using twice the size of one channel, because the previous channel's memory hasn't been freed yet when memory is allocated for the new channel.

Dev:

dev

This branch:

fix

Copy link
Copy Markdown
Contributor

@kswang1029 kswang1029 left a comment

Choose a reason for hiding this comment

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

this appears fine. No significant performance improvements nor degradation is observed e2e (maybe due to the test image size I used). All e2e tests are passing.

before
[2025-09-22 07:43:47.219Z] [debug] [performance] Load 32768x32768 image to cache in 1879.371 ms at 571.330 MPix/s

after
[2025-09-22 07:45:29.273Z] [debug] [performance] Load 32768x32768 image to cache in 1544.169 ms at 695.353 MPix/s

@confluence were you testing with a large cube and switching channels one by one or using animation playback? I am trying to see if I can get a similar performance boost like you obtained (~0.5s per channel).

@kswang1029 kswang1029 removed the awaiting testing For pull requests that require testing label Sep 22, 2025
@kswang1029
Copy link
Copy Markdown
Contributor

kswang1029 commented Sep 22, 2025

@veggiesaurus here you go. Note the scale of the memory usage -- because of the reallocation, we're actually frequently using twice the size of one channel, because the previous channel's memory hasn't been freed yet when memory is allocated for the new channel.

Dev:

dev This branch: fix

@confluence By comparing these two psrecord plots, I see the e2e time is similar (this PR performs slightly better then dev). But in the performance log you showed, the cache loading performance improves significantly (~40%). Does this imply something else slow it down (generating tiles?). Or we cannot compare the two psrecord plots directly?

@kswang1029 kswang1029 self-requested a review September 22, 2025 08:14
@confluence
Copy link
Copy Markdown
Collaborator Author

confluence commented Sep 22, 2025

@confluence By comparing these two psrecord plots, I see the e2e time is similar (this PR performs slightly better then dev). But in the performance log you showed, the cache loading performance improves significantly (~40%). Does this imply something else slow it down (generating tiles?). Or we cannot compare the two psrecord plots directly?

The e2e times of the two plots can't be compared directly -- this was a very unscientific manual test, not a script; I think that in the second plot I may have let it run through the animation for longer. You can get a better idea of the time difference if you compare the 10 tallest CPU spikes at the beginning of each plot -- that's where the 10 channels are being read from disk for the first time; the first one when the image is first loaded, and the other 9 when the animation starts (after that they're cached). You can see how these are more compressed in the second plot.

The impact really becomes noticeable when a single channel is large, and especially during animation, when the channel is changed frequently. But there's a separate effect of the channels being loaded more quickly once they're cached (as you can see from the plots), so you need to let the animation loop at least once in both branches to compare like to like.

(There may be other factors affecting the speed comparison in the tests; e.g. the hardware on which they're running, the filesystem, OS caching, etc.. My test was done on a Thinkpad with an SSD running Linux.)

Copy link
Copy Markdown
Contributor

@kswang1029 kswang1029 left a comment

Choose a reason for hiding this comment

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

I tested with a 30000x30000x5 cube and now see the improvements 👍

  1. memory allocation issue is fixed
  2. performance improvements about 20% in animation playback (loop twice).

Performance data and graphs are shown below.

dev

[2025-09-23 03:13:03.779Z] [debug] [performance] Load 30000x30000 image to cache in 1591.193 ms at 565.613 MPix/s
[2025-09-23 03:13:09.122Z] [debug] [performance] Load 30000x30000 image to cache in 1472.268 ms at 611.302 MPix/s
[2025-09-23 03:13:09.394Z] [debug] [performance] Animator: Change frame in 1744.371 ms
[2025-09-23 03:13:11.128Z] [debug] [performance] Load 30000x30000 image to cache in 1529.537 ms at 588.413 MPix/s
[2025-09-23 03:13:11.443Z] [debug] [performance] Animator: Change frame in 1844.232 ms
[2025-09-23 03:13:13.558Z] [debug] [performance] Load 30000x30000 image to cache in 1910.128 ms at 471.173 MPix/s
[2025-09-23 03:13:13.895Z] [debug] [performance] Animator: Change frame in 2247.120 ms
[2025-09-23 03:13:15.754Z] [debug] [performance] Load 30000x30000 image to cache in 1654.072 ms at 544.112 MPix/s
[2025-09-23 03:13:16.070Z] [debug] [performance] Animator: Change frame in 1969.322 ms
[2025-09-23 03:13:17.926Z] [debug] [performance] Load 30000x30000 image to cache in 1650.881 ms at 545.163 MPix/s
[2025-09-23 03:13:18.021Z] [debug] [performance] Animator: Change frame in 1746.546 ms
[2025-09-23 03:13:19.867Z] [debug] [performance] Load 30000x30000 image to cache in 1640.883 ms at 548.485 MPix/s
[2025-09-23 03:13:19.963Z] [debug] [performance] Animator: Change frame in 1736.510 ms
[2025-09-23 03:13:21.804Z] [debug] [performance] Load 30000x30000 image to cache in 1636.437 ms at 549.975 MPix/s
[2025-09-23 03:13:21.898Z] [debug] [performance] Animator: Change frame in 1730.108 ms
[2025-09-23 03:13:23.746Z] [debug] [performance] Load 30000x30000 image to cache in 1643.188 ms at 547.716 MPix/s
[2025-09-23 03:13:23.836Z] [debug] [performance] Animator: Change frame in 1732.794 ms
[2025-09-23 03:13:25.670Z] [debug] [performance] Load 30000x30000 image to cache in 1632.831 ms at 551.190 MPix/s
[2025-09-23 03:13:25.762Z] [debug] [performance] Animator: Change frame in 1724.426 ms
[2025-09-23 03:13:27.618Z] [debug] [performance] Load 30000x30000 image to cache in 1651.432 ms at 544.982 MPix/s
[2025-09-23 03:13:27.709Z] [debug] [performance] Animator: Change frame in 1742.017 ms
[2025-09-23 03:13:29.596Z] [debug] [performance] Load 30000x30000 image to cache in 1683.511 ms at 534.597 MPix/s
[2025-09-23 03:13:31.110Z] [debug] [performance] Load 30000x30000 image to cache in 1514.208 ms at 594.370 MPix/s
dev

This PR

[2025-09-23 03:21:42.623Z] [debug] [performance] Load 30000x30000 image to cache in 1268.583 ms at 709.453 MPix/s
[2025-09-23 03:21:46.745Z] [debug] [performance] Load 30000x30000 image to cache in 1216.876 ms at 739.599 MPix/s
[2025-09-23 03:21:47.045Z] [debug] [performance] Animator: Change frame in 1516.889 ms
[2025-09-23 03:21:48.462Z] [debug] [performance] Load 30000x30000 image to cache in 1216.676 ms at 739.720 MPix/s
[2025-09-23 03:21:48.771Z] [debug] [performance] Animator: Change frame in 1526.329 ms
[2025-09-23 03:21:50.235Z] [debug] [performance] Load 30000x30000 image to cache in 1263.076 ms at 712.546 MPix/s
[2025-09-23 03:21:50.533Z] [debug] [performance] Animator: Change frame in 1561.704 ms
[2025-09-23 03:21:52.028Z] [debug] [performance] Load 30000x30000 image to cache in 1289.590 ms at 697.896 MPix/s
[2025-09-23 03:21:52.350Z] [debug] [performance] Animator: Change frame in 1611.566 ms
[2025-09-23 03:21:53.865Z] [debug] [performance] Load 30000x30000 image to cache in 1314.666 ms at 684.585 MPix/s
[2025-09-23 03:21:53.954Z] [debug] [performance] Animator: Change frame in 1403.840 ms
[2025-09-23 03:21:55.472Z] [debug] [performance] Load 30000x30000 image to cache in 1313.366 ms at 685.262 MPix/s
[2025-09-23 03:21:55.564Z] [debug] [performance] Animator: Change frame in 1406.071 ms
[2025-09-23 03:21:57.073Z] [debug] [performance] Load 30000x30000 image to cache in 1304.348 ms at 690.000 MPix/s
[2025-09-23 03:21:57.172Z] [debug] [performance] Animator: Change frame in 1403.104 ms
[2025-09-23 03:21:58.657Z] [debug] [performance] Load 30000x30000 image to cache in 1280.149 ms at 703.043 MPix/s
[2025-09-23 03:21:58.754Z] [debug] [performance] Animator: Change frame in 1376.626 ms
[2025-09-23 03:22:00.270Z] [debug] [performance] Load 30000x30000 image to cache in 1311.007 ms at 686.495 MPix/s
[2025-09-23 03:22:00.367Z] [debug] [performance] Animator: Change frame in 1408.096 ms
[2025-09-23 03:22:01.873Z] [debug] [performance] Load 30000x30000 image to cache in 1305.621 ms at 689.327 MPix/s
[2025-09-23 03:22:01.955Z] [debug] [performance] Animator: Change frame in 1387.358 ms
[2025-09-23 03:22:03.483Z] [debug] [performance] Load 30000x30000 image to cache in 1322.910 ms at 680.318 MPix/s
[2025-09-23 03:22:04.577Z] [debug] [performance] Load 30000x30000 image to cache in 1094.437 ms at 822.341 MPix/s
pr

@kswang1029
Copy link
Copy Markdown
Contributor

@confluence based on the test results above, it seems when we trigger animation playback, the image data of the starting channel will be loaded into memory again and generate the tiles with the compression quality for animation. Could you confirm this behaviour? I think maybe we can bypass this loading step and proceed with tile generation directly.

When we stop the animation, it seems also the stopping channel will be loaded again for generating tiles with the compression quality for images. Do you think it is also possible to bypass the loading step?

These duplications becomes much noticeable when the per-channel image size is large enough. Do you think we need a separate issue to improve this part?

@confluence
Copy link
Copy Markdown
Collaborator Author

@kswang1029 I'm not sure if that's really what's happening -- if yes, there may be a race condition in the cache filling code. The change in compression shouldn't have any effect on the cache; the same full resolution data for the channel is always loaded. In both graphs, you can see five taller CPU spikes in sequence at the start, which is consistent with the five channels being loaded for the first time -- if the first channel were being loaded again, I would expect to see an additional shorter spike between the first two.

I'm going to add the channel index to the debugging output so that we can see what is actually going on. If this is a bug, I think we should handle it in a separate issue.

@kswang1029
Copy link
Copy Markdown
Contributor

@kswang1029 I'm not sure if that's really what's happening -- if yes, there may be a race condition in the cache filling code. The change in compression shouldn't have any effect on the cache; the same full resolution data for the channel is always loaded. In both graphs, you can see five taller CPU spikes in sequence at the start, which is consistent with the five channels being loaded for the first time -- if the first channel were being loaded again, I would expect to see an additional shorter spike between the first two.

I'm going to add the channel index to the debugging output so that we can see what is actually going on. If this is a bug, I think we should handle it in a separate issue.

@confluence ok I can redo the test once channel index is added to performance log.

@confluence
Copy link
Copy Markdown
Collaborator Author

@kswang1029 OK, I've added the Z and polarization indices to the log. As far as I can see in my local tests, nothing weird is happening at the beginning (the first channel loaded after animation starts is index 1, as expected). What's happening at the end appears to be that during animation the data for the next channel is being requested in advance -- so when animation stops, the backend has to backtrack to reload the previous channel into the cache, because that's the "current" channel that the animation has actually stopped on.

I believe that the pre-fetching is an intentional optimisation -- @veggiesaurus does that sound right, or is this actually a bug?

@kswang1029
Copy link
Copy Markdown
Contributor

kswang1029 commented Sep 23, 2025

@kswang1029 OK, I've added the Z and polarization indices to the log. As far as I can see in my local tests, nothing weird is happening at the beginning (the first channel loaded after animation starts is index 1, as expected). What's happening at the end appears to be that during animation the data for the next channel is being requested in advance -- so when animation stops, the backend has to backtrack to reload the previous channel into the cache, because that's the "current" channel that the animation has actually stopped on.

I believe that the pre-fetching is an intentional optimisation -- @veggiesaurus does that sound right, or is this actually a bug?

Ok animation playback does pre-fetch 2 channels. So I guess that’s what I saw in the performance log. Will redo the test as a confirmation.

@kswang1029
Copy link
Copy Markdown
Contributor

@confluence thanks for adding the channel and stokes indices. The performance log is now sensible and all good.

[2025-09-24 03:13:52.670Z] [debug] [performance] Load 30000x30000 image Z 0 pol. 0 to cache in 1293.976 ms at 695.531 MPix/s
[2025-09-24 03:13:59.931Z] [debug] [performance] Load 30000x30000 image Z 1 pol. 0 to cache in 1352.145 ms at 665.609 MPix/s
[2025-09-24 03:14:00.240Z] [debug] [performance] Animator: Change frame in 1661.155 ms
[2025-09-24 03:14:01.826Z] [debug] [performance] Load 30000x30000 image Z 2 pol. 0 to cache in 1381.607 ms at 651.415 MPix/s
[2025-09-24 03:14:02.141Z] [debug] [performance] Animator: Change frame in 1697.074 ms
[2025-09-24 03:14:03.661Z] [debug] [performance] Load 30000x30000 image Z 3 pol. 0 to cache in 1315.012 ms at 684.404 MPix/s
[2025-09-24 03:14:03.982Z] [debug] [performance] Animator: Change frame in 1635.481 ms
[2025-09-24 03:14:05.513Z] [debug] [performance] Load 30000x30000 image Z 4 pol. 0 to cache in 1326.646 ms at 678.403 MPix/s
[2025-09-24 03:14:05.817Z] [debug] [performance] Animator: Change frame in 1630.117 ms
[2025-09-24 03:14:07.362Z] [debug] [performance] Load 30000x30000 image Z 0 pol. 0 to cache in 1340.079 ms at 671.602 MPix/s
[2025-09-24 03:14:07.450Z] [debug] [performance] Animator: Change frame in 1428.882 ms
[2025-09-24 03:14:08.960Z] [debug] [performance] Load 30000x30000 image Z 1 pol. 0 to cache in 1305.027 ms at 689.641 MPix/s
[2025-09-24 03:14:09.040Z] [debug] [performance] Animator: Change frame in 1385.457 ms
[2025-09-24 03:14:10.582Z] [debug] [performance] Load 30000x30000 image Z 2 pol. 0 to cache in 1336.770 ms at 673.265 MPix/s
[2025-09-24 03:14:10.655Z] [debug] [performance] Animator: Change frame in 1410.115 ms
[2025-09-24 03:14:12.194Z] [debug] [performance] Load 30000x30000 image Z 3 pol. 0 to cache in 1333.347 ms at 674.993 MPix/s
[2025-09-24 03:14:12.287Z] [debug] [performance] Animator: Change frame in 1426.707 ms
[2025-09-24 03:14:13.828Z] [debug] [performance] Load 30000x30000 image Z 4 pol. 0 to cache in 1340.381 ms at 671.451 MPix/s
[2025-09-24 03:14:13.930Z] [debug] [performance] Animator: Change frame in 1442.429 ms
[2025-09-24 03:14:15.488Z] [debug] [performance] Load 30000x30000 image Z 0 pol. 0 to cache in 1353.273 ms at 665.054 MPix/s
[2025-09-24 03:14:15.579Z] [debug] [performance] Animator: Change frame in 1443.792 ms
[2025-09-24 03:14:17.122Z] [debug] [performance] Load 30000x30000 image Z 1 pol. 0 to cache in 1338.215 ms at 672.538 MPix/s
[2025-09-24 03:14:18.222Z] [debug] [performance] Load 30000x30000 image Z 0 pol. 0 to cache in 1100.122 ms at 818.091 MPix/s

@confluence
Copy link
Copy Markdown
Collaborator Author

I've realised that this needs to account for the case of the cache always being loaded to generate contours in an HDF5 file. I guess that the cleanest and most future-proof way to do this would be to allocate the memory conditionally in the fill function, but if the contours are the only special case, perhaps there should be custom code there, to avoid a mostly unnecessary null pointer check every time we fill the cache.

@confluence
Copy link
Copy Markdown
Collaborator Author

I moved the allocation code back into FillImageCache, but made it conditional. It is now guaranteed that the memory will be allocated the first time the function is run, which fixes the contour issue. The null pointer check doesn't appear to have a significant impact on performance. This can be done more elegantly when the cache code is refactored.

@veggiesaurus
Copy link
Copy Markdown
Collaborator

The null pointer check doesn't appear to have a significant impact on performance. This can be done more elegantly when the cache code is refactored.

I think this is fine. It's literally a single arithmetic operation 😆

@kswang1029 kswang1029 added awaiting merge For pull requests ready for merge or pending frontend/protobuf changes and removed awaiting code review For pull requests that require code review labels Oct 9, 2025
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
src.Cache 71%
src.DataStream 42%
src.FileList 65%
src.Frame 36%
src.HttpServer 52%
src.ImageData 28%
src.ImageFitting 51%
src.ImageGenerators 42%
src.ImageStats 64%
src.Logger 34%
src.Main 49%
src.Region 60%
src.Region.RegionImportExport 81%
src.Session 4%
src.Table 52%
src.ThreadManager 68%
src.Timer 83%
src.Util 46%
Summary 45% (9302 / 20714)

@confluence confluence merged commit 9e4d778 into dev Oct 13, 2025
10 checks passed
@confluence confluence deleted the confluence/fix_image_cache_reallocation branch October 13, 2025 13:18
confluence added a commit that referenced this pull request Dec 12, 2025
* Allocate memory for image cache once. Image size should be size_t. Check for nullptr to see if cache filled.

* added to changelog

* Added channel and polarization indices to performance log for image cache fill

* Moved cache allocation back to fill function, but made it conditional. Fixed bad logic in cache validity checks.

* restored original constructor code
confluence added a commit that referenced this pull request Jan 15, 2026
* Allocate memory for image cache once. (#1508)

* Allocate memory for image cache once. Image size should be size_t. Check for nullptr to see if cache filled.

* added to changelog

* Added channel and polarization indices to performance log for image cache fill

* Moved cache allocation back to fill function, but made it conditional. Fixed bad logic in cache validity checks.

* restored original constructor code

* attempt to remove image cache from core dump (#1506)

* attempt to remove image cache from core dump

* Check for platform compatibility before using madvise

* fix included headers; formatting pass

* Added error handling

* working solution with aligned memory; needs tidying up

* Encapsulated page alignment and madvise functionality in custom alias and function. Added changelog and docstrings.

* Fixed docstring issues

* fixed typo in docstring

* Added a basic unit test.

---------

Co-authored-by: Adrianna Pińska <[email protected]>

---------

Co-authored-by: Angus Comrie <[email protected]>
@confluence confluence removed the awaiting merge For pull requests ready for merge or pending frontend/protobuf changes label Jan 15, 2026
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.

4 participants