Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotkey: cache results from getHotkeyFunctions in InfoBarHotkey
This commit solves an issue with channel changing or displaying the channel list. It seems that getHotkeyFunctions results used directly on InfoBarHotkey unlike HotkeySetup and HotkeySetupSelect where results are cached. When getHotkeyFunctions is called directly it seems to cause a delay about two seconds trying to load translation files. Here is part of strace when pressing key down: 07:54:36.802713 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en_US.ISO8859-1/LC_MESSAGES/Blindscan.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:36.803627 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en_US/LC_MESSAGES/Blindscan.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:36.804421 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en.ISO8859-1/LC_MESSAGES/Blindscan.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:36.806185 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en/LC_MESSAGES/Blindscan.mo", {st_mode=S_IFREG|0644, st_size=3424, ...}) = 0 07:54:36.809350 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en_US.ISO8859-1/LC_MESSAGES/Blindscan.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:36.810581 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en_US/LC_MESSAGES/Blindscan.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:36.811586 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en.ISO8859-1/LC_MESSAGES/Blindscan.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:36.812566 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/locale/en/LC_MESSAGES/Blindscan.mo", {st_mode=S_IFREG|0644, st_size=3424, ...}) = 0 07:54:37.648853 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager/locale/en_US.ISO8859-1/LC_MESSAGES/DeviceManager.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:37.649916 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager/locale/en_US/LC_MESSAGES/DeviceManager.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:37.650818 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager/locale/en.ISO8859-1/LC_MESSAGES/DeviceManager.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:37.651687 stat64("/usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager/locale/en/LC_MESSAGES/DeviceManager.mo", 0x7f9beea0) = -1 ENOENT (No such file or directory) 07:54:37.653404 stat64("/usr/share/enigma2/po/en_US.ISO8859-1/LC_MESSAGES/enigma2.mo", 0x7f9bedd0) = -1 ENOENT (No such file or directory) 07:54:37.654243 stat64("/usr/share/enigma2/po/en_US/LC_MESSAGES/enigma2.mo", 0x7f9bedd0) = -1 ENOENT (No such file or directory) 07:54:37.654936 stat64("/usr/share/enigma2/po/en.ISO8859-1/LC_MESSAGES/enigma2.mo", 0x7f9bedd0) = -1 ENOENT (No such file or directory) 07:54:37.655956 stat64("/usr/share/enigma2/po/en/LC_MESSAGES/enigma2.mo", {st_mode=S_IFREG|0644, st_size=151686, ...}) = 0 07:54:37.662523 stat64("/etc/ppanels", 0x7f9bf5e8) = -1 ENOENT (No such file or directory) 07:54:37.663243 stat64("/usr/script", 0x7f9bf5e8) = -1 ENOENT (No such file or directory) 07:54:37.664945 write(2, "[ActionMap] Keymap 'InfobarChannelSelection' -> Action = 'keyDown'.\n", 68[ActionMap] Keymap 'InfobarChannelSelection' -> Action = 'keyDown'. Caching the result of getHotkeyFunction hides the above delay, although further investigation required because that issue become "noticable" after 06 August. So most probably another commit made getHotkeyFunction less performant, since there is no change in HotKey.py the last months.
- Loading branch information
There is one disadvantege... when you add eg sh scripts on the box you need to restart e2... otherwise the script does not work. This was the reason why I did not cached this