Re: [fpc-devel] Class field reordering

2012-07-21 Thread Martin
On 14/07/2012 20:46, Jonas Maebe wrote: That may actually lead to quite some troubles: if someone recompiles the RTL without optimizations, then your class crackers also have to change that setting. And there's no way to detect how the RTL (or in general: units containing classes you are "crac

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Skybuck Flying
> I also wonder how much of an optimization it actually is ? Maybe > 0.01% > more performance ? " 1) as mentioned in the original mail, the current transformation is implemented for saving memory, not for improving performance " This wasn't clear, it only mentions gaps. What kind of gaps ?

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Martin Schreiber
On Thursday 19 July 2012 05:13:01 Luiz Americo Pereira Camara wrote: > I also have somethings in fpc rtl/fcl that also don't like or changing > would simplify my work. But if we start to change base classes at each > developer request we may end with a mess. > Just to be clear, i'm not against all

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Luiz Americo Pereira Camara
Em 18/7/2012 03:19, Martin Schreiber escreveu: Thank you. There are more items in the db.pas list... But I think first we should concentrate on classes.pas because I really don't want to fork it. Forking db.pas is less problematic and I probably prefer it in place of an endless discussion and in

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Sven Barth
Am 18.07.2012 10:08 schrieb "Martin Schreiber" : > > On Wednesday 18 July 2012 09:33:09 michael.vancann...@wisa.be wrote: > > > I think you are missing an important point: > > > > You want some radical changes, so I expect you to be the one giving the > > reasons/motivations for a change. I want to

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Martin Schreiber
On Wednesday 18 July 2012 10:50:36 michael.vancann...@wisa.be wrote: > >> If you don't give a detailed explanation why you need to manipulate > >> all these private fields outside of the proper methods, then I cannot > >> help you find solutions for the problems you experience, so please: > >> ela

Re: [fpc-devel] Class field reordering

2012-07-18 Thread michael . vancanneyt
On Wed, 18 Jul 2012, Martin Schreiber wrote: On Wednesday 18 July 2012 09:33:09 michael.vancann...@wisa.be wrote: I think you are missing an important point: You want some radical changes, so I expect you to be the one giving the reasons/motivations for a change. I want to help find solutio

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Martin Schreiber
On Wednesday 18 July 2012 09:33:09 michael.vancann...@wisa.be wrote: > I think you are missing an important point: > > You want some radical changes, so I expect you to be the one giving the > reasons/motivations for a change. I want to help find solutions, but not > at the price of destroying wha

Re: [fpc-devel] Class field reordering

2012-07-18 Thread Martin Schreiber
On Wednesday 18 July 2012 09:43:16 michael.vancann...@wisa.be wrote: > On Wed, 18 Jul 2012, Martin Schreiber wrote: > > On Wednesday 18 July 2012 08:19:02 Martin Schreiber wrote: > >> Used in order TParams create tmseparam items instead of TParam: > >> > >> TCollection: > >> - FItemClass > > > > Pr

Re: [fpc-devel] Class field reordering

2012-07-18 Thread michael . vancanneyt
On Wed, 18 Jul 2012, Martin Schreiber wrote: On Wednesday 18 July 2012 08:19:02 Martin Schreiber wrote: Used in order TParams create tmseparam items instead of TParam: TCollection: - FItemClass Probably can be solved in a forked db.pas Or by 2 other solutions: * having a global variable

Re: [fpc-devel] Class field reordering

2012-07-18 Thread michael . vancanneyt
On Wed, 18 Jul 2012, Martin Schreiber wrote: On Tuesday 17 July 2012 09:40:36 michael.vancann...@wisa.be wrote: Maybe, but what about performance? Another complication is the "updatebuffer" with the "oldvalues". Thinking about it: I would allocate the buffer as is, with for all string fiel

Re: [fpc-devel] Class field reordering

2012-07-17 Thread Martin Schreiber
On Wednesday 18 July 2012 08:19:02 Martin Schreiber wrote: > Used in order TParams create tmseparam items instead of TParam: > > TCollection: > - FItemClass > Probably can be solved in a forked db.pas Martin ___ fpc-devel maillist - fpc-devel@lists.fre

Re: [fpc-devel] Class field reordering

2012-07-17 Thread Martin Schreiber
On Tuesday 17 July 2012 09:40:36 michael.vancann...@wisa.be wrote: > > Maybe, but what about performance? Another complication is the > > "updatebuffer" with the "oldvalues". > > Thinking about it: > > I would allocate the buffer as is, with for all string fields an > integer-sized slot in the buff

Re: [fpc-devel] Class field reordering

2012-07-17 Thread Thomas Schatzl
Hi, On Tue, 2012-07-17 at 08:22 +0200, Skybuck Flying wrote: > > I also wonder how much of an optimization it actually is ? Maybe 0.01% > > more performance ? > > " > 1) as mentioned in the original mail, the current transformation is > implemented for saving memory, not for improving perfo

Re: [fpc-devel] Class field reordering

2012-07-17 Thread Skybuck Flying
I don't think this is a good idea. For example while debugging and looking at the memory in raw this would lead to confusion. By knowing the order of the fields, you still don't know their exact offsets. If you want to know their address, print @classinstance.fieldname Yes but I do know th

Re: [fpc-devel] Class field reordering

2012-07-17 Thread michael . vancanneyt
On Tue, 17 Jul 2012, Martin Schreiber wrote: On Monday 16 July 2012 17:25:58 michael.vancann...@wisa.be wrote: On Mon, 16 Jul 2012, Martin Schreiber wrote: On Monday 16 July 2012 16:50:06 michael.vancann...@wisa.be wrote: Well, from your code adding the following to the protected section:

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Martin Schreiber
On Monday 16 July 2012 17:25:58 michael.vancann...@wisa.be wrote: > On Mon, 16 Jul 2012, Martin Schreiber wrote: > > On Monday 16 July 2012 16:50:06 michael.vancann...@wisa.be wrote: > >> Well, from your code adding the following to the protected section: > >> > >>Property ValueBuffer : Pointer

Re: [fpc-devel] Class field reordering

2012-07-16 Thread michael . vancanneyt
On Mon, 16 Jul 2012, Martin Schreiber wrote: On Monday 16 July 2012 16:50:06 michael.vancann...@wisa.be wrote: Well, from your code adding the following to the protected section: Property ValueBuffer : Pointer Read FValueBuffer; Property Validating : Boolean Read FValidating ; Should

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Martin Schreiber
On Monday 16 July 2012 16:49:24 Mattias Gaertner wrote: > > AFAIK inheriting forms with nested frame with nested frame works in > Lazarus. Some years ago I fixed a bug which only appeared at 5 > level depth. > TReader/Writer does not know about forms/frames/datamodules, so I guess > it should work

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Martin Schreiber
On Monday 16 July 2012 16:50:06 michael.vancann...@wisa.be wrote: > > Well, from your code adding the following to the protected section: > >Property ValueBuffer : Pointer Read FValueBuffer; >Property Validating : Boolean Read FValidating ; > > Should be enough to remove the need for the TF

Re: [fpc-devel] Class field reordering

2012-07-16 Thread michael . vancanneyt
On Mon, 16 Jul 2012, Martin Schreiber wrote: On Monday 16 July 2012 09:35:16 michael.vancann...@wisa.be wrote: The DB components mainly because MSEgui stores string fields as UnicodeString in datasets and because of the direct data access by index without scrolling. So you take away the c

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Mattias Gaertner
On Mon, 16 Jul 2012 16:18:49 +0200 Martin Schreiber wrote: > On Monday 16 July 2012 14:08:23 Mattias Gaertner wrote: > > On Mon, 16 Jul 2012 09:35:16 +0200 (CEST) > > > > michael.vancann...@wisa.be wrote: > > >[...] > > > > > > > TComponent, TWriter, TReader for example because in > > > > MSEide+

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Martin Schreiber
On Monday 16 July 2012 09:35:16 michael.vancann...@wisa.be wrote: > > > The DB components mainly because MSEgui stores string fields as > > UnicodeString in datasets and because of the direct data access by index > > without scrolling. > > So you take away the concept of cursor. That is a radical c

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Martin Schreiber
On Monday 16 July 2012 14:08:23 Mattias Gaertner wrote: > On Mon, 16 Jul 2012 09:35:16 +0200 (CEST) > > michael.vancann...@wisa.be wrote: > >[...] > > > > > TComponent, TWriter, TReader for example because in > > > MSEide+MSEgui one can place additional components in an inserted tframe > > > and co

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Nico Erfurth
On 16.07.12 09:22, Skybuck Flying wrote: > I also wonder how much of an optimization it actually is ? Maybe > 0.01% more performance ? Cache related optimizations are VERY hard to measure and depend on overall context and used architecture. But as the L1-cache is one of the most performance c

Re: [fpc-devel] Class field reordering

2012-07-16 Thread michael . vancanneyt
On Mon, 16 Jul 2012, Mattias Gaertner wrote: On Mon, 16 Jul 2012 09:35:16 +0200 (CEST) michael.vancann...@wisa.be wrote: [...] TComponent, TWriter, TReader for example because in MSEide+MSEgui one can place additional components in an inserted tframe and combination of inherited frames and

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Mattias Gaertner
On Mon, 16 Jul 2012 09:35:16 +0200 (CEST) michael.vancann...@wisa.be wrote: >[...] > > TComponent, TWriter, TReader for example because in > > MSEide+MSEgui one can place additional components in an inserted tframe and > > combination of inherited frames and inherited forms need special handling.

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Jonas Maebe
On 16 Jul 2012, at 13:14, Sven Barth wrote: > does this optimization > also apply on systems that require proper alignment for memory accesses? Well, yes, otherwise the "optimization" would simply consist of removing all alignment padding and there would be no need to reorder the fields. Jona

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Jonas Maebe
On 16 Jul 2012, at 09:22, Skybuck Flying wrote: > -Original Message- From: Jonas Maebe > Sent: Sunday, July 15, 2012 15:49 > To: FPC developers' list > Subject: Re: [fpc-devel] Class field reordering > > >> On 14 Jul 2012, at 14:16, Skybuck Flying wrote: &g

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Sven Barth
Am 14.07.2012 01:45 schrieb "Jonas Maebe" : > > > Hi, > > I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to minimise memory gaps caused by alignment differences and odd sizes. The effect is the same as when you would cha

Re: [fpc-devel] Class field reordering

2012-07-16 Thread Skybuck Flying
-Original Message- From: Jonas Maebe Sent: Sunday, July 15, 2012 15:49 To: FPC developers' list Subject: Re: [fpc-devel] Class field reordering On 14 Jul 2012, at 14:16, Skybuck Flying wrote: I don't think this is a good idea. For example while debugging and looking at

Re: [fpc-devel] Class field reordering

2012-07-16 Thread michael . vancanneyt
On Sun, 15 Jul 2012, Martin Schreiber wrote: On Sunday 15 July 2012 19:21:58 Michael Van Canneyt wrote: On Sun, 15 Jul 2012, Martin Schreiber wrote: Currently I need access to the following private FCL class fields because of MSEide+MSEgui extensions: I have looked at your list. (I sent my

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Hans-Peter Diettrich
Graeme Geldenhuys schrieb: On 15 July 2012 19:04, Michael Van Canneyt wrote: Usually these things are private for a reason. But maybe there are better reasons for doing it different, of course then I'd like to hear them first :) Yes, and I just wanted to point out that I some time ago I showe

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Graeme Geldenhuys
On 15 July 2012 19:04, Michael Van Canneyt wrote: > Usually these things are private for a reason. But maybe there are better > reasons for doing it different, of course then I'd like to hear them first > :) Yes, and I just wanted to point out that I some time ago I showed a case where I needed t

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Martin Schreiber
On Sunday 15 July 2012 19:21:58 Michael Van Canneyt wrote: > On Sun, 15 Jul 2012, Martin Schreiber wrote: > > Currently I need access to the following private FCL class fields because > > of MSEide+MSEgui extensions: > > I have looked at your list. (I sent my previous mail about this without > havi

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Michael Van Canneyt
On Sun, 15 Jul 2012, Graeme Geldenhuys wrote: Hi, On 15 July 2012 18:21, Michael Van Canneyt wrote: For example: TParam.FBound Is directly accessible through TParam.Bound, so why on earth would you need to have it protected ?? Anyway, I'm not saying I agree with his whole list... as your

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Graeme Geldenhuys
Hi, On 15 July 2012 18:21, Michael Van Canneyt wrote: > For example: > TParam.FBound > Is directly accessible through TParam.Bound, so why on earth would you need > to have it protected ?? I haven't worked through his list myself, but I had a quick look at one property I had issues with ages ag

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Michael Van Canneyt
On Sun, 15 Jul 2012, Martin Schreiber wrote: Currently I need access to the following private FCL class fields because of MSEide+MSEgui extensions: I have looked at your list. (I sent my previous mail about this without having seen the list) At first sight, I see no reason to make any of

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Michael Van Canneyt
On Sat, 14 Jul 2012, Martin Schreiber wrote: On Saturday 14 July 2012 14:26:32 Michael Van Canneyt wrote: If would you want to use that optimization, then yes. "Working around" the type system of the language is however generally asking for trouble, regardless of what reason you do it for.

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Jonas Maebe
On 14 Jul 2012, at 14:16, Skybuck Flying wrote: > I don't think this is a good idea. > > For example while debugging and looking at the memory in raw this would lead > to confusion. By knowing the order of the fields, you still don't know their exact offsets. If you want to know their address

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Skybuck Flying
ke it even worse. Bye, Skybuck. -Original Message- From: Jonas Maebe Sent: Saturday, July 14, 2012 1:44 To: fpc-devel@lists.freepascal.org Subject: [fpc-devel] Class field reordering Hi, I've implemented an optimization that reorders the instance fields of Delphi-style class

Re: [fpc-devel] Class field reordering

2012-07-15 Thread Sven Barth
On 15.07.2012 08:58, Martin Schreiber wrote: I report all FPC bugs I find apart from the compiler crashes by partial compile where reproducing is difficult, needs the whole MSEide+MSEgui source and fixing probably would need construction of a new unit handling in FPC. As the compiler sometimes

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Martin Schreiber
On Saturday 14 July 2012 19:55:39 Sven Barth wrote: > > > > I sometimes need "cracker" classes in MSEide and MSEgui to fix bugs and > > make > > > extensinsions for FCL classes in order to access private fields (examples > > TDataset, TParam, TField, TFiler, TReader, TWriter, TComponent). > > Is it

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Sven Barth
Am 14.07.2012 21:48 schrieb "Jonas Maebe" : > I guess there are probably no such FPC-compiled programs yet (*), so maybe now is the time to add that before we also get stuck with that particular piece of ballast. Somehow I have the feeling that we all know what one of your upcoming commits will be

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 20:52, Jonas Maebe wrote: > On 14 Jul 2012, at 18:02, Martin Schreiber wrote: > >> I do not necessarily want to use field order optimization but if the FPC RTL >> is compiled with it I need to compile my cracker classes with optimization >> too. > > That's indeed true. Tha

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 20:29, Nico Erfurth wrote: > So basically, something like > > class MyClass = class > {$OPTIMIZATION OFF} > private >FHeavilyUsedValue: Boolean; >FAlsoHeavilyUsedValue: DWord; > {$OPTIMIZATION DEFAULT} >NotOftenUsed: Byte; > end; > > should leave the ordering of

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 18:02, Martin Schreiber wrote: > I do not necessarily want to use field order optimization but if the FPC RTL > is compiled with it I need to compile my cracker classes with optimization > too. That's indeed true. Jonas___ fpc-de

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Nico Erfurth
On 14.07.12 01:44, Jonas Maebe wrote: > I've implemented an optimization that reorders the instance fields of > Delphi-style classes (and only of Delphi-style classes) to minimise > memory gaps caused by alignment differences and odd sizes. The effect is > the same as when you would change the ord

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Florian Klämpfl
Am 14.07.2012 01:44, schrieb Jonas Maebe: > > Hi, > > I've implemented an optimization that reorders the instance fields of > Delphi-style classes (and only of Delphi-style classes) to minimise > memory gaps caused by alignment differences and odd sizes. The effect is > the same as when you would

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Sven Barth
Am 14.07.2012 07:45 schrieb "Martin Schreiber" : > > On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: > > Hi, > > > > I've implemented an optimization that reorders the instance fields of > > Delphi-style classes (and only of Delphi-style classes) to minimise > > memory gaps caused by alignment

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Martin Schreiber
On Saturday 14 July 2012 14:07:30 Jonas Maebe wrote: > > > Hmm, up to now I listed in the cracker classes fields up to the last > > private field I need to access so the cracker classes would not brake by > > changing or adding successive fields in the original classes. I assume > > now it is neces

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Martin Schreiber
On Saturday 14 July 2012 14:26:32 Michael Van Canneyt wrote: > > If would you want to use that optimization, then yes. "Working around" > > the type system of the language is however generally asking for trouble, > > regardless of what reason you do it for. > > Indeed. Maybe we can help by making s

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Michael Van Canneyt
On Sat, 14 Jul 2012, Jonas Maebe wrote: On 14 Jul 2012, at 08:00, Martin Schreiber wrote: On Saturday 14 July 2012 07:50:58 Martin Schreiber wrote: On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: I've implemented an optimization that reorders the instance fields of Delphi-style class

Re: [fpc-devel] Class field reordering

2012-07-14 Thread Jonas Maebe
On 14 Jul 2012, at 08:00, Martin Schreiber wrote: > On Saturday 14 July 2012 07:50:58 Martin Schreiber wrote: >> On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: >>> I've implemented an optimization that reorders the instance fields of >>> Delphi-style classes (and only of Delphi-style classe

Re: [fpc-devel] Class field reordering

2012-07-13 Thread Martin Schreiber
On Saturday 14 July 2012 07:50:58 Martin Schreiber wrote: > On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: > > Hi, > > > > I've implemented an optimization that reorders the instance fields of > > Delphi-style classes (and only of Delphi-style classes) to minimise > > memory gaps caused by al

Re: [fpc-devel] Class field reordering

2012-07-13 Thread Martin Schreiber
On Saturday 14 July 2012 01:44:39 Jonas Maebe wrote: > Hi, > > I've implemented an optimization that reorders the instance fields of > Delphi-style classes (and only of Delphi-style classes) to minimise > memory gaps caused by alignment differences and odd sizes. The effect > is the same as when yo

Re: [fpc-devel] Class field reordering

2012-07-13 Thread Craig Peterson
On Jul 13, 2012, at 6:44 PM, Jonas Maebe wrote: > > Hi, > > I've implemented an optimization that reorders the instance fields of > Delphi-style classes (and only of Delphi-style classes) to minimise memory > gaps caused by alignment differences and odd sizes. The effect is the same as > w

[fpc-devel] Class field reordering

2012-07-13 Thread Jonas Maebe
Hi, I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to minimise memory gaps caused by alignment differences and odd sizes. The effect is the same as when you would change the order of the fields in the source co

[fpc-devel] Class field reordering

2012-07-13 Thread Jonas Maebe
Hi, I've implemented an optimization that reorders the instance fields of Delphi-style classes (and only of Delphi-style classes) to minimise memory gaps caused by alignment differences and odd sizes. The effect is the same as when you would change the order of the fields in the source c