×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    1

    QStringList performance issues due to size()

    Edit: Never mind, i was stupid!
    Sorry for the thread!



    That code will be 10000+ times faster as a version where the size() call is uncommented.
    I thought it could be an issue with the size call that the size is recalculated each call, but after a short look at the source (I'm not too much into QT to be 100%) i couldn't verify that idea.

    I basicly want to save a ...
    Code:
    QList<QStringList> data;
    ... to file. I have 100.000 QStringsList with 6 values each.

    Does anyone have an idea how to solve this faster?

    I appreciate any idea.

    Code:
    bool QEyeTrackingDataSet::save(QFile &file)
    {
    	if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
         {
             return false;
         }
    	QTextStream out(&file);
    
    	QStringList line;
    	foreach (line, data)
    	{
    		QString str;
    		unsigned int cnt = 0;
    		
    		//size_t s = line.size(); <------
    		foreach (str, line)
    		{	
    			cnt++;
    			out << str;
    			//if(cnt != s)
    				out << "\t";		
    		}
    		out << endl;		
    	}
    
    	return true;
    }
    Last edited by CatzHoek; 2010-01-20 at 20:07.

Similar Threads

  1. E61 processor's performance issues
    By eloya in forum General Development Questions
    Replies: 4
    Last Post: 2007-02-28, 09:45
  2. E61 processor's performance issues
    By eloya in forum Symbian
    Replies: 1
    Last Post: 2007-02-27, 12:26
  3. A Different Jar Size Limit Problem
    By cicdem in forum Mobile Java General
    Replies: 0
    Last Post: 2004-06-17, 15:01
  4. issues regarding application size in gaming
    By manik_jandial in forum Mobile Java General
    Replies: 1
    Last Post: 2004-02-25, 14:54
  5. User break point error in Grid
    By ag24master in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-08-07, 08:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×