Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Poor performances using pipes

François-Xavier
Beginner
253 Views
Dear forumers,

I have a question about the performances of pipes. I do the following exercise:

- I open aC++ pipe in write access
- I open this pipe in Fortran with read access
- I read an ASCII file in C++ and i fill the pipe with all the file contents in buffer
- When C++ has finished writing in pipe, i read all the buffer in Fortran

Note: All is compiled in a same executable, this is a simple performance test.

The file is +/- 10 MB large:

- C++ (VS 2008)takes 0.5 second to read and fill the pipe.
- Fortran (Ifort 11.1)takes 6 seconds to read the pipe contents.

If i read directly the file in Fortran, time is 1 second.

My feeling before using pipe was: "If i read something in pipe, it will be faster than if i read the file on the hard drive". Is my feeling wrong?

Sincerely yours,

F-Xavier



0 Kudos
0 Replies
Reply