Hi

Here are the patches:

PoDoFo-mem-1.diff

Moves some member variables within PdfObject – saves space by reducing compiler 
alignment padding

PoDoFo-mem-2.diff

Changes base type of EPdfDataType from int to uint8_t (on compilers that 
support C++ 11) – the smaller type saves space and reduces compiler alignment 
padding

Win 32-bit before

sizeof(PdfObject) = 64
sizeof(PdfVariant) = 32
sizeof(PdfReference) = 16
sizeof(PdfDataType) = 8

Win 32-bit after

sizeof(PdfObject) = 56
sizeof(PdfVariant) = 24
sizeof(PdfReference) = 16
sizeof(PdfDataType) = 8

moving PdfObject members saved 0 bytes in PdfObject
changing EPdfDataType to uint8_t saved 8 bytes in PdfVariant

PdfObject uses 12% less memory on 32-bit
PdfVariant uses 33% less memory on 32-bit

Mac 64-bit before

sizeof(PdfObject) = 80
sizeof(PdfVariant) = 32
sizeof(PdfReference) = 24
sizeof(PdfDataType) = 16

Mac 64-bit after

sizeof(PdfObject) = 64
sizeof(PdfVariant) = 24
sizeof(PdfReference) = 24
sizeof(PdfDataType) = 16

moving PdfObject members saved 8 bytes in PdfObject
changing EPdfDataType to uint8_t saved 8 bytes in PdfVariant

PdfObject uses 20% less memory on 64-bit
PdfVariant uses 33% less memory on 64-bit

I’ve tested compilation on XCode 8 / Clang and Visual C++ 2015 

Cheers
Mark


Mark Rogers - mark.rog...@powermapper.com
PowerMapper Software Ltd - www.powermapper.com 
Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL 
 










On 06/01/2017, 08:30, "zyx" <z...@litepdf.cz> wrote:

    On Thu, 2017-01-05 at 18:59 +0000, Mark Rogers wrote:
    > I’m not certain if PoDoFo makes any guarantees on binary
    > compatibility between releases (although C++ makes it hard to provide
    > any guarantees on binary compatibility). These patches will break
    > binary compatibility (by changing the memory layout of member
    > variables) but won’t affect source compatibility.
    
        Hi,
    as Mattia said, there is not problem with binary compatibility. I
    already changed API, thus the soname version bump is required anyway.
     
    > Do you want me to submit the patches?
    
    Yes, please. The sooner the better, the code freeze is approaching
    quickly.
        Thanks and bye,
        zyx
    
    -- 
    http://www.litePDF.cz                                 i...@litepdf.cz
    
    
------------------------------------------------------------------------------
    Check out the vibrant tech community on one of the world's most 
    engaging tech sites, SlashDot.org! http://sdm.link/slashdot
    _______________________________________________
    Podofo-users mailing list
    Podofo-users@lists.sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/podofo-users
    

Attachment: PoDoFo-mem-2.diff
Description: PoDoFo-mem-2.diff

Attachment: PoDoFo-mem-1.diff
Description: PoDoFo-mem-1.diff

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to