mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 18:50:16 +03:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user