Issue |
145205
|
Summary |
[CPP] sync_with_stdio(false) has no effect on std::cout's speed
|
Labels |
new issue
|
Assignees |
|
Reporter |
saksham-joshi
|
### I compiled the below code using ```clang++``` and ```g++```.
### Time Taken
> Clang++: ```1.2 sec```
> G++ : ```.005 sec```
```cpp
#include<iostream>
int main ( void )
{
std::ios_base::sync_with_stdio( false );
std::cout.tie( nullptr );
for(unsigned int i = 0 ; i < 10000 ; ++i)
{
std::cout << i << '\n';
}
return 0;
}
```
### then I replaced std::cout with printf and then the time taken:
> Clang++: ```0.256 sec```
> G++ : ```0.249 sec```
## 🟡Anyone, please try to optimize std::cout which matches the speed of ```g++```.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs