"Richard L. Hamilton" wrote: [snip] > I am curious as to whether anyone has compared the present cat(1) tricks > for speed (like last I looked ages ago, using mmap() on one end sometimes) > to sendfile(3ext) in the case of regular file to regular file copy. Seems to > me that if sendfile() optimizes that case reasonably well, it could be faster > than anything else, having total knowledge of preferred > blocksizes on both ends, the full range of VM and buffering tricks available > to the kernel, the ability to recognize the availability of DIRECTIO on > one end or the other, etc (in which case it might be able to do it with > zero memory-to-memory copy), etc.
We looked at the problem during the ksh93s- development (since ksh93's libcmd has a "cat" builtin command) and using |sendfile()| is currently not worth the trouble on Solaris. The problem is that |sendfile()| works for plain files but any combination of UDP/TCP/SCTP/pipe/device etc. may cause trouble and propperly handling of the error condition is very tricky and needs to be done per platform to work around exactly those limitations described here (e.g. doesn't work for certain socket types (which is bad since shells like ksh93 and bash have networking support)). ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [EMAIL PROTECTED] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) _______________________________________________ networking-discuss mailing list [email protected]
