-
Notifications
You must be signed in to change notification settings - Fork 54
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
String performance #252
String performance #252
Conversation
… the two arguments is rows and which is columns
…ad run time. + changed some .append() to += method calls because the were not implemented as appends but as +=
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine. Thanks for the PR! We can also later just use the new method and remove the old methods.
@MCWertGaming can you please also review & merge?
@TobiasWallner @certik Nice additions but I would vote to keep the old ones too because it seems it would be impossible to do : Term::terminal<<cursor_right(2); which I think could be useful |
…/cpp-terminal into string_performance
for more information, see https://pre-commit.ci
Hey! Thank you for the contributions. I have sadly trouble with the CI right now as they are not starting. @certik could it be possible that we have reached a resource limit of some kind? I'll look into reviewing and fixing the CI (if needed for this PR) when the CI runs again. |
I am not aware of any limits. Sometimes GitHub Actions don't work, so we can try tomorrow again. |
I just wondered because https://www.githubstatus.com is not showing any problems. But I'll review it tomorrow then, no worries ^^ |
Alright, the CI just started working again, but it seems like there are a few issues with the STL includes. I'll look into fixing them tomorrow then. |
…ng a typo that leads to a bug due to special character for example that are multiple symbols in the string but only one byte long
… the chance of an human error. Additionally added functions that write to an existing string for the color functions
…/cpp-terminal into string_performance
for more information, see https://pre-commit.ci
…/cpp-terminal into string_performance
I noticed a dumb mistake by me I had made in the code I wanted to push with this pull request. In my fork I have fixed this by changeing it to .append( "some string" , sizeof("some string")-1). The mistake came from miscounting special characters that start with '\' in the string. Furthermore I went with the same idea to write in existing strings in addition to createing new ones through color.hpp and color.cpp. I guess it would be probably best to reject this pull request and make a new one? |
I have to give my appologies for the many accidental contributions. I will try to deactivate this, because it is confuseing and makes this pull request unnecessary complicated. |
A good git practice is that you don't push into the |
It's also possible to use "cherry pick" to move a specific commit from one branch into another, so that the PR branch keeps being clean ^^ I'll close this PR then for now. We would be really greatful when you would take your time and prepare a new PR @TobiasWallner. Tell us if you need help with anything. |
I will try, thank you for the motivateing words. Background if interrested: I am doing a university project and part of that includes makeing a GUI. Your library looked very cool and so I decided to make my project completelly in the terminal using your codebase. |
That sounds really cool! I personally am using this library for playing around with game prototypes and doing a few smaller CLI tools for myself ^^ I hope it works out for your project. If you need anything, feel free to open Issues and just ask away. The library is currently in heavy WIP, so there will be a few changes, I hope that we can get into a proper API design soon to make a final V1 release and then proceed with additional modifications on V2 separately so that updates on the API doesn't affect all projects that use this libraries. |
I did not delete any functions or methods (I state that because 'git diff' markes some as deleted but it just did not realise that they only changed lines). I only added functions that unlike the old ones do not create new std::strings but write into an existing one that can be pre-allocated.
This may also be beneficial to the issue #186 improve the rendering performance by avoiding calls to malloc.
Furthermore I added the variable names 'row' and 'column' to the cursor constructor so that the programmer can quickly see from a look into the header (or the IDEs pop up) which argument belongs to which dimension.