-4

I have a windows application(VB.net) which involves copying a huge number of files to a specified location, and performance is the issue i need to check on. I have two ways of doing this:File.Copy and other using Filestream. Which one of the above option is faster? and is there any other faster way to achieve this?

Trupti
  • 108
  • 2
  • 14
  • 2
    Why don't you do you own benchmark test and see which is faster? – Matt Wilko Jul 24 '12 at 12:28
  • I dont have enough time to test them both,though searched on net and found that File.Copy is relatively faster than filestreaming. – Trupti Jul 24 '12 at 12:32
  • 1
    Yet you have enough time to post the question and wait while someone else does the test for you? – Matt Wilko Jul 24 '12 at 12:37
  • `File.Copy` is a single method call; using `FileStream` relies on your code intelligently buffering and managing access. You need to have an implementation that uses `FileStream` before you can compare these directly. – Dan Puzey Jul 24 '12 at 12:53

1 Answers1

3

File.Copy is faster(*)








(*) Why would you trust a opinion in a forum? Instead of being here waiting for an answer you could be doing a test to see which method is faster

Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206