Re: [fpc-pascal] Is the TFPGMap.KeyData()/TDictionary.TryGetValue() faster than TStringList.Values[]?

2016-01-13 Thread Michael Van Canneyt
On Wed, 13 Jan 2016, silvioprog wrote: Hello, I need two fast list features: Add(Key: string, Value: string); Get(Key: string, Value: string): string; So, I took a look at the `TFPGMap` (and `TDictionary` on Delphi) class. It is really a very nice option. But I tested the `TStringList` clas

Re: [fpc-pascal] Is the TFPGMap.KeyData()/TDictionary.TryGetValue() faster than TStringList.Values[]?

2016-01-13 Thread Maciej Izak
> > Please disconsider this link above, the correct link is: > http://pastebin.com/SUxJ1kKc. > > My results for FPC and TDictionary from Generics.Collections ( https://github.com/dathox/generics.collections ): TStringList: 00:00:03.644 TMyList: 00:00:00.007 TMyList: 00:00:00.007 TStringList: 00:00

Re: [fpc-pascal] Is the TFPGMap.KeyData()/TDictionary.TryGetValue() faster than TStringList.Values[]?

2016-01-13 Thread silvioprog
On Wed, Jan 13, 2016 at 11:34 PM, silvioprog wrote: [...] > Please, run this small test in your environment (my env. is: FPC 3.1.1 / > Delphi Seattle, both generating a 32 bits EXE): > > http://pastebin.com/vxwhD9W0 > Please disconsider this link above, the correct link is: http://pastebin.com/S

[fpc-pascal] Is the TFPGMap.KeyData()/TDictionary.TryGetValue() faster than TStringList.Values[]?

2016-01-13 Thread silvioprog
Hello, I need two fast list features: Add(Key: string, Value: string); Get(Key: string, Value: string): string; So, I took a look at the `TFPGMap` (and `TDictionary` on Delphi) class. It is really a very nice option. But I tested the `TStringList` class too, and I was suprised with its performan

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Marco van de Voort
In our previous episode, Torsten Bonde Christiansen said: > I'm not even sure how (or even if) TStream decendants handles endianness > for integers I'm guessing they are not. TStream is basically an abstraction for stream of bytes. The read methods are just convenience, not some protocol. As

Re: [fpc-pascal] Do I need to make fpc 3.0.0 twice?

2016-01-13 Thread Peter
On 13/01/16 07:33, Marco van de Voort wrote: > In our previous episode, Sven Barth said: >> There is a variant of the OPT parameter that applies options only for the >> last compilation. This way you can use options that the compiling compiler >> does not yet support. Now if I'd only remember that.

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Sven Barth
Am 13.01.2016 13:16 schrieb "Torsten Bonde Christiansen" : > > On 2016-01-13 10:40, Mark Morgan Lloyd wrote: >> >> Torsten Bonde Christiansen wrote: >>> >>> On 2016-01-13 10:06, Mark Morgan Lloyd wrote: Serguei TARASSOV wrote: > > On 13/01/2016 08:47, fpc-pascal-requ...@lists.free

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Torsten Bonde Christiansen
On 2016-01-13 10:40, Mark Morgan Lloyd wrote: Torsten Bonde Christiansen wrote: On 2016-01-13 10:06, Mark Morgan Lloyd wrote: Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn'

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Sven Barth
Am 13.01.2016 10:40 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > Torsten Bonde Christiansen wrote: >> >> On 2016-01-13 10:06, Mark Morgan Lloyd wrote: >>> >>> Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: > >

Re: [fpc-pascal] Do I need to make fpc 3.0.0 twice?

2016-01-13 Thread Sven Barth
Am 13.01.2016 08:34 schrieb "Marco van de Voort" : > > In our previous episode, Sven Barth said: > > There is a variant of the OPT parameter that applies options only for the > > last compilation. This way you can use options that the compiling compiler > > does not yet support. Now if I'd only rem

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Marco van de Voort
In our previous episode, Torsten Bonde Christiansen said: > What is the best/preferred way to write floatingpoint to a steam? var d : double; // or single, avoid extended d:=; stream.write(d,sizeof(d)); stream.read(d,sizeof(d)); All the stream helpers are just that. One could add writedouble/

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Mark Morgan Lloyd
Torsten Bonde Christiansen wrote: On 2016-01-13 10:06, Mark Morgan Lloyd wrote: Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the li

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Torsten Bonde Christiansen
On 2016-01-13 10:06, Mark Morgan Lloyd wrote: Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - bu

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Mark Morgan Lloyd
Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? Depends on

Re: [fpc-pascal] Writing floating points to steams

2016-01-13 Thread Serguei TARASSOV
On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? Depends on size constraints. In the