5

I'm using RAD Studio XE7 (C++ Builder). For one of my projects, the main form contains several components, like panels, buttons, labels, edit boxes, ..., and several of them have the "auto-size" property activated. Until now I always displayed English texts on this interface, and his opening performances were acceptable.

I recently translated this interface in Japanese. I noticed that the opening time was dramatically slower.

Using a profiler (Shiny), I measured the difference between the two. I noticed that the VCL may process several properties, like the position and size, until 10x slower while the Japanese interface is opening. The performance leak appears clearly while properties like e.g. pControl->Width or pControl->Margins->Top are changing. I didn't modified any line of code between the both versions, only the texts in the DFM files, nothing else.

I cannot believe that the performances of the VCL may degrade as much as this. Is there a known issue in the VCL about the performances with Japanese texts? What are the good practices to prevent a such scenario with the VCL controls?

Ken White
  • 123,280
  • 14
  • 225
  • 444
Jean-Milost Reymond
  • 1,833
  • 1
  • 15
  • 36
  • It sounds pretty surprising to me. If anything, I would expect *less* characters used for Japanese. Could it be that the original version was compiled in a different version of Delphi, or that the configuration may be different? Are you using `Release` instead of `Debug`? – Jerry Dodge Jul 18 '17 at 00:01
  • Are you using both Delphi and C++ Builder? – Jerry Dodge Jul 18 '17 at 00:03
  • Actually, I wonder if it's related to Japanese fonts / rendering ... – Jerry Dodge Jul 18 '17 at 00:05
  • 3
    [This discussion](https://social.msdn.microsoft.com/Forums/silverlight/en-US/2eb28fe9-9a29-4a69-ac18-344ce64129fa/what-kind-of-gdi-fonts-are-slow?forum=vcgeneral) will be related, I guess. – Victoria Jul 18 '17 at 02:28
  • 3
    Expect this to be perf differences at Win32 level – David Heffernan Jul 18 '17 at 05:40
  • @Jerry, "Could it be that the original version was compiled in a different version of Delphi" : no, I compiled the both version in the exact same compiler, with the exact same config. As I said, I just modified the DFM content, nothing else. My RAD Studio version is the Professional version, but the project is a C++ Builder project. In fact, and as Victoria and David mentioned it, I suspect the GDI functions under the VCL to be the real cause of the slowdown. It's not a question of text length, I think, rather a question of font, grammar rules complexity, and perhaps drawing itself. – Jean-Milost Reymond Jul 18 '17 at 12:45
  • Indeed, that's exactly what I pointed out in my third comment. Although the string lengths are likely shorter, the characters are more complex to draw. – Jerry Dodge Jul 18 '17 at 13:16

0 Answers0