Kaydet (Commit) 295b97b2 authored tarafından Michael Meeks's avatar Michael Meeks

fdo#76260 - Switch from vector to std::stack.

std::stack uses std::deque which is extremely expensive for this case.
This change saves 43bn of 98bn cycles spent in createFastChildContext.

Change-Id: I63919a9826563171f128e09d7206ac6cfdde336f
üst 9e5e9dd1
...@@ -179,7 +179,7 @@ bool OOXMLFastContextHandler::prepareMceContext(Token_t nElement, const uno::Ref ...@@ -179,7 +179,7 @@ bool OOXMLFastContextHandler::prepareMceContext(Token_t nElement, const uno::Ref
m_bDiscardChildren = false; m_bDiscardChildren = false;
aState.m_bTookChoice = m_bTookChoice; aState.m_bTookChoice = m_bTookChoice;
m_bTookChoice = false; m_bTookChoice = false;
m_aSavedAlternateStates.push(aState); m_aSavedAlternateStates.push_back(aState);
} }
break; break;
case OOXML_Choice: case OOXML_Choice:
...@@ -241,8 +241,8 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) ...@@ -241,8 +241,8 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception)
m_bDiscardChildren = false; m_bDiscardChildren = false;
else if (Element == (NS_mce | OOXML_AlternateContent)) else if (Element == (NS_mce | OOXML_AlternateContent))
{ {
SavedAlternateState aState(m_aSavedAlternateStates.top()); SavedAlternateState aState(m_aSavedAlternateStates.back());
m_aSavedAlternateStates.pop(); m_aSavedAlternateStates.pop_back();
m_bDiscardChildren = aState.m_bDiscardChildren; m_bDiscardChildren = aState.m_bDiscardChildren;
m_bTookChoice = aState.m_bTookChoice; m_bTookChoice = aState.m_bTookChoice;
} }
......
...@@ -290,7 +290,7 @@ private: ...@@ -290,7 +290,7 @@ private:
uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< uno::XComponentContext > m_xContext;
bool m_bDiscardChildren; bool m_bDiscardChildren;
bool m_bTookChoice; ///< Did we take the Choice or want Fallback instead? bool m_bTookChoice; ///< Did we take the Choice or want Fallback instead?
std::stack<SavedAlternateState> m_aSavedAlternateStates; std::vector<SavedAlternateState> m_aSavedAlternateStates;
static sal_uInt32 mnInstanceCount; static sal_uInt32 mnInstanceCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment