I was recently asked to look in to the performance of Spreadsheet::XLSX. Profiling revealed that a significant amount of the overhead was from calls into the LibXML module:
(The blue indicates code that is in the current project - in this case, the SpreadSheet::XLSX module. The grey below it is external code, including modules, the Rakudo standard library, and so forth.)
Looking a little more deeply into the hot spots, I produced a number of changes, where are included in this PR. I suggest reviewing the individual commits; in each I wrote the gain and what I perceive as the trade-off of the change, as for the most part I think they need a decision of whether it's an OK thing to do from the perspective of the module architecture.
Between this and one small improvement in Spreadsheet::XLSX, I'm currently seeing saving of a large worksheet in around half the time (my benchmark included startup and sheet setup before saving, which is why the improvements in the commits are counted as lower). The vast majority of that is due to these changes, so presumably they'll help others with similar use cases (XML writing) using this module too.
I was recently asked to look in to the performance of
Spreadsheet::XLSX
. Profiling revealed that a significant amount of the overhead was from calls into theLibXML
module:(The blue indicates code that is in the current project - in this case, the
SpreadSheet::XLSX
module. The grey below it is external code, including modules, the Rakudo standard library, and so forth.)Looking a little more deeply into the hot spots, I produced a number of changes, where are included in this PR. I suggest reviewing the individual commits; in each I wrote the gain and what I perceive as the trade-off of the change, as for the most part I think they need a decision of whether it's an OK thing to do from the perspective of the module architecture.
Between this and one small improvement in
Spreadsheet::XLSX
, I'm currently seeing saving of a large worksheet in around half the time (my benchmark included startup and sheet setup before saving, which is why the improvements in the commits are counted as lower). The vast majority of that is due to these changes, so presumably they'll help others with similar use cases (XML writing) using this module too.