[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [tortoisesvn] r23238 committed - Do not copy CFileTextLines before converting...

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 29 Aug 2012 20:47:09 +0200

On 28.08.2012 22:53, Oto BREZINA wrote:

>> Also keep in mind that the line array is used by all views and even in
>> multiple threads. And your custom array isn't thread safe.
> It is not (multithead safe) - was intended to be simple as fast. In case
> multithread is needed keeping vector makes sense, but I did not found
> any refence to FileTextLines lines other then Load, Patch(methods are
> not called?), ... all seems be one thread related.
> After load(load, convert,diff) lines from FileTextLines are not
> referenced at all. Params are.
> Save uses FileTextLines in its scope as well as Patch methods.
>
> See proof of concept patch(separated Lines and Params) - build it(that's
> the proof), but don't try to run it (it does nothing).

you're right, it's not used by multiple threads.
But if we ever change that, we would have to rewrite a whole lot of code
since your class isn't thread safe.
That's another reason why I really prefer to use existing classes.

Do you have any data on speed comparing a vector (do we need a vector or
could a deque work as well?) and your class?

What's the load/save time for files in different sizes, e.g. 100kb, 1M,
10M, 20M, 50M, maybe even 100M?

Optimizing is good, but most of the time using existing
APIs/containers/classes is still the best option.

For example, Stefan^2 wrote an optimized converter for UTF16<->UTF8
using SSE2. It was faster, but not correct. There are just too many
special situations and glyphs which can't be handled the same as the
rest. That's why the windows API is slower: it does the stuff right.
Took me many hours of analyzing crash reports to find that out.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3002004
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-08-29 20:47:17 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.