linux - is there any good point to use 500 byte buffer for simple upper-case converter? -


I'm reading programming from the ground up

In Chapter 5,

Program 1 BT uses a 500-byte buffer to change the long character.

Should not use dual loop?

To read 500 bytes by 500 bytes, loop1.

And I think this program makes a bit more complex.

If I use a byte buffer

to convert

nothing but just a loop

loop Read 1: 1 beat and process it.

Is there a good thing to use 500 byte buffers? Simple upper case converter?

text ">

Consider having 500 (or more) bytes at a time The only reason for this is that it is using the number of functions and / or operating system services in the library for I / O. I suggest that you try it in both ways and measure the difference in performance for yourself. Say that two of your versions are compiled for ELA executable called uppercase. Sons You can get a report on the CPU and run it in time to run shortly: Time uppercase. Byte_by_byte & lt; Input & Out; Output Time Uppercase. 500_by_bucks output

Comments