Compile time of resource file lazarus / 64-FPC development ---------------------------------------------------------------------- Pascal · 2020-03-09 12:23 Why does compiling this resource unit takes more than 30 seconds? (Ryzen 9 3900X) The resource is 8.4 MB. 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 unit primeRes; {$mode objfpc}{$H+} interface implementation uses  LResources; initialization LazarusResources.Add('handbuch','PDF',[  '%PDF-1.5'#13#10'%'#181#181#181#181#13#10'1 0 obj'#13#10'<>>>'#13  +#10'endobj'#13#10'2 0 obj'#13#10'<] >>'#13#10'startxref'#13#10'2125192'#13#10  +'%%EOF'#13#10'xref'#13#10'0 0'#13#10'trailer'#13#10'<<1C323BA7AE7EC445A109053C'  +'CA4CB522>] /Prev 2125192/XRefStm 2120577>>'#13#10'startxref'#13#10'2163396'  +#13#10'%%EOF']);LazarusResources.Add('kurzanleitung','PDF',[  '%PDF-1.5'#13#10'%'#181#181#181#181#13#10'1 0 obj'#13#10'<>>>'#13  +#10'endobj'#13#10'2 0 obj'#13#10'<'  +'>'#13#10'endobj'#13#10'3 0 obj'#13#10'< <1F824346AFB279479AF038F22AD20A7A>] >>'#13  +#10'startxref'#13#10'483577'#13#10'%%EOF'#13#10'xref'#13#10'0 0'#13#10'trail'  +'er'#13#10'<<1F824346AFB279479AF038F22AD20A7A>] /Prev 483577/XRefStm 482310>>'  +#13#10'startxref'#13#10'493198'#13#10'%%EOF']); end. ---------------------------------------------------------------------- Cyrax · 2020-03-09 12:34 Why you are using old resource file format (Lazarus)? Please use FPC (native) resource file format. https://wiki.freepascal.org/Lazarus_Resources#FPC_resources ---------------------------------------------------------------------- Thaddy · 2020-03-09 12:37 Quote from: Cyrax on March 09, 2020, 01:34:22 pmWhy you are using old resource file format (Lazarus)? Please use FPC (native) resource file format. https://wiki.freepascal.org/Lazarus_Resources#FPC_resources Because the old stuff is not marked as deprecated? Which it is. ---------------------------------------------------------------------- Pascal · 2020-03-09 13:12 Okay, i could change resource format but the question is: Why is this so slow? About one year ago i didn't notice any slow compiling of this unit. ---------------------------------------------------------------------- eljo · 2020-03-09 13:21 Quote from: Cyrax on March 09, 2020, 01:34:22 pmWhy you are using old resource file format (Lazarus)? Please use FPC (native) resource file format. https://wiki.freepascal.org/Lazarus_Resources#FPC_resources because only the old stuf work as expected with the components icons in the IDE? but yea other than that you should use an .rc file ---------------------------------------------------------------------- Cyrax · 2020-03-09 15:34 Quote from: Pascal on March 09, 2020, 02:12:38 pmOkay, i could change resource format but the question is: Why is this so slow? About one year ago i didn't notice any slow compiling of this unit. Probably due to changes how FPC trunk compiler handles strings and its conversions to UTF8 and back etc. Also there is a ton new shiny features added to the trunk compiler. You might want to test if disabling $LONGSTRINGS feature (aka reference counted strings) helps.  https://www.freepascal.org/docs- html/prog/progsu25.html ---------------------------------------------------------------------- PascalDragon · 2020-03-10 08:31 Quote from: Cyrax on March 09, 2020, 04:34:42 pmYou might want to test if disabling $LONGSTRINGS feature (aka reference counted strings) helps.  https://www.freepascal.org/docs-html/prog/progsu25.html It will help in so far that his resources will be broken, because the strings are longer than 255 characters. ---------------------------------------------------------------------- Pascal · 2020-03-10 12:42 Quote from: PascalDragon on March 10, 2020, 09:31:58 amQuote from: Cyrax on March 09, 2020, 04:34:42 pmYou might want to test if disabling $LONGSTRINGS feature (aka reference counted strings) helps.  https://www.freepascal.org/docs-html/prog/progsu25.html It will help in so far that his resources will be broken, because the strings are longer than 255 characters.   But what is the reason for the slowdown. I couldn't remember that compile times were that bad in the past. Compiling my project in Lazarus seems to stop for half a minute now. ---------------------------------------------------------------------- winni · 2020-03-10 13:21 Hi! In the Laz resource strings unprintable chars below <= #32 are not allowed. So space has to be #32 or '  ' and so on. The same for chars > #127 Maxbe that is the reason. Winni ---------------------------------------------------------------------- Pascal · 2020-03-10 20:09 Can't be true! The two embedded pdf files work as expeced, so no issues. The only problem i have is the very long compile time. This is not a drama, just curious, because they were unnoticeable some time agao. ---------------------------------------------------------------------- marcov · 2020-03-10 21:17 Quote from: Pascal on March 10, 2020, 01:42:04 pmBut what is the reason for the slowdown. I couldn't remember that compile times were that bad in the past. Compiling my project in Lazarus seems to stop for half a minute now. Probably the support for Unicode as Cyrax already said