<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Calc: Slow load of cells with VLOOKUP with references to empty cells"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=121052">121052</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Calc: Slow load of cells with VLOOKUP with references to empty cells
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Calc
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>serge.krot@cib.de
</td>
</tr></table>
<p>
<div>
<pre>Calc uses ScDocRowHeightUpdater::update() method during load. Inside this
method the document is being recalculated to get height of the cells with real
cell values. The document has 2 tables (each table has 2 columns):
Table-1:
A,B
101,VLOOKUP(A1,X1:Z255,2,0)
102,VLOOKUP(A2,X1:Z255,2,0)
103,VLOOKUP(A3,X1:Z255,2,0)
...
199,VLOOKUP(A199,X1:Z255,2,0)
Table-2:
X,Z
1,Product1
2,Product2
3,Product3
...
255,Product255
After load the first table has following visible values:
A,B
101,Product1
102,Product2
103,Product3
...
199,Product199
Now, if we take the same document but the whole A column is empty, the document
will be loaded very slow comparing to the document that contains data.
The problem:
* Calculation of the VLOOKUP is too slow when no data is provided
Useful link:
*
<a href="https://help.libreoffice.org/6.2/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3153152">https://help.libreoffice.org/6.2/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3153152</a>
- VLOOKUP documentation
Typical call stack:
[External Code]
<span class="quote">> [Inline Frame] sal3.dll!rtl_uString_ImplAlloc(long) Line 1146 C++</span >
sal3.dll!rtl_uString_new_WithLength(_rtl_uString * * ppThis, long nLen)
Line 1263 C++
[Inline Frame] svllo.dll!rtl::OUStringBuffer::{ctor}() Line 71 C++
svllo.dll!SvNumberformat::GetOutputString(double fNumber, rtl::OUString
& OutString, Color * * ppColor) Line 2392 C++
svllo.dll!SvNumberFormatter::GetInputLineString(const double &
fOutNumber, unsigned long nFIndex, rtl::OUString & sOutString) Line 1557 C++
sclo.dll!ScCellFormat::GetInputString(ScRefCellValue & rCell, unsigned
long nFormat, rtl::OUString & rString, SvNumberFormatter & rFormatter, const
ScDocument * pDoc) Line 151 C++
sclo.dll!`anonymous
namespace'::QueryEvaluator::compareByString(ScRefCellValue & rCell, long nRow,
const ScQueryEntry & rEntry, const ScQueryEntry::Item & rItem, const
ScInterpreterContext * pContext) Line 2497 C++
sclo.dll!ScTable::ValidQuery(long nRow, const ScQueryParam & rParam,
const ScRefCellValue * pCell, bool * pbTestEqualCondition, const
ScInterpreterContext * pContext) Line 2804 C++
sclo.dll!ScQueryCellIterator::GetThis() Line 1176 C++
sclo.dll!lcl_LookupQuery(ScAddress & o_rResultPos, ScDocument * pDoc,
const ScInterpreterContext & rContext, const ScQueryParam & rParam, const
ScQueryEntry & rEntry) Line 9640 C++
sclo.dll!ScInterpreter::LookupQueryWithCache(ScAddress & o_rResultPos,
const ScQueryParam & rParam) Line 9677 C++
sclo.dll!ScInterpreter::CalculateLookup(bool bHLookup) Line 7356
C++
sclo.dll!ScInterpreter::ScVLookup() Line 7432 C++
sclo.dll!ScInterpreter::Interpret() Line 4203 C++
sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext,
ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1868 C++
sclo.dll!ScFormulaCell::Interpret() Line 1579 C++
[Inline Frame] sclo.dll!ScFormulaCell::MaybeInterpret() Line 2674
C++
sclo.dll!ScFormulaCell::GetErrCode() Line 2918 C++
sclo.dll!ScCellFormat::GetString(ScRefCellValue & rCell, unsigned long
nFormat, rtl::OUString & rString, Color * * ppColor, SvNumberFormatter &
rFormatter, const ScDocument * pDoc, bool bNullVals, bool bFormula, bool
bUseStarFormat) Line 79 C++
sclo.dll!ScCellFormat::GetString(ScDocument & rDoc, const ScAddress &
rPos, unsigned long nFormat, Color * * ppColor, SvNumberFormatter & rFormatter,
bool bNullVals, bool bFormula) Line 117 C++
sclo.dll!ScDocument::GetCellScriptType(const ScAddress & rPos, unsigned
long nNumberFormat) Line 120 C++
sclo.dll!ScDocument::GetScriptType(short nCol, long nRow, short nTab)
Line 149 C++
sclo.dll!ScColumn::GetNeededSize(long nRow, OutputDevice * pDev, double
nPPTX, double nPPTY, const Fraction & rZoomX, const Fraction & rZoomY, bool
bWidth, const ScNeededSizeOptions & rOptions, const ScPatternAttr * *
ppPatternChange) Line 249 C++
sclo.dll!ScColumn::GetOptimalHeight(sc::RowHeightContext & rCxt, long
nStartRow, long nEndRow, unsigned short nMinHeight, long nMinStart) Line 949
C++
sclo.dll!`anonymous
namespace'::GetOptimalHeightsInColumn(sc::RowHeightContext & rCxt,
ScColContainer & rCol, long nStartRow, long nEndRow, ScProgress * pProgress,
unsigned long nProgressStart) Line 123 C++
sclo.dll!ScTable::SetOptimalHeight(sc::RowHeightContext & rCxt, long
nStartRow, long nEndRow, ScProgress * pOuterProgress, unsigned long
nProgressStart) Line 480 C++
sclo.dll!ScDocRowHeightUpdater::update() Line 2589 C++
sclo.dll!ScXMLImport::endDocument() Line 1809 C++
expwraplo.dll!sax_fastparser::FastSaxParserImpl::parseStream(const
com::sun::star::xml::sax::InputSource & rStructSource) Line 876 C++
expwraplo.dll!sax_fastparser::FastSaxParser::parseStream(const
com::sun::star::xml::sax::InputSource & aInputSource) Line 1378 C++
xolo.dll!SvXMLImport::parseStream(const
com::sun::star::xml::sax::InputSource & aInputSource) Line 485 C++
sclo.dll!ScXMLImportWrapper::ImportFromComponent(const
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> &
xContext, const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &
xModel, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XParser>
& xParser, com::sun::star::xml::sax::InputSource & aParserInput, const
rtl::OUString & sComponentName, const rtl::OUString & sDocName, const
rtl::OUString & sOldDocName, const
com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aArgs, bool
bMustBeSuccessfull) Line 190 C++
sclo.dll!ScXMLImportWrapper::Import(ImportFlags nMode, ErrCode &
rError) Line 512 C++
[Inline Frame] sclo.dll!ErrCode::operator bool() Line 85 C++
sclo.dll!ScDocShell::LoadXML(SfxMedium * pLoadMedium, const
com::sun::star::uno::Reference<com::sun::star::embed::XStorage> & xStor) Line
501 C++
sclo.dll!ScDocShell::Load(SfxMedium & rMedium) Line 660 C++
sfxlo.dll!SfxObjectShell::LoadOwnFormat(SfxMedium & rMedium) Line 3056
C++
sfxlo.dll!SfxObjectShell::DoLoad(SfxMedium * pMed) Line 725 C++
sfxlo.dll!SfxBaseModel::load(const
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &
seqArguments) Line 1795 C++
sfxlo.dll!`anonymous namespace'::SfxFrameLoader_Impl::load(const
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs,
const com::sun::star::uno::Reference<com::sun::star::frame::XFrame> &
_rTargetFrame) Line 688 C++
fwklo.dll!framework::LoadEnv::impl_loadContent() Line 1152 C++
fwklo.dll!framework::LoadEnv::startLoading() Line 387 C++
fwklo.dll!framework::LoadDispatcher::impl_dispatch(const
com::sun::star::util::URL & rURL, const
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &
lArguments, const
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener>
& xListener) Line 110 C++
fwklo.dll!framework::LoadDispatcher::dispatch(const
com::sun::star::util::URL & aURL, const
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &
lArguments) Line 52 C++
sfxlo.dll!sfx2::RecentDocsView::ExecuteHdl_Impl(sfx2::RecentDocsView *
__formal, void * p) Line 393 C++
[Inline Frame] vcllo.dll!Link<void *,void>::Call(void *) Line 84
C++
[Inline Frame] vcllo.dll!ImplHandleUserEvent(ImplSVEvent *) Line 1929
C++
vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent,
const void * pEvent) Line 2482 C++
vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent)
Line 280 C++
[Inline Frame] vclplug_winlo.dll!ImplHandleUserEvent(HWND__ *) Line
4071 C++
vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg,
unsigned int wParam, long lParam, bool & rDef) Line 5724 C++
vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg,
unsigned int wParam, long lParam) Line 5832 C++
[External Code]
[Inline Frame] vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG *)
Line 409 C++
vclplug_winlo.dll!ImplSalYield(bool bWait, bool
bHandleAllCurrentEvents) Line 440 C++
vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool
bHandleAllCurrentEvents) Line 511 C++
[Inline Frame] vcllo.dll!ImplYield(bool) Line 469 C++
[Inline Frame] vcllo.dll!Application::Yield() Line 537 C++
vcllo.dll!Application::Execute() Line 449 C++
sofficeapp.dll!desktop::Desktop::Main() Line 1637 C++
vcllo.dll!ImplSVMain() Line 199 C++
sofficeapp.dll!soffice_main() Line 169 C++
[Inline Frame] soffice.bin!sal_main() Line 48 C
[Inline Frame] soffice.bin!main(int) Line 47 C
soffice.bin!WinMain(void * _hinst, void * _dummy, char * _cmdline, int
_nshow) Line 47 C
[External Code]</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>