tomoyu719 / simple_sheet_music

A Flutter package for rendering sheet music on canvas.
https://pub.dev/packages/simple_sheet_music
MIT License
9 stars 6 forks source link

Speeding up the loading of music symbol paths and metadata #28

Open tomoyu719 opened 1 day ago

tomoyu719 commented 1 day ago

Overview

The process of retrieving music symbol paths and metadata is slow, which has a negative impact on the user experience. To improve this, we propose to review the asynchronous processing and make it possible to retrieve data synchronously.

Objective

Shorten the loading time of music symbols and provide a smooth user experience. Abolish the currently used FutureBuilder and implement a simpler approach.

Proposal

Introduce a mechanism to synchronously retrieve music symbol paths and metadata, referring to techniques such as Vexflow. Shorten loading time by minimizing asynchronous processing. Review and optimize the existing code base.

Scope of impact

All components that display music symbols are affected, so thorough testing is required.

Expected results

Music symbols will be loaded faster, reducing user waiting time.

lukasnalezenec commented 1 day ago

Synchronous processing makes sense. It is common pattern used in similar components.

In the past, I created a pull request that minifies both the Bravura font and metadata, reducing their size to about 1%. I can commit the Python code I used for the minification.

There is also an alternative solution to the issues with FutureBuilder. This solution uses parallel asynchronous loading of the metadata and font, passing the result as part of the Future value.

https://github.com/tomoyu719/simple_sheet_music/pull/18

lukasnalezenec commented 1 day ago

... I can also generate those classes.

lukasnalezenec commented 1 day ago

Do you have any ideas about comparing writing symbols using SVG versus fonts? Have you encountered any issues with writing using SVG?