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

Speed up listing files in large directory, README.adoc typo fixed #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dikdom
Copy link

@dikdom dikdom commented Apr 19, 2021

When calling the ::openNextFile(), it iterates though the current directory one by one and when it find a usable return value (file or directory) tried to create a new SdFile instance by name which scans the whole directory again for that file. Though the entry is already found by the openNextFile().
Index is calculated based on current file position and SdFile is created based on index.

@github-actions
Copy link

Memory usage change @ a23ede4

Board flash % RAM for global variables %
arduino:avr:leonardo 🔺 0 - +182 0.0 - +0.63 0 - 0 0.0 - 0.0
arduino:avr:mega 🔺 0 - +182 0.0 - +0.07 0 - 0 0.0 - 0.0
arduino:avr:nano 🔺 0 - +182 0.0 - +0.59 0 - 0 0.0 - 0.0
arduino:mbed_nano:nano33ble 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 0 - +88 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 🔺 0 - +182 0.0 - +0.37 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 🔺 0 - +80 0.0 - +0.02 N/A N/A
arduino:samd:mkrzero 🔺 0 - +92 0.0 - +0.04 0 - 0 0.0 - 0.0
Click for full report table
Board examples/CardInfo
flash
% examples/CardInfo
RAM for global variables
% examples/Datalogger
flash
% examples/Datalogger
RAM for global variables
% examples/DumpFile
flash
% examples/DumpFile
RAM for global variables
% examples/Files
flash
% examples/Files
RAM for global variables
% examples/NonBlockingWrite
flash
% examples/NonBlockingWrite
RAM for global variables
% examples/ReadWrite
flash
% examples/ReadWrite
RAM for global variables
% examples/listfiles
flash
% examples/listfiles
RAM for global variables
%
arduino:avr:leonardo 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 182 0.63 0 0.0
arduino:avr:mega 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 182 0.07 0 0.0
arduino:avr:nano 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 182 0.59 0 0.0
arduino:mbed_nano:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 64 0.01 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 88 0.0 0 0.0
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 64 0.01 0 0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 64 0.01 0 0.0
arduino:megaavr:nona4809 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 182 0.37 0 0.0
arduino:sam:arduino_due_x_dbg 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 80 0.02 N/A N/A
arduino:samd:mkrzero 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 92 0.04 0 0.0
Click for full report CSV
Board,examples/CardInfo<br>flash,%,examples/CardInfo<br>RAM for global variables,%,examples/Datalogger<br>flash,%,examples/Datalogger<br>RAM for global variables,%,examples/DumpFile<br>flash,%,examples/DumpFile<br>RAM for global variables,%,examples/Files<br>flash,%,examples/Files<br>RAM for global variables,%,examples/NonBlockingWrite<br>flash,%,examples/NonBlockingWrite<br>RAM for global variables,%,examples/ReadWrite<br>flash,%,examples/ReadWrite<br>RAM for global variables,%,examples/listfiles<br>flash,%,examples/listfiles<br>RAM for global variables,%
arduino:avr:leonardo,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,182,0.63,0,0.0
arduino:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,182,0.07,0,0.0
arduino:avr:nano,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,182,0.59,0,0.0
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,88,0.0,0,0.0
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0
arduino:megaavr:nona4809,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,182,0.37,0,0.0
arduino:sam:arduino_due_x_dbg,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,80,0.02,N/A,N/A
arduino:samd:mkrzero,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,92,0.04,0,0.0

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Apr 17, 2022
mcaldwelva added a commit to mcaldwelva/SD that referenced this pull request Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants