-
Notifications
You must be signed in to change notification settings - Fork 58
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
Test windows performances #207
Comments
That the terminal is pretty slow compared to linux can be seen in https://github.com/MCWertGaming/Furdevs-Chess. It's a small program I did in two weeks for a game jam. The drawing performance is pretty poor - while I draw the whole frame every time, which isn't ideal but I had to less time for optimizing that. What I personally need is a renderer which is capable of updating the screen without the flashing you'll notice in my program on windows. |
ok thank I will try with the windows API for terminal and see if there is improvements |
We can improve std::cout performance by optionally disabling the printf compatibility. I think that this plus an efficient rendering algorythm in the window class would do the trick. |
I have some more time now and think that I'll make a Fork to implement #213 and look into finding a way to make real time applications / rendering usable on windows as well. I'll contribute it into cpp-terminal then when it's working ^^ |
It seems the cout is not buffered on windows or some strange thing like this.. i found some function to turn it on but i didn't check the performance.. would be nice to have a special test for this... A very difficult screen to fill with many colors etc to have some benchmark |
std::cout in MSVC is slow (https://web.archive.org/web/20170329163751/https://connect.microsoft.com/VisualStudio/feedback/details/642876/std-wcout-is-ten-times-slower-than-wprintf-performance-bug-in-c-library). "It is an unfortunate consequence of how our C and C++ Standard Library implementations are designed. The problem is that when printing to the console (instead of, say, being redirected to a file), neither our C nor C++ I/O are buffered by default. This is sometimes concealed by the fact that C I/O functions like printf() and puts() temporarily enable buffering while doing their work" Microsoft suggests this fix (to enable buffering on cout/stdout): setvbuf(stdout, 0, _IOLBF, 4096) |
Oh, seems nice! I'll make a small animation of some sort as example for this. |
I mean just rendering performance is not the only thing I need, some kind of centering of the content and resizing would be a nice addition, but I'm not yet sure how to implement something like that in a universal renderer. But having a constant rendering performance and some simple interface for interacting with a rendering buffer (the Window class) would be a nice start! |
@MCWertGaming Yes, it's just the start of the story but if this can improve some performance it would be great to add it. |
Of course, we'll implement it |
@MCWertGaming You mentioned last time the Microsoft Windows terminal was quite slow.. Could you provide some code showing this ? I found some windows api to write to console... maybe it would be faster but this need some tests.
The text was updated successfully, but these errors were encountered: