Performance issue with FreeType 2.12.1.

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Performance issue with FreeType 2.12.1.

      Hi,

      I'm currently upgrading our emWin lib from 5.somthing to 6.34a and I have encountered an issue with FreeType library (ver. 2.12.1). I did manage to track the issue to an uninitialized variable. The variable is part of a heap-allocated structure, thus the initial value will be whatever is found on the heap. The "wrong" initial value will make the internal cache-system malfunction, causing a huge performance loss, the rendered text still looks OK though. My resolution was to simply add a line to initialize the variable (line 2370 in the source below). I did check the latest version of the FreeType lib (2.13.2) and the issue has been resolved by the FreeType crew somewhere along the way to version 2.13.2.

      Regards,
      - Martin

      C Source Code: ftcache.c

      1. FT_EXPORT_DEF( FT_Error )
      2. FTC_Manager_New( FT_Library library,
      3. FT_UInt max_faces,
      4. FT_UInt max_sizes,
      5. FT_ULong max_bytes,
      6. FTC_Face_Requester requester,
      7. FT_Pointer req_data,
      8. FTC_Manager *amanager )
      9. {
      10. FT_Error error;
      11. FT_Memory memory;
      12. FTC_Manager manager = NULL;
      13. if ( !library )
      14. return FT_THROW( Invalid_Library_Handle );
      15. if ( !amanager || !requester )
      16. return FT_THROW( Invalid_Argument );
      17. memory = library->memory;
      18. if ( FT_QNEW( manager ) )
      19. goto Exit;
      20. if ( max_faces == 0 )
      21. max_faces = FTC_MAX_FACES_DEFAULT;
      22. if ( max_sizes == 0 )
      23. max_sizes = FTC_MAX_SIZES_DEFAULT;
      24. if ( max_bytes == 0 )
      25. max_bytes = FTC_MAX_BYTES_DEFAULT;
      26. manager->library = library;
      27. manager->memory = memory;
      28. manager->max_weight = max_bytes;
      29. manager->cur_weight = 0; /* This line has been added! */
      30. manager->request_face = requester;
      31. manager->request_data = req_data;
      32. FTC_MruList_Init( &manager->faces,
      33. &ftc_face_list_class,
      34. max_faces,
      35. manager,
      36. memory );
      37. FTC_MruList_Init( &manager->sizes,
      38. &ftc_size_list_class,
      39. max_sizes,
      40. manager,
      41. memory );
      42. manager->nodes_list = NULL;
      43. manager->num_nodes = 0;
      44. manager->num_caches = 0;
      45. *amanager = manager;
      46. Exit:
      47. return error;
      48. }
      Display All
    • Hi Martin,

      Thanks for letting us know. We got reports about the poor cache performance very shortly after we updated to FT 2.12.1.

      So we immediately updated to FT 2.13 as soon as we could. You can download the library with the emWin glue code on our website. Since emWin V632b, FreeType 2.13 is used.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Hi Florian,

      Thank you for the information, I read through releas notes for 6.34a but could not find anything regarding an upgrade of the FreeType lib since the 2.12.1 upgrade. I will try upgrading the FreeType library, I guess version 2.13.2 should work?

      Regards
      - Martin
    • Hi Martin,

      You can try to update to FreeType 2.13.2 but we have not tested this version yet, so I cannot give you any kind of warranty for it to work with our glue code.

      The latest version that we ship with our glue code is 2.13. I would recommend using this version, also because the fixes of 2.13.1 and 2.13.2 only seem to be minor.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.