You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we read a whole file content into memory using ReadAllText method and then call method ProcessInMemmory which verify if a length of the string exceded specified threshold:
Fact, that we perform this operation in a loop, for each file trouble me a little bit.
Potentially this could create memory pressure.
Describe the solution you'd like
What if before reading the whole file into memory we will check the actual file size and only after that decide proceed file or not.
I think this could be achieved using FileInfo.Length property.
What do you think of this?
Feel free to correct me if I'm mistaken or didn't notice something.
Have a nice day!
The text was updated successfully, but these errors were encountered:
Fantastic catch. Note the reason the ProcessAsFile turns around and calls ProcessInMemory is to optimized the core processing logic that is used for both compressed and uncompressed files but by placing the file size check in the Run loop I can avoid opening those large files to begin with. I do have to check again for files once decompressed but that is far better than reading large files then finding out we didn't want to. Hopefully this will improve results for #103 and #91.
Hello!
Thank's for this project. I found it useful! You guys did a great job!
Is your feature request related to a problem? Please describe.
Some people faced with an OutOfMemmoryException during the execution of AnalyzeCommand
#103, #91 .
I dived into this class(AnalyzeCommand.cs) and find a code, that I think could be improved.
I'm talking about method
ProcessAsFile(string filename)
in AnalyzeCommand.cs.I'm confused with these lines:
Here we read a whole file content into memory using
ReadAllText
method and then call methodProcessInMemmory
which verify if a length of the string exceded specified threshold:Fact, that we perform this operation in a loop, for each file trouble me a little bit.
Potentially this could create memory pressure.
Describe the solution you'd like
What if before reading the whole file into memory we will check the actual file size and only after that decide proceed file or not.
I think this could be achieved using FileInfo.Length property.
What do you think of this?
Feel free to correct me if I'm mistaken or didn't notice something.
Have a nice day!
The text was updated successfully, but these errors were encountered: