[Qt-interest] Reading data from ASCII file

Andre Somers andre at familiesomers.nl
Mon Apr 11 08:14:50 CEST 2011


Op 10-4-2011 23:43, yogesh upreti schreef:
> Hi Group,
> I am trying to convert some of my Text file manipulating, non GUI perl 
> scripts to GUI based Qt codes.
> During these I have to read data out of around 20-50 mb text files, 
> check some patterns in every line and show them in better form.
>
> Now problem is that a perl program takes around 3.5 sec to read a 15 
> mb file and do all the manipulation and show the results in  command 
> line.
>
> and a Qt program is taking around 7 Sec just to read the data simply, 
> without and pattern search or something.
>
> I was using QTextStream to read the files, but after some research I 
> am using QFile directly. with this I have reduced the reading time.
>
>
> But still I am not able to match the time with perl script. Do anyone 
> have any suggestion??
>
Personally, I think you are not going to be able to match Perls time. 
Perl is optimized for exactly this kind of scenario, while Qt is 
typically used in very different settings. What you might do, is instead 
of doing the work in Qt itself, simply build a GUI around your perl 
scripts that you control using QProcess. That will get you the best of 
both worlds: ultra-fast text processing, and the ease of Qt for your GUI.

André



More information about the Qt-interest-old mailing list