Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] MIParser Change

> 
> --=====================_109560890==_
> Content-Type: text/plain; charset="us-ascii"; format=flowed
> 
> 
> Hi,
> 
> Assuming I correctly browsed the CDT/CVS repository, the following issues 
> apply to the head as well.
> 
> The MIParser is O(N^2) time in the length of a line returned from GDB. 
> While not an issue for OOB messages, this can be quite an issue for array 
> retrieval from the target and other potentially long messages. It's N^2 
> because it relies on StringBuffer.deleteCharAt( 0 ) and 
> StringBuffer.delete( 0, X ). These operations appear to do a copy of the 
> remaining data in the Sun Java library rather than bumping some index.
> 
> The following diffs are code that we are using on 1.0.1 to correct this 
> issue. It's relatively new, so there may be some bugs but has certainly 
> performed just fine in our initial regressions. Because of that I'm not 
> sending it in as a patch, more an FYI really. The basic change is exactly 
> what you'd expect: these diffs make MIParser use a new type of string 
> buffer that's quite efficient at deleting from the head of the array.
> 

Very cool ... with one havoc .. your patch is reversed  8-)

Seems a good candidate for the head.

> Now our issue has to do with GDB performance in array retrieval. It's quite 
> slow.

Yes, speed/performance was not part of the equation, but rather getting
the parsing protocol MI right.  But now its a good time to look at the issue.

I'll apply the patch later.

Thanks for looking at this.



Back to the top