You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a rapidjson reader class there's some strange code:
template<typename Stream>
voidSkipWhitespace(Stream& stream)
{
Stream s = stream; // Use a local copy for optimizationwhile (s.Peek() == '' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
s.Take();
stream = s;
}
Why stream object is reassigned two times, what optimization this gives comparing to direct accessing it via reference? What if stream object copying is a heavy process by itself and also can cause an exception? What if I want to create stream class with non-copyable semantic? For me all of this is a clear pessimization instead of optimization.
The text was updated successfully, but these errors were encountered:
I have re-tested the impact after removal of these "optimizations". Results.
There is around 10%-20% overheads if disabling this "overhead".
I will try to add a switch which is specified by stream class.
https://code.google.com/p/rapidjson/issues/detail?id=78
In a rapidjson reader class there's some strange code:
Why stream object is reassigned two times, what optimization this gives comparing to direct accessing it via reference? What if stream object copying is a heavy process by itself and also can cause an exception? What if I want to create stream class with non-copyable semantic? For me all of this is a clear pessimization instead of optimization.
The text was updated successfully, but these errors were encountered: