Recent

Recent Posts

Pages: 1 ... 8 9 [10]
91
General / Re: Slow copying of small structures
« Last post by Nitorami on April 18, 2024, 04:41:52 pm »
@Alpine: yes, understood.
@Marcov: I do not know if it is theoretically possible to optimise out the temporaries and the REP MOVSL. The compiler currently does not do it, even with inlining. Only for structures up to 8 bytes in size, VMOVSD is used instead of REP MOVSL. Operations with complex number of type single are therefore significantly faster than when using double.
92
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by marcov on April 18, 2024, 04:41:49 pm »
Afaik it was always key to do as little as possible in the dll main event.

If you move the code to a separate procedure, does it work then?
93
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by KodeZwerg on April 18, 2024, 04:25:09 pm »
Code: Pascal  [Select][+][-]
  1.         if ((dummy = INVALID_SET_FILE_POINTER) and (error = NO_ERROR)) then begin
Code: Pascal  [Select][+][-]
  1.       if ((dummy <> INVALID_SET_FILE_POINTER) and (error = NO_ERROR)) then
Why in the world you change it like that? Do you even understand the meaning of that comparision?
I do not check for more modifications made by you but a simple question remain, lets assume you truly copy and paste my example, letting each single char untouched, no "paule32 optimizations", just like I showed it, will it run successful or not?
94
General / Re: location of non visual component
« Last post by gerardus on April 18, 2024, 04:16:44 pm »
Crude solution:

Open the .lfm file with a text editor and search for your TImageList

  object ImageList1: TImageList
    Left = 148
    Top = 60
  end

and modify the Left and Top.
And yes, it would nice to have an IDE command to center "lost" components in the form.
95
General / Re: Slow copying of small structures
« Last post by alpine on April 18, 2024, 04:15:44 pm »
Ok the temporaries are necessary but this would not be of concern if copying them wasn't so slow. The reason why the compiler inserts no REP MOVSL in your code is, I believe, because you use single. When changing to double, the REP MOVSL are back.
True, that's why I put the float_type - to experiment with different types.

My point is - while the small structure copying can be optimized, and that will be great by itself, the operators will stay suboptimal compared to the procedures, since the procedures won't require copying at all. They'll evaluate the calculations in correct order using references, probably without the need for intermediates. 
96
FPC development / Re: what to do if my target MIPS cpu has no FPU
« Last post by Laksen on April 18, 2024, 04:14:52 pm »
Check how the embedded target does it. Most of those don't have FPU support

But beware that it's not just a one liner. It likely requires lots of code to get completely right
97
General / Re: Slow copying of small structures
« Last post by marcov on April 18, 2024, 03:53:00 pm »

By crafting the expression (see my last 4 lines) you can actually remove the REPs, but that's not the point. Generally, the infix operator notation will always require temporaries, hence operators are suboptimal. 

For simple types those temporaries could be optimized out when inlined
98
General / Re: Slow copying of small structures
« Last post by Nitorami on April 18, 2024, 03:40:18 pm »
Ok the temporaries are necessary but this would not be of concern if copying them wasn't so slow. The reason why the compiler inserts no REP MOVSL in your code is, I believe, because you use single. When changing to double, the REP MOVSL are back.
99
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by KodeZwerg on April 18, 2024, 03:39:59 pm »
The following will crash the application ( WriteFile  Lines: 86 ):
Code: Pascal  [Select][+][-]
  1. ...
  2. function PutToFile(const AFileName: LPCSTR; AData: LPCSTR): Boolean;
  3. ...
  4.             // next step will crash the app ...            
  5.             dummy := WriteFile(hFile, adata, dataSize, 0, overlap);
From time to time you should just swallow what is given and not modify.
Code: Pascal  [Select][+][-]
  1. procedure PutDataToFile(const AFileName: string; AData: PAnsiChar);
  2. ...
  3.           if WriteFile(hFile, AData^, DataSize, cnt, nil) then
I hope you see the differences and for what reason you try play now with overlapped? That was never planned in.
100
Databases / Access violation when re-opening SQL query with parameters
« Last post by Chris Osborne on April 18, 2024, 03:34:11 pm »
We have an application that ran perfectly well when compiled with an earlier version of Lazarus (don't know which version, but it used Free Pascal 2.6.4).

The machine that we compiled it on died, and we installed Lazarus 2.2.6 on a new computer. Since then we have a problem with the database queries (we are using Firebird 3.0.10 on Windows 10, the older executable still works fine with this).

This results in an access violation if we try to re-open a parameterised SQL query.
I have a short program that reproduces this error.
Note that the first 'open' works fine, but the second causes a crash.

I can make it work by clearing & re-adding the SQL & re-preparing the query before the second 'open', but that kind of defeats the point of having a parameterised query.

The problem remains if we use the latest Lazarus release.

Any help would be greatly appreciated.

N.B. just failed to post because I added the SQL file to create the dummy test table, this is apparently not allowed.
So here it is in line:

CREATE TABLE DBTEST (
        NAME          VARCHAR(40) NOT NULL,
        COLOUR      VARCHAR(40)
);
INSERT INTO DBTEST VALUES( 'APPLE', 'GREEN' );
INSERT INTO DBTEST VALUES( 'SAUSAGE', 'BROWN' );


Pages: 1 ... 8 9 [10]

TinyPortal © 2005-2018