ecode: defer top-level settings menus to first show - Settings sub-menus were built eagerly on the startup critical path. Defer each top-level menu (Edit, Terminal, Tools, Window, Help, Document, View, Project) to its first OnMenuShow, following the existing lazy-submenu pattern: an empty placeholder is populated on first show and reloadStyle'd so it sizes correctly before positioning. Measured with Superluminal: settings-menu construction dropped from ~22.7ms to ~3.6ms, cutting launch time from 125ms to 107ms minimum (on my old AMD 3900X).

This commit is contained in:
Martín Lucas Golini
2026-08-07 00:05:06 -03:00
parent 0c6e14b9a4
commit ea44f9f0f7
4 changed files with 157 additions and 73 deletions
+5 -3
View File
@@ -82,7 +82,7 @@ template <typename Id, std::size_t MaxIds> class IdNameMap {
* Only the reverse entry is added; no ID is occupied and the canonical name
* is never replaced.
*/
bool addAlias( const std::string& alias, Id target ) {
bool addAlias( const std::string& alias, Id target, bool couldBeDuplicate = false ) {
if ( !contains( target ) ) {
EE::System::Log::error( "IdNameMap: alias \"%s\" targets an unknown ID.",
alias.c_str() );
@@ -92,8 +92,10 @@ template <typename Id, std::size_t MaxIds> class IdNameMap {
if ( existing != mIdsByName.end() ) {
if ( existing->second == target )
return true;
EE::System::Log::error( "IdNameMap: alias \"%s\" is already bound to another ID.",
alias.c_str() );
if ( !couldBeDuplicate ) {
EE::System::Log::error( "IdNameMap: alias \"%s\" is already bound to another ID.",
alias.c_str() );
}
return false;
}
mIdsByName.emplace( alias, target );