Skip to content
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

Coloring the output makes it slow #1

Open
ChrisVilches opened this issue Oct 21, 2024 · 0 comments
Open

Coloring the output makes it slow #1

ChrisVilches opened this issue Oct 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ChrisVilches
Copy link
Owner

ChrisVilches commented Oct 21, 2024

(It's not significant, so it's low priority)

Can be compared like so:

cpdiff -d --color=1 big_file big_file
cpdiff -d --color=0 big_file big_file

My test was a 100000 line file (used the same file for both left and right side).

Average times:
With color: 650ms
Without color: 280ms

I tried changing code inside the coloring library, but it doesn't make it faster at all.
Also, even with --color=1, if I remove the line that applies color, it becomes faster. So the issue is the coloring library (it probably does some checks to ensure it complies with multiple platforms, so that's why I don't want to create my own coloring library). Maybe try using a different one.

@ChrisVilches ChrisVilches added the enhancement New feature or request label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant