Skip to content

Changed I/O calls to be faster via caching and filtering instead of regenerating#12

Merged
uptudev merged 1 commit intorustfrom
rust-faster-io
Jan 10, 2025
Merged

Changed I/O calls to be faster via caching and filtering instead of regenerating#12
uptudev merged 1 commit intorustfrom
rust-faster-io

Conversation

@uptudev
Copy link
Copy Markdown
Owner

@uptudev uptudev commented Jan 10, 2025

print() would call fmt_header() and fmt_string() twice if file I/O was enabled. This reduces it to a single call each, and simply strips ANSI symbols via an O(n) char stripper.

When the `File` option was enabled, the logger would call `fmt_header()`
and `fmt_string()` twice to get plain output the second time. This
replaces those redundant calls with a simple ANSI code stripper, which
removes all characters in a string between and including an `\x1b` and
an `m` character.
@uptudev uptudev self-assigned this Jan 10, 2025
@uptudev uptudev added the enhancement New feature or request label Jan 10, 2025
@uptudev uptudev merged commit 1d37a9f into rust Jan 10, 2025
@uptudev uptudev deleted the rust-faster-io branch January 10, 2025 03:44
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

Successfully merging this pull request may close these issues.

1 participant