Re: [fpc-pascal] A question about sets performance

2011-02-01 Thread Sven Barth
Am 31.01.2011 22:59, schrieb Jeppe Johansen: It's true that the semantics are the same, and it would probably make sense to do some optimizations on typed constants that aren't ever written to(the FPC rtl "abuses" the typed constant variable property in the heap manager code, for example) I wou

Re: [fpc-pascal] A question about sets performance

2011-01-31 Thread Jeppe Johansen
Den 31-01-2011 22:54, Vladimir Zhirov skrev: I was surprised when B turned out to be almost 3 times slower than A (~11 vs ~29 sec. on my hardware). This ratio remains nearly the same regardless of compiler optimization level. I'm using FPC 2.4.2 [2010/12/27] for i386 on Linux. 1) Is it expected

Re: [fpc-pascal] A question about sets performance

2011-01-31 Thread Marco van de Voort
In our previous episode, Vladimir Zhirov said: > I was surprised when B turned out to be almost 3 times > slower than A (~11 vs ~29 sec. on my hardware). This ratio > remains nearly the same regardless of compiler optimization > level. This is normal. Typed constants are considered variables, and

[fpc-pascal] A question about sets performance

2011-01-31 Thread Vladimir Zhirov
Hi, I'm trying to optimize my CSV parser class, and facing with a bit unexpected results. I tried to change in-place set declaration (if ch in [a, b, c] then ...) to reusable set constants (if ch in ABCSet then ...), and noticed a slight slowdown. To check it, I created a simple test application: