diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-17 23:34:11 -0400 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-09-19 17:03:25 +0200 |
commit | 8f0a558f580516a4810552060c3da69ff6e2aa23 (patch) | |
tree | 149ee6594add2693ef2b36eb569e7befd5764dbe | |
parent | 05f6ae8779f9be59b1262bcbb98a74b6383c0c18 (diff) |
In xlsx, a better heuristic is based on worksheet dimension.
And start OpenCL kernel compilation right away if the dimension is
large enough to make the sheet import slow.
Change-Id: Iee3e8dc1f0cb64eb1d8778db19c6edd73e971136
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheetfragment.cxx | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index cc8a50a8492e..21e383fe97b7 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -65,7 +65,6 @@ void FormulaBuffer::finalizeImport() FormulaDataMap::iterator cellIt = maCellFormulas.find( nTab ); if ( cellIt != maCellFormulas.end() ) { - compileOpenCLKernels(); applyCellFormulas( cellIt->second ); } diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx index b8ad65832889..93cacd77d971 100644 --- a/sc/source/filter/oox/worksheetfragment.cxx +++ b/sc/source/filter/oox/worksheetfragment.cxx @@ -511,7 +511,16 @@ void WorksheetFragment::importDimension( const AttributeList& rAttribs ) be set. If the cell A1 exists, the used area will be updated while importing the cell. */ if( (aRange.EndColumn > 0) || (aRange.EndRow > 0) ) + { extendUsedArea( aRange ); + + // Start pre-compiling OpenCL kernels if we have a large number of + // cells to import. The current threshold is 100,000. + double fCellCount = aRange.EndColumn - aRange.StartColumn + 1.0; + fCellCount *= aRange.EndRow - aRange.StartRow + 1.0; + if (fCellCount > 100000.0) + compileOpenCLKernels(); + } } void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs ) |