PDF-raku
PDF-raku copied to clipboard
Setup concurrency between PDF::IO::Serializer and PDF::IO::Writer
Currently the serializer builds a complete AST tree which is then passed to the writer which deconstructs out outputs it.
Simple, but single threaded and creating a memory peak with the need to fully construct the intermediate structrure.
Would be good to use a supply channel, or similar to allow the serializer to construct objects in parallel and the writer to consume them as they become available.
Probably should be stable. I.e. objects are always produced and consumed in the same order, so that output PDF's remain structurally similar when run repeatably.
This should hopefully reduced peak memory usage and improve serialization speeds on multi CPU platforms. Needs to be bench-marked.