Skip to content

Performance improvements to the file manager

Bitbucket Importer requested to merge bitbucket/merged-pr-334 into branch/unified

Created originally on Bitbucket by ayshih (Albert Shih)

Was already merged in Bitbucket before import, marked as merged by the import user

Tracked down and fixed the primary issues slowing down the file manager (see also http://www.magiclantern.fm/forum/index.php?topic=5522.msg95150#msg95150):

  • menu_remove would unnecessarily continue to traverse the list even after it had already removed the requested "count" entries: loop changed
  • console_printf call in clear_file_menu, as pointed out by a1ex: commented out
  • each menu item was individually added with separate menu_add calls: compacted the menu entries into a single array before adding in just one menu_add call
  • menu_add would scan the entire list for placeholders to update on every individual insertion: there is now a menu_add_base function that has an explicit input argument for whether to update placeholders

This PR also includes some nicer formatting of file sizes

Merge request reports