Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-24 Thread Sven Barth
Am 24.07.2012 13:21, schrieb OBones: Thomas Schatzl wrote: This code is not thread safe at all. A thread switch after the while loop and before the increment will not prevent progress on other threads, so multiple threads can enter the "critical section". Well, yes, even if under Windows it's r

Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-24 Thread OBones
Thomas Schatzl wrote: This code is not thread safe at all. A thread switch after the while loop and before the increment will not prevent progress on other threads, so multiple threads can enter the "critical section". Well, yes, even if under Windows it's rare that a thread is preempted right i

Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-24 Thread Thomas Schatzl
HI, On Mon, 2012-07-23 at 16:58 +0200, OBones wrote: > Jonas Maebe wrote: > > On 23 Jul 2012, at 10:58, OBones wrote: > > > >> leledumbo wrote: > >>> I look at the generated code and in the direct one there's additional > >>> overhead of decrementing the reference counter on each iteration. > >> I

Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-23 Thread OBones
Jonas Maebe wrote: On 23 Jul 2012, at 10:58, OBones wrote: leledumbo wrote: I look at the generated code and in the direct one there's additional overhead of decrementing the reference counter on each iteration. I see it too now (I forgot about the -a option). I can understand why there is a

Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-23 Thread Jonas Maebe
On 23 Jul 2012, at 10:58, OBones wrote: > leledumbo wrote: >> I look at the generated code and in the direct one there's additional >> overhead of decrementing the reference counter on each iteration. > I see it too now (I forgot about the -a option). > I can understand why there is a call to the

Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-23 Thread OBones
leledumbo wrote: That one I cannot answer, please summon Florian/Jonas/Marco/Michael/whoever capable to answer Would you happen to know the magical words/rhunes that I should use? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

[fpc-pascal] Re: UnicodeString comparison performance

2012-07-23 Thread leledumbo
That one I cannot answer, please summon Florian/Jonas/Marco/Michael/whoever capable to answer -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/UnicodeString-comparison-performance-tp5710405p5710423.html Sent from the Free Pascal - General mailing list archive at

Re: [fpc-pascal] Re: UnicodeString comparison performance

2012-07-23 Thread OBones
leledumbo wrote: I look at the generated code and in the direct one there's additional overhead of decrementing the reference counter on each iteration. I see it too now (I forgot about the -a option). I can understand why there is a call to the decrementer outside the loop when using the varia

[fpc-pascal] Re: UnicodeString comparison performance

2012-07-20 Thread leledumbo
I look at the generated code and in the direct one there's additional overhead of decrementing the reference counter on each iteration. Here's what the core code looks like: Direct: leal -56(%ebp),%eax call fpc_unicodestr_decr_ref leal -56(%ebp),%eax call P$TEST_$$_GETSOMESTRING$$UNICO