-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensor CXX performance #2206
Comments
Hi @MarcoWagner, maybe you can turn on debug info and isolate the problem:
Regards, |
its #2131 |
Hi @MarcoWagner, could you provide a sample please? Regards, |
#include <iostream>
#include <string>
#include <sstream>
std::ostream& operator< (std::ostream& dest, const std::string& what) {
return dest;
}
int main ()
{
std::string a, b, c, d, e, f;
std::stringstream dest;
dest < a < b < c < d < e < f;
} Seems to be O(n!) That this code is inside a wxWidgets project is just a coincidence |
Hi @MarcoWagner, I’m wondering why someone creates an own streaming operator with <? Why not writing <<? The problem is in the grammar where has to be decided if something like this is a conditional expression or a cascaded template. This construct leads to a lot of backtracking and slow speed. Found up to now no solution to speed that up. The case where something like this ends up in a template is more likely and fast. Ideas are welcome. Regards, |
I also don't like that Maybe the parser can detect this construct, warn and skip over? |
duplicate #2131 |
@MarcoWagner: i also have a wxWidgets based project with interesting stats.
~150k LoC
INFO: Sensor CXX [cxx] (done) | time=5.475.497ms
The text was updated successfully, but these errors were encountered: