From db92a8cbea78d0481d1349f9e4e49c29010514b2 Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 17 Aug 2011 11:09:00 -0700 Subject: EXP-700 FIX SLPlugin(s) takes high CPU% Reviewed by Richard. --- indra/llcommon/llsdserialize_xml.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index d8213c4477..bf216d41bf 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -720,6 +720,7 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) case ELEMENT_INTEGER: { S32 i; + // sscanf okay here with different locales - ints don't change for different locale settings like floats do. if ( sscanf(mCurrentContent.c_str(), "%d", &i ) == 1 ) { // See if sscanf works - it's faster value = i; @@ -733,15 +734,19 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) case ELEMENT_REAL: { - F64 r; - if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 ) - { // See if sscanf works - it's faster - value = r; - } - else - { - value = LLSD(mCurrentContent).asReal(); - } + value = LLSD(mCurrentContent).asReal(); + // removed since this breaks when locale has decimal separator that isn't '.' + // investigated changing local to something compatible each time but deemed higher + // risk that just using LLSD.asReal() each time. + //F64 r; + //if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 ) + //{ // See if sscanf works - it's faster + // value = r; + //} + //else + //{ + // value = LLSD(mCurrentContent).asReal(); + //} } break; -- cgit v1.2.3 From ff46a6f42301218dcc14945feed65109a9bb71b4 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 18 Aug 2011 13:59:38 -0700 Subject: EXP-1107 FIX Crash in LLFastTimer::NamedTimer::accumulateTimings --- indra/llcommon/llsdserialize.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 6610daa1e0..bf62600514 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -313,10 +313,8 @@ LLSDParser::LLSDParser() LLSDParser::~LLSDParser() { } -LLFastTimer::DeclareTimer FTM_SD_PARSE("LLSD Parsing"); S32 LLSDParser::parse(std::istream& istr, LLSD& data, S32 max_bytes) { - LLFastTimer _(FTM_SD_PARSE); mCheckLimits = (LLSDSerialize::SIZE_UNLIMITED == max_bytes) ? false : true; mMaxBytesLeft = max_bytes; return doParse(istr, data); -- cgit v1.2.3