Q
qwertmonkey
From: "qwertmonkey" <qwertmonkey@1:261/38.remove-dpk-this>
From: (e-mail address removed)
a) I need to actually scan large text files (10+ million lines).
b) On each line there is a NL sentence.
c) That processing should be run only once, but as fast as possible.
~
d) If you go:
d.1) int iPrx = Runtime.getRuntime().availableProcessors();
d.2) count all lines
d.3) split the file in (total lines)/iPrx
d.4) then run iPrx threads (or executable instances using a batch script)
the time you waste on d.2) and d.3) will make all that strat senseless
~
I have no way to influence how those large files are generated
~
e) because of the large sizes of the files you can't even go
~
FIS = new FileInputStream(IFl);
FileChannel IFlChnl = FIS.getChannel();
int iChnlSz = (int)IFlChnl.size();
MappedByteBuffer MptBytBfr = IFlChnl.map(FileChannel.MapMode.READ_ONLY, 0,
iChnlSz);
~
so, apparently, the only option I have is:
~
BfR = Files.newBufferedReader(DirPth, ChrStUTF8);
String aSx = BfR.readLine();
while(aSx != null){
aSx = BfR.readLine();
}
~
do you know of a faster way to go about this?
~
lbrtchx
-+- BBBS/Li6 v4.10 Dada-1
+ Origin: Prism bbs (1:261/38)
-+- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
From: (e-mail address removed)
~Use multiple threads?
a) I need to actually scan large text files (10+ million lines).
b) On each line there is a NL sentence.
c) That processing should be run only once, but as fast as possible.
~
d) If you go:
d.1) int iPrx = Runtime.getRuntime().availableProcessors();
d.2) count all lines
d.3) split the file in (total lines)/iPrx
d.4) then run iPrx threads (or executable instances using a batch script)
the time you waste on d.2) and d.3) will make all that strat senseless
~
I have no way to influence how those large files are generated
~
e) because of the large sizes of the files you can't even go
~
FIS = new FileInputStream(IFl);
FileChannel IFlChnl = FIS.getChannel();
int iChnlSz = (int)IFlChnl.size();
MappedByteBuffer MptBytBfr = IFlChnl.map(FileChannel.MapMode.READ_ONLY, 0,
iChnlSz);
~
so, apparently, the only option I have is:
~
BfR = Files.newBufferedReader(DirPth, ChrStUTF8);
String aSx = BfR.readLine();
while(aSx != null){
aSx = BfR.readLine();
}
~
do you know of a faster way to go about this?
~
lbrtchx
-+- BBBS/Li6 v4.10 Dada-1
+ Origin: Prism bbs (1:261/38)
-+- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24