Double zipping xlsx files is not necessary. The following override is the minimum needed for the demonstration above. The _prepare_sst_string_data may be omitted when calling $wb->set_optimization().

{ no warnings 'redefine'; sub Excel::Writer::XLSX::Workbook::_store_workbook { my $self = shift; my $tempdir = File::Temp->newdir( DIR => $self->{_tempdir} ); my $packager = Excel::Writer::XLSX::Package::Packager->new(); # Convert the SST strings data structure. $self->_prepare_sst_string_data(); # Package the workbook. $packager->_add_workbook( $self ); $packager->_set_package_dir( $tempdir ); $packager->_create_package(); # Free up the Packager object. $packager = undef; } }

The time for 60 million cells reduced by 16.5 seconds. Thus, reaching 232k cells per second (2.5x for multi-core).

$ time perl write_60mil_parallel.pl AMS ---- DONE. EMEA ---- DONE. APJ ---- DONE. Node List is Done. real 4m18.715s user 11m15.291s sys 0m 3.766s

For comparison, the time is shy of 11 minutes for 1 core at 92k cells per second.

$ time perl write_60mil_serial.pl AMS ---- DONE. APJ ---- DONE. EMEA ---- DONE. Node List is Done. real 10m54.015s user 10m51.045s sys 0m 3.224s

Kind regards, Mario


In reply to Re^2: Writing multiple Excel::Writer::XLSX worksheets in parallel (3rd and final attempts) by marioroy
in thread Writing multiple Excel::Writer::XLSX worksheets in parallel (3rd and final attempts) by marioroy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.