Forum > Windows

slow windows more than android

(1/1)

escape:
lazarus ver : 2.3.0 (FPC 3.3.1) - win64
my OS : windows 10

i make dynamic (linking) library
uses cross compile
(android : '.so',   windows : '.dll')

one project made objects (.so and .dll)
however same code working time is slow '.dll' more then '.so'
(my PC 'H/W' have good perfomence)
(working code : parsing string and make thread, etc)

i guess missing the build option
but i can't solve

thank you for advice


loaded:
I think there is an unusual situation;
In my tests Window is 2x faster than Android.

Lazarus : 2.3.0 + Fpc 3.2.0
Android : LAMW + Aarch64 +  Android 8.1  + Xiomi Redmi 5 Plus
Windows : Win 10 Enterprise + i7 4770

Test Code Android ~ 12.508 Second :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function getString(PEnv: PJNIEnv; this: JObject; flag: JInt): JString; cdecl;var  i:integer;  dc:Double=0;  crono:Cardinal;begin  crono:=GetTickCount;  for i:=low(integer) to 5000 do  begin  dc:=dc+i;  end;  Result:= (PEnv^).NewStringUTF(PEnv,pchar(FloatToStr((GetTickCount-crono)/1000)));end;

Test Code Windows  ~5.625 Second;

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);var  i:integer;  dc:Double=0;  crono:Cardinal;begin  crono:=GetTickCount;  for i:=low(integer) to 5000 do  begin  dc:=dc+i;  end;  TButton(sender).Caption:= FloatToStr((GetTickCount-crono)/1000);end;    

escape:








--- Quote from: loaded on November 19, 2021, 11:24:26 am ---I think there is an unusual situation;
In my tests Window is 2x faster than Android.

Lazarus : 2.3.0 + Fpc 3.2.0
Android : LAMW + Aarch64 +  Android 8.1  + Xiomi Redmi 5 Plus
Windows : Win 10 Enterprise + i7 4770

Test Code Android ~ 12.508 Second :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function getString(PEnv: PJNIEnv; this: JObject; flag: JInt): JString; cdecl;var  i:integer;  dc:Double=0;  crono:Cardinal;begin  crono:=GetTickCount;  for i:=low(integer) to 5000 do  begin  dc:=dc+i;  end;  Result:= (PEnv^).NewStringUTF(PEnv,pchar(FloatToStr((GetTickCount-crono)/1000)));end;

Test Code Windows  ~5.625 Second;

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);var  i:integer;  dc:Double=0;  crono:Cardinal;begin  crono:=GetTickCount;  for i:=low(integer) to 5000 do  begin  dc:=dc+i;  end;  TButton(sender).Caption:= FloatToStr((GetTickCount-crono)/1000);end;    
--- End quote ---

ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
i agree to unusual situation

your test code worked in my devices
and i got similar result
my guess(build option) is wrong

but my original code is yet slow more PC
i was check slow code in 'TIdHTTPServer CommandGet event' and 'thread'

can you add advice?  please
thank you

loaded:

--- Quote from: escape on November 23, 2021, 02:18:35 am ---can you add advice?  please

--- End quote ---
My recommendation;
Have a minimum pascal code in shared Object files.
Use Java equivalents of your codes if possible.
Create the threads on the java side.
Your build option is aarch64.
I work very fast this way.

I also made a video on creating a so file in LAMW. https://www.youtube.com/watch?v=SCAOeAN3eU4
Maybe it will be useful for you. Regards.

Navigation

[0] Message Index

Go to full version