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

kernel: make printing strings with ANSI SGR escapes faster #7092

Merged

Conversation

frazze-jobb
Copy link
Contributor

Printing a long string with ANSI escapes is very slow on Erlang/OTP 26 RC2 which is caused by calling re:run/3 nifs a bunch of times. Compiling the regex did not make it fast enough, so SGR (Select Graphic Rendition) escapes are dealt separately with an erlang function which is what most people use escapes for. See #7040

@frazze-jobb frazze-jobb added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI bug Issue is reported as a bug labels Apr 5, 2023
@frazze-jobb frazze-jobb self-assigned this Apr 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

CT Test Results

       2 files       65 suites   1h 5m 1s ⏱️
1 464 tests 1 233 ✔️ 229 💤 2
1 652 runs  1 377 ✔️ 273 💤 2

For more details on these failures, see this check.

Results for commit cf4241b.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

Printing a long string with ANSI escapes is very slow on Erlang/OTP 26 RC2
which is caused by calling re:run/3 nifs a bunch of times.
Compiling the regex did not make it fast enough, so SGR
(Select Graphic Rendition) escapes are dealt separately with an erlang
function which is what most people use escapes for.
See erlang#7040
@frazze-jobb frazze-jobb force-pushed the frazze/kernel/faster_re_sgr_escapes branch from aade90c to cf4241b Compare April 5, 2023 09:51
@frazze-jobb frazze-jobb merged commit 702b0b8 into erlang:master Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant