[PATCH 1/2] regedit: Overhaul Unicode line processing

Alexandre Julliard julliard at winehq.org
Tue Nov 22 07:20:37 CST 2016


Hugh McMaster <hugh.mcmaster at outlook.com> writes:

>>The initial size won't make a difference, the problem is that you always
>>append data without removing it, so the buffer grows to the entire file
>>size.  It shouldn't need to grow bigger than the longest line.
>
> Continually moving the remaining characters to the start of the buffer
> hits perfomance. That's why I took the 'read into memory'
> approach as line parsing is faster in RAM.
>
> But fair enough, I'll rework the patch. Still, I'm interested to know why
> you dislike reading the file into memory first.

It's wasteful, it doesn't scale, and there's no reason to do it since
you only read one line at a time. And I very much doubt that with the
reallocations and the extra memory pressure performance would be any
better.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list