Thread: Software optimization

  1. #31
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    I canīt cheat changing the file format hehe. Actually im pretty satisfied with my parser speed now, thank you all, your tips were very usefull!

  2. #32
    The larch
    Join Date
    May 2006
    Posts
    3,573
    What do you mean by cheating?

    It is always nice to have an easily readable file.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  3. #33
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I think what the OP means is that the original file format is fixed, and can't (easily) be changed.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #34
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    matsp is right.

  5. #35
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    Ok, im a tireless optimizer, i have improved t3 performance mark with the following parsing:
    Code:
    	for (string::size_type i = 0;;)
    	{
    		while (line[++i] == '-' && i < end); //find first '-' character
    
    		if (i >= end) { break; }
    
    		begin = i;
    		while (line[++i] != '-' && i < end); //find first not of '-' character
    
    		dictionary[line.substr(begin, i - begin)]++;
    	}
    I was able to squeeze out 1,266 seconds from this function, over the 1.5s of before...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Software Design/Test - Redmond, WA
    By IRVolt in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 06-11-2008, 10:26 AM
  2. Why C Matters
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 136
    Last Post: 01-16-2008, 09:09 AM
  3. Adding trial period to software
    By BobS0327 in forum C Programming
    Replies: 17
    Last Post: 01-03-2006, 02:13 PM
  4. Optimization settings
    By Roaring_Tiger in forum C Programming
    Replies: 4
    Last Post: 02-23-2005, 02:53 AM