Skip to content
Permalink
Browse files

Add a few more items to startup runtime profiling to help debug slow …

…startup
  • Loading branch information
nyalldawson committed May 18, 2020
1 parent 82c298a commit b9ef4215fe35b388c40be5f2ef44219e145b6902
Showing with 24 additions and 19 deletions.
  1. +2 −2 src/app/qgisapp.cpp
  2. +2 −0 src/core/qgsellipsoidutils.cpp
  3. +20 −17 src/gui/qgsmapcanvas.cpp
@@ -833,7 +833,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
sInstance = this;
QgsRuntimeProfiler *profiler = QgsApplication::profiler();

startProfile( tr( "User profile manager" ) );
startProfile( tr( "Create user profile manager" ) );
mUserProfileManager = new QgsUserProfileManager( QString(), this );
mUserProfileManager->setRootLocation( rootProfileLocation );
mUserProfileManager->setActiveUserProfile( activeProfile );
@@ -842,7 +842,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
endProfile();

// start the network logger early, we want all requests logged!
startProfile( tr( "Network logger" ) );
startProfile( tr( "Create network logger" ) );
mNetworkLogger = new QgsNetworkLogger( QgsNetworkAccessManager::instance(), this );
endProfile();

@@ -21,6 +21,7 @@
#include <QCollator>
#include "qgsprojutils.h"
#include "qgsreadwritelocker.h"
#include "qgsruntimeprofiler.h"

#if PROJ_VERSION_MAJOR>=6
#include <proj.h>
@@ -175,6 +176,7 @@ QgsEllipsoidUtils::EllipsoidParameters QgsEllipsoidUtils::ellipsoidParameters( c
static std::once_flag initialized;
std::call_once( initialized, [ = ]
{
QgsScopedRuntimeProfile profile( QObject::tr( "Initialize ellipsoids" ) );
( void )definitions();
} );

@@ -79,6 +79,7 @@ email : sherman at mrcc.com
#include "qgsrasterlayertemporalproperties.h"
#include "qgsvectorlayertemporalproperties.h"
#include "qgstemporalcontroller.h"
#include "qgsruntimeprofiler.h"

/**
* \ingroup gui
@@ -143,24 +144,27 @@ QgsMapCanvas::QgsMapCanvas( QWidget *parent )
connect( QgsProject::instance()->mapThemeCollection(), &QgsMapThemeCollection::mapThemeRenamed, this, &QgsMapCanvas::mapThemeRenamed );
connect( QgsProject::instance()->mapThemeCollection(), &QgsMapThemeCollection::mapThemesChanged, this, &QgsMapCanvas::projectThemesChanged );

mSettings.setFlag( QgsMapSettings::DrawEditingInfo );
mSettings.setFlag( QgsMapSettings::UseRenderingOptimization );
mSettings.setFlag( QgsMapSettings::RenderPartialOutput );
mSettings.setEllipsoid( QgsProject::instance()->ellipsoid() );
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged,
this, [ = ]
{
QgsScopedRuntimeProfile profile( "Map settings initialization" );
mSettings.setFlag( QgsMapSettings::DrawEditingInfo );
mSettings.setFlag( QgsMapSettings::UseRenderingOptimization );
mSettings.setFlag( QgsMapSettings::RenderPartialOutput );
mSettings.setEllipsoid( QgsProject::instance()->ellipsoid() );
refresh();
} );
mSettings.setTransformContext( QgsProject::instance()->transformContext() );
connect( QgsProject::instance(), &QgsProject::transformContextChanged,
this, [ = ]
{
connect( QgsProject::instance(), &QgsProject::ellipsoidChanged,
this, [ = ]
{
mSettings.setEllipsoid( QgsProject::instance()->ellipsoid() );
refresh();
} );
mSettings.setTransformContext( QgsProject::instance()->transformContext() );
emit transformContextChanged();
refresh();
} );
connect( QgsProject::instance(), &QgsProject::transformContextChanged,
this, [ = ]
{
mSettings.setTransformContext( QgsProject::instance()->transformContext() );
emit transformContextChanged();
refresh();
} );
}

// refresh canvas when a remote svg/image has finished downloading
connect( QgsApplication::svgCache(), &QgsSvgCache::remoteSvgFetched, this, &QgsMapCanvas::redrawAllLayers );
@@ -221,8 +225,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget *parent )
setTemporalRange( mSettings.temporalRange() );

refresh();

} // QgsMapCanvas ctor
}


QgsMapCanvas::~QgsMapCanvas()

0 comments on commit b9ef421

Please sign in to comment.
You can’t perform that action at this time.