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

AP_Filesystem: make fgets() much more efficient #27513

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

peterbarker
Copy link
Contributor

normally fgets is on a buffered FILE handle. For AP_Filesystem we use an unbuffered file descriptor. This means we were reading one byte at a time from the file

this uses lseek to make fgets() much more efficient by reading the max buffer size at a time in the file

Extracted #27504

normally fgets is on a buffered FILE handle. For AP_Filesystem we use
an unbuffered file descriptor. This means we were reading one byte at
a time from the file

this uses lseek to make fgets() much more efficient by reading the max
buffer size at a time in the file
@tridge tridge force-pushed the pr/fgets-efficient branch from d96323d to 9cece93 Compare July 10, 2024 03:24
@tridge
Copy link
Contributor

tridge commented Jul 10, 2024

@peterbarker updated to check lseek at end

@peterbarker peterbarker merged commit c2e52af into ArduPilot:master Jul 10, 2024
92 checks passed
@peterbarker peterbarker deleted the pr/fgets-efficient branch July 10, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants