[CSHARP-427] MongoGridFS.Download() should allow skipping MD5 calculations Created: 02/Apr/12  Updated: 02/Apr/15  Resolved: 04/Apr/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 1.4.1

Type: New Feature Priority: Minor - P4
Reporter: Aristarkh Zagorodnikov Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-407 Allow disabling filemd5 call on gridf... Closed

 Description   

I believe that MongoGridFS.Download() overloads should allow ignoring MD5 sum altogether (not hashing at all) for performance reasons. This, of course, should be an "opt-out" flag, with default still validating MD5 sums.
A little backstory: while there is a GridFS module for nginx, we would prefer using .NET backend to nginx w/caching for now, since nginx-gridfs is a bit limited in functionality we require and is based off the MongoDB C driver that is very limited in functionality also, so we can't easily extend the module for our needs. It turned out that MD5 calculcations in .NET takes most of the CPU time for our GridFS "server", and we would not like to "hack" around the API or access collections directly to skip MD5 computations. To emphasize that this is not recommended, maybe the there should be another method instead of a flag, for example MongoGridFS.DownloadUnsafe().



 Comments   
Comment by Aristarkh Zagorodnikov [ 05/Apr/12 ]

Thanks for the improvement!

Comment by Robert Stam [ 04/Apr/12 ]

Added UpdateMD5 and VerifyMD5 flags to MongoGridFSSettings so that an application can control whether it wants the MD5 hash updated when a file is uploaded or modified and whether it wants the MD5 verified when a file is uploaded or downloaded.

Generated at Wed Feb 07 21:36:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.