I need to process a data processor that can handle more than 2.5 MB / s of input from STDIN and output the number in STDOUT. What happens faster to use BufferedReader, and then conversion to data types or scanner and nextInt () or nextFloat ()?
EMPIRICAL TEST RESULTS: BufferedReader and conversion are a little faster, but nothing too significant.
Thankyou!
The answer most likely does not matter how you do it in terms of performance. (And there is no way that anyone can enter at a speed of 2.5 MB per second on the console!)
, , , , . ( stdin), , , ... .
, , . , , , , , ... . (, , Java.)
BufferedReader . Scanner .
BufferedReader
Scanner
2,5 / BufferedReader. , Scanner. 8 1
BufferedReader → →