INLINEs for GRAPHICS unit ? lazarus / 31-LCL ---------------------------------------------------------------------- jamie · 2020-08-18 22:50 As I look In the graphics unit I find many one or two line functions that I think could benefit the code for speed a little if they were marked as ININE. Take the BLUE, GREEN and RED functions for example where they are just one line. and the RGBToColor, IsSysColor and so on.. Has anyone considered trying these with INLINE ?.. ---------------------------------------------------------------------- Aidex · 2020-08-19 04:14 That's my thought, too. In some units there are short functions that do not do much more than encapsulate another functions. I would appreciate it if they would be inlined or if there would be _inline variants of them. For example: RGBToColor_inline() Then everyone could decide for himself whether he wants to use the inline variant. Lazarus' units should also use the inline variants internally themselves, at least in time-critical places. ---------------------------------------------------------------------- PascalDragon · 2020-08-19 07:18 Quote from: Aidex on August 19, 2020, 06:14:16 amThat's my thought, too. In some units there are short functions that do not do much more than encapsulate another functions. I would appreciate it if they would be inlined or if there would be _inline variants of them. For example: RGBToColor_inline() Then everyone could decide for himself whether he wants to use the inline variant. Lazarus' units should also use the inline variants internally themselves, at least in time-critical places. There is no need to split between between inline functions and not as the compiler will stop inlining if the code becomes too complex (thus there wouldn't be any benefit of inlining anymore). Also these would create an unnecessary maintenance burden. ---------------------------------------------------------------------- jamie · 2020-08-19 19:42 Quote from: PascalDragon on August 19, 2020, 09:18:52 amQuote from: Aidex on August 19, 2020, 06:14:16 amThat's my thought, too. In some units there are short functions that do not do much more than encapsulate another functions. I would appreciate it if they would be inlined or if there would be _inline variants of them. For example: RGBToColor_inline() Then everyone could decide for himself whether he wants to use the inline variant. Lazarus' units should also use the inline variants internally themselves, at least in time-critical places. There is no need to split between between inline functions and not as the compiler will stop inlining if the code becomes too complex (thus there wouldn't be any benefit of inlining anymore). Also these would create an unnecessary maintenance burden. Oh, ok the compiler is not able to do it. Thanks for the heads up.