TCPDF icon indicating copy to clipboard operation
TCPDF copied to clipboard

Add page cache option to save memory

Open ssigwart opened this issue 3 years ago • 8 comments

Running example_067.php with and without the cache enabled uses about 26MB without vs 17MB with the cache.

This adds the usePageCacheFile option which allow you to move page data to a temporary file when not in use.

ssigwart avatar Jan 25 '22 15:01 ssigwart

Thanks for reviewing it, @williamdes! I think I got all the changes in and updated all the ifs.

ssigwart avatar Jan 25 '22 16:01 ssigwart

@williamdes, I assume someone else will merge this at some point, right? I don't seem to have permission.

ssigwart avatar Feb 03 '22 01:02 ssigwart

@williamdes, I assume someone else will merge this at some point, right? I don't seem to have permission.

Yes, when Nicolas will have some time he will probably review this :) Now we need to be patient

williamdes avatar Feb 03 '22 11:02 williamdes

Sounds good. Thank you.

ssigwart avatar Feb 03 '22 13:02 ssigwart

I rebased this to fix the merge conflicts with the examples.

ssigwart avatar Oct 24 '23 15:10 ssigwart

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (5fce932) 69.28% compared to head (f186d90) 72.96%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #474      +/-   ##
==========================================
+ Coverage   69.28%   72.96%   +3.68%     
==========================================
  Files         128      129       +1     
  Lines       26961    21974    -4987     
==========================================
- Hits        18679    16034    -2645     
+ Misses       8282     5940    -2342     
Flag Coverage Δ
php-5.3-ubuntu-latest ?
php-5.4-ubuntu-latest ?
php-5.5-ubuntu-latest ?
php-5.6-ubuntu-latest ?
php-7.0-ubuntu-latest ?
php-8.3-ubuntu-latest 72.96% <84.53%> (?)
php-nightly-ubuntu-latest 72.96% <84.53%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
examples/example_068.php 100.00% <100.00%> (ø)
include/tcpdf_page_cache_reference_counts.php 100.00% <100.00%> (ø)
tcpdf.php 71.69% <70.58%> (+3.77%) :arrow_up:

... and 81 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 24 '23 15:10 codecov-commenter

I also updated this so it passes the unit tests, including on PHP 5.3.

ssigwart avatar Oct 24 '23 16:10 ssigwart

I also updated this so it passes the unit tests, including on PHP 5.3.

Thank you ! We will have to wait on @nicolaasuni to a review

williamdes avatar Dec 20 '23 10:12 williamdes