Skip to content

made FileManager store File and not open it each time#23

Merged
DobbiKov merged 1 commit intomasterfrom
dev
May 19, 2025
Merged

made FileManager store File and not open it each time#23
DobbiKov merged 1 commit intomasterfrom
dev

Conversation

@DobbiKov
Copy link
Owner

Overview

As mentioned in the #9 the logic of writing to a file has been changed. Before, each time we wrote a log to file, we opened the file, wrote a log, closed the file.

This pull request changes this logic to storing the file in the memory (so it opens once), and closes only on rotation or when the application closes.

Performance comparison

Printing 10000 logs and writing to a file

Before:

Time elapsed: 239.863125ms

After:

Time elapsed: 69.116042ms

Printing 1 million logs and writing to a file

Before:

Time elapsed: 21.669482208s

After:

Time elapsed: 5.41291075s


@DobbiKov DobbiKov merged commit ed68933 into master May 19, 2025
2 checks passed
@DobbiKov DobbiKov mentioned this pull request May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant