I did recently some performance test where I've created artificially 1GB of random text file by:$ hexdump -C /dev/urandom | rev | head -c1G | pv > filewhich has around 13mln of lines starting from:|.....!m;}._dTO4x|  bd 9c aa 08 70 12 d6 b3  d7 3b f5 46 45 f4 43 87  00000000|...DH...e..DN'..|  5e 8d 58 44 84 7f 5a 0d  56 1f dc 44 e4 72 6a de  01000000|.B.~.^WE.g=...Y.|  1a 24 29 e7 ed e5 75 54  6d 76 d3 fe ec 00 95 ca  02000000and basically I would like to print the last column, in other words remove everything else exempt the last column and print the result/buffer.So my goal is match parsing times towards awk, grep, curl or cut within reasonable limits. I understand that other tools could be more suitable for this task (e.g. regex in grep is 4x faster) and it's difficult to compare these times, however as part of the learning process I'd like to see what it can be done in order to boost file processing by Ex.To focus just on parsing times, I'm ignoring saving the file as well as printing the buffer to the standard output (%print).Here is my progress how the times are dropping down (on MBR OS X):initial version (with regex operating without silent mode):$ time ex +'%s/^.*\s//g' -cq! file real    4m36.202suser    3m53.264ssys     0m41.960swhich seems it was using too much of system timewith silent mode (which ignores invoking the screen):$ time ex +'%s/^.*\s//g' -scq! filereal    3m39.654suser    3m37.176ssys     0m2.126sconverting RegEx into normal keystrokes:$ time ex +'%norm $Bd0' -scq! filereal    3m12.051suser    3m9.797ssys     0m1.957snow, I've tried to use a black hole register, but it didn't speed up anything, just opposite:$ time ex +'%norm $B_d0' -scq! filereal    3m21.275suser    3m18.800ssys     0m2.107sadding -u NONE makes - no differenceadded -n (for no swap file) - no differenceadding --startuptime timing.out gives the following highest times (in msec):000.008  000.008: --- VIM STARTING ---004.124  003.007: shell init3372.778  3365.165: opening bufferswhich covers only <3.5 seconds of a starting time in totalwhat else can I try?Are there any other methods of speeding up Ex processing for larger files or some ways which are quicker than the others? Or basically this is how it is?
What are the methods of speeding up parsing of a big file using Ex?
command line;ex mode;linux;performance;large documents
Switch to the old regexp engine, it's much faster than the new one for the particular regexp you're using:set regexpengine=1You can also turn off stuff you definitely won't be using (cf. wiki), but that will have a much smaller effect that the regexp engine.  To sum it up, run ex with the following vimrc:set regexpengine=1set eventignore+=FileTypeset bufhidden=unloadset buftype=nowriteset undolevels=-1