473,850 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help on File.Copy speed

Hi All,

Does somebody know why File.Copy function is 10 times slower than standard
windows drag and drop copy between folders, when I copy files over the
network?
Actually, I need to copy files from one computer to another over a 1GBit
ethernet network as fast as I can. Although windows copy works at %40
performance, File.Copy could not go further than %4.

What could be the reason? What would be the best solution; is it feasible to
use the win32 API functions instead? or is there an undocumented property of
the Copy method somewhere in the framework?

Please help ASAP.

TIA
Adnan


Nov 17 '05 #1
4 3519
Hi,

It's weird that performance penalty, you may experience some but no so
drastic.

I bet that what File.Copy does is call the Win32 API to do the real job , so
I see no real improvement if you call it directly.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"adnan boz" <ab*********@ho tmail.com> wrote in message
news:e%******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi All,

Does somebody know why File.Copy function is 10 times slower than standard
windows drag and drop copy between folders, when I copy files over the
network?
Actually, I need to copy files from one computer to another over a 1GBit
ethernet network as fast as I can. Although windows copy works at %40
performance, File.Copy could not go further than %4.

What could be the reason? What would be the best solution; is it feasible
to
use the win32 API functions instead? or is there an undocumented property
of
the Copy method somewhere in the framework?

Please help ASAP.

TIA
Adnan


Nov 17 '05 #2
Hi,

It's weird that performance penalty, you may experience some but no so
drastic.

I bet that what File.Copy does is call the Win32 API to do the real job , so
I see no real improvement if you call it directly.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"adnan boz" <ab*********@ho tmail.com> wrote in message
news:e%******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi All,

Does somebody know why File.Copy function is 10 times slower than standard
windows drag and drop copy between folders, when I copy files over the
network?
Actually, I need to copy files from one computer to another over a 1GBit
ethernet network as fast as I can. Although windows copy works at %40
performance, File.Copy could not go further than %4.

What could be the reason? What would be the best solution; is it feasible
to
use the win32 API functions instead? or is there an undocumented property
of
the Copy method somewhere in the framework?

Please help ASAP.

TIA
Adnan


Nov 17 '05 #3
Both File.Copy and Win32 Copy should be equaly fast.

Willy.

"adnan boz" <ab*********@ho tmail.com> wrote in message
news:e%******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi All,

Does somebody know why File.Copy function is 10 times slower than standard
windows drag and drop copy between folders, when I copy files over the
network?
Actually, I need to copy files from one computer to another over a 1GBit
ethernet network as fast as I can. Although windows copy works at %40
performance, File.Copy could not go further than %4.

What could be the reason? What would be the best solution; is it feasible
to
use the win32 API functions instead? or is there an undocumented property
of
the Copy method somewhere in the framework?

Please help ASAP.

TIA
Adnan


Nov 17 '05 #4
Both File.Copy and Win32 Copy should be equaly fast.

Willy.

"adnan boz" <ab*********@ho tmail.com> wrote in message
news:e%******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi All,

Does somebody know why File.Copy function is 10 times slower than standard
windows drag and drop copy between folders, when I copy files over the
network?
Actually, I need to copy files from one computer to another over a 1GBit
ethernet network as fast as I can. Although windows copy works at %40
performance, File.Copy could not go further than %4.

What could be the reason? What would be the best solution; is it feasible
to
use the win32 API functions instead? or is there an undocumented property
of
the Copy method somewhere in the framework?

Please help ASAP.

TIA
Adnan


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3500
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed Pentagjetvedeh karuvificials madhla reachathe strategy in karkun campaign deshatinst terrorism. "mudivae maretu winning or losing karkun global varti jetvedeh terror?" Mr. Rumsfeld adugued in a recent memormariyuum. vede velli jetvedeh madhla...
5
3543
by: ArShAm | last post by:
Hi there Please help me to optimize this code for speed I added /O2 to compiler settings I added /Oe to compiler settings for accepting register type request , but it seems that is not allowed and if I remove register type for "l" , time of generating codes doesn't change the original code makes some files , but I removed that section to make it simple for you to read please help me to optimize it for faster running
9
4075
by: Arnold | last post by:
I need to read a binary file and store it into a buffer in memory (system has large amount of RAM, 2GB+) then pass it to a function. The function accepts input as 32 bit unsigned longs (DWORD). I can pass a max of 512 words to it at a time. So I would pass them in chunks of 512 words until the whole file has been processed. I haven't worked with binary files before so I'm confused with how to store the binary file into memory. What sort of...
17
1984
by: VM | last post by:
In my Windows app, I'm running a batch process that's composed of a FOR loop that'll run 15,000 times (datatable row count), copy cthe data of each row -3 fields- to a struct, and send the strct to an external method (using DLLImport). The problem is that the processing speed is very inconsistent- it may run very FAST during certain points but then it runs VERY slow at other moments (especially when it's getting to the end of the table:...
11
32594
by: Stephan Steiner | last post by:
Hi Generally, FileInfo fi = new FileInfo(path); long size = fi.Length; gets you the length of a file in bytes. However, when copying files, even while the copy operation is still in progress, the filesize, as indicated in Windows Explorer or derived with the above two lines of code, will be the size of the file once the copy operation has completed. Is there a way to
0
293
by: adnan boz | last post by:
Hi All, Does somebody know why File.Copy function is 10 times slower than standard windows drag and drop copy between folders, when I copy files over the network? Actually, I need to copy files from one computer to another over a 1GBit ethernet network as fast as I can. Although windows copy works at %40 performance, File.Copy could not go further than %4. What could be the reason? What would be the best solution; is it feasible to
0
1315
by: J. | last post by:
Hello all, I need some assistance. I've been out of the C++ game way too long and I need some help getting back up to speed. I'm taking a class where STL is mostly covered...I know alot of people break off the message here, but I want help and guidance to understand, not someone to do my work. Asking for help is a respectable thing, it's when you admit to yourself that you can't do it alone. I think I might be a little over my head,...
3
5069
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on our 100Mb/s LAN. Simply copying the file, I get around 7MB/s. I'm using a FileUpload control on an .aspx page, and then I'm writing the MyFileUpload.PostedFile.InputStream off to a database. What can I do to speed up this uploading? Thanks in advance
18
2419
by: mike3 | last post by:
Hi. I have an interesting problem. The C program presented below takes around 12 seconds to copy 128 MB of data on my machine. Yet I know the machine can go faster since a copying done at a DOS prompt takes only 4 seconds to do the same 128 MB copy (and a copy is both a read and write.). So why is this thing like 3x
0
11011
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10666
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10724
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9503
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5929
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4546
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4140
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.