Improve BufferedReader Speed

I crunch through many gigabytes of text data, and I was wondering if there is a way to improve performance. For example, when passing through 10 gigabytes of data and not processing it at all, just repeating line by line, it takes about 3 minutes.

I basically have a dataIterator wrapper that contains a BufferedReader. I constantly call this iterator, which returns the next line.

Is the problem the number of lines created? Or perhaps the number of function calls. I do not know how to profile this application because it compiles as a bank and is used as a STAF service.

Any ideas appreciated?

+3
source share
4 answers

: I/O-. - . - .

, , JNI. , , .

, java.nio , , CPU/ I/O.

, java.nio , , , , . , java.nio .

, , .

+6

NIO, , - . , . , 6 ( 265 ), . NIO 2002, 33 . , . , , , .

+1

If the program is started using the usual command line "java -options ... ClassName args ...", you can profile it. I am most familiar with NetBeans Profiler. This has the ability to separately run the java application ( adding the java option to start ), then attach the profiler.

If you try to optimize without measuring the need for improvement, you work in the dark. You may be lucky, or you could spend a lot of time doing irrelevant work.

0
source

Source: https://habr.com/ru/post/1709319/


All Articles