slow windows more than android lazarus / 34-Windows ---------------------------------------------------------------------- escape · 2021-11-18 01:05 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 · 2021-11-19 10:24 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 · 2021-11-23 01:18 Quote from: loaded on November 19, 2021, 11:24:26 amI 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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;   ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ 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 · 2021-11-23 06:38 Quote from: escape on November 23, 2021, 02:18:35 amcan you add advice?  please 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.