Bugzilla – Attachment 102490 Details for
Bug 79892
Performance regression between 3.6 and later version, triple time to do the calculations (win only)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
horrible prototype patch ...
one-item-textsearch-cache.diff (text/plain), 3.17 KB, created by
Michael Meeks
on 2014-07-09 17:23:11 UTC
(
hide
)
Description:
horrible prototype patch ...
Filename:
MIME Type:
Creator:
Michael Meeks
Created:
2014-07-09 17:23:11 UTC
Size:
3.17 KB
patch
obsolete
>diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx >index f024e6d..3245049 100644 >--- a/sc/inc/queryentry.hxx >+++ b/sc/inc/queryentry.hxx >@@ -61,6 +61,14 @@ struct SC_DLLPUBLIC ScQueryEntry > ScQueryEntry(const ScQueryEntry& r); > ~ScQueryEntry(); > >+ /// FIXME: TODO - cache needs managing, clearing on sets etc. >+ mutable OUString maCacheStr; >+ mutable bool mbCacheCaseSensitive, mbCacheMatch; >+ mutable sal_Int32 mnCacheStart, mnCacheEnd; >+ >+ bool SearchForward( bool bCaseSensitive, const rtl::OUString &rString, >+ sal_Int32 *nStart, sal_Int32 *nEnd ) const; >+ > /// creates pSearchParam and pSearchText if necessary, always RegExp! > utl::TextSearch* GetSearchTextPtr( bool bCaseSens ) const; > >diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx >index 959a919..af2077d 100644 >--- a/sc/source/core/data/table3.cxx >+++ b/sc/source/core/data/table3.cxx >@@ -1767,8 +1767,9 @@ public: > } > else > { >- bMatch = rEntry.GetSearchTextPtr( mrParam.bCaseSens ) >- ->SearchForward(aCellStr.getString(), &nStart, &nEnd); >+ bMatch = rEntry.SearchForward( mrParam.bCaseSens, >+ aCellStr.getString(), >+ &nStart, &nEnd ); > } > if ( bMatch && bMatchWholeCell > && (nStart != 0 || nEnd != aCellStr.getLength()) ) >diff --git a/sc/source/core/tool/queryentry.cxx b/sc/source/core/tool/queryentry.cxx >index 0b23da5..8a10853 100644 >--- a/sc/source/core/tool/queryentry.cxx >+++ b/sc/source/core/tool/queryentry.cxx >@@ -42,6 +42,10 @@ ScQueryEntry::ScQueryEntry() : > eConnect(SC_AND), > pSearchParam(NULL), > pSearchText(NULL), >+ mbCacheCaseSensitive(false), >+ mbCacheMatch(false), >+ mnCacheStart(-1), >+ mnCacheEnd(-1), > maQueryItems(1) > { > } >@@ -53,6 +57,10 @@ ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) : > eConnect(r.eConnect), > pSearchParam(NULL), > pSearchText(NULL), >+ mbCacheCaseSensitive(false), >+ mbCacheMatch(false), >+ mnCacheStart(-1), >+ mnCacheEnd(-1), > maQueryItems(r.maQueryItems) > { > } >@@ -79,6 +87,29 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r ) > return *this; > } > >+// FIXME: also consider SearchBackwards etc. etc. >+bool ScQueryEntry::SearchForward( bool bCaseSensitive, const rtl::OUString &rString, >+ sal_Int32 *pStart, sal_Int32 *pEnd ) const >+{ >+ static bool bSpeedup = getenv("GOFASTER"); >+ if (!bSpeedup || // then always do the slow path >+ mnCacheStart < 0 || // cache invalid >+ bCaseSensitive != mbCacheCaseSensitive || >+ rString != maCacheStr ) >+ { >+ maCacheStr = rString; >+ mnCacheStart = 0; >+ mnCacheEnd = maCacheStr.getLength(); >+ mbCacheCaseSensitive = bCaseSensitive; >+ >+ mbCacheMatch = GetSearchTextPtr( mbCacheCaseSensitive ) >+ ->SearchForward(maCacheStr, &mnCacheStart, &mnCacheEnd); >+ } >+ *pStart = mnCacheStart; >+ *pEnd = mnCacheEnd; >+ return mbCacheMatch; >+} >+ > void ScQueryEntry::SetQueryByEmpty() > { > eOp = SC_EQUAL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 79892
:
100836
|
100853
|
100921
|
100922
|
102314
|
102485
| 102490 |
102524
|
106629
|
112832