<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 20 June 2022, 9:37 pm David Marteau via QGIS-Developer, <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<p>Hi,</p>
<p>I have noticed a huge drop of performance while testing Qgis
server with Qgis 3.26, from 10x to 30x slower as usual.</p>
<p>Trying to reduce the problem I have found a huge increase of time
spend reading the project in 3.26 compared to 3.24.</p>
<p>Here some benchmark with very simple project from the test data
set. Note: the project has been updated with qgis 3.26:</p>
<p>Qgis 3.24:<br>
======<br>
</p>
<div>
<div aria-label="Edit code here">
<div>
<div style="overflow:hidden;width:3px;height:0px"><textarea style="padding:0px;width:1px;height:1em;outline:currentcolor none medium"></textarea></div>
<div>
<div style="margin-left:0px;min-width:572.033px;margin-bottom:0px;border-right-width:50px;min-height:96px;padding-right:0px;padding-bottom:0px">
<div>
<div role="presentation">
<div style="outline:currentcolor none medium" role="presentation">
<div role="presentation">
<pre role="presentation"><span role="presentation"><span>readflags</span> <span>=</span> <span>QgsProject</span>.<span>ReadFlags</span>()<span>
readflags</span> <span>|=</span> <span>QgsProject</span>.<span>FlagTrustLayerMetadata</span></span></pre>
<pre role="presentation"><span role="presentation"><span></span><span>prj</span> <span>=</span> <span>QgsProject</span>()</span></pre>
<pre role="presentation"><span role="presentation"><span>%</span><span>timeit</span> <span>-</span><span>n</span> <span>1</span> <span>prj</span>.<span>read</span>(<span>f"</span>{<span>datapath</span>}<span>/france_parts.qgs"</span>,<span>readflags</span>)</span></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div dir="auto">
<pre>> 15.7 ms ± 205 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)
</pre>
</div>
<p>Qgis 3.26:<br>
======</p>
<div role="presentation">
<pre role="presentation"><span role="presentation"><span>readflags</span> <span>=</span> <span>QgsProject</span>.<span>ReadFlags</span>()
<span>readflags</span> <span>|=</span> <span>QgsProject</span>.<span>FlagTrustLayerMetadata</span></span></pre></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You should set the other new read optimisation flags here -- see <a href="https://github.com/qgis/QGIS/blob/88ebb3f2f513dbce5a775f50e51ea0117f859c65/src/core/qgis.h#L1962">https://github.com/qgis/QGIS/blob/88ebb3f2f513dbce5a775f50e51ea0117f859c65/src/core/qgis.h#L1962</a></div><div dir="auto"><br></div><div dir="auto">Nyall</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div role="presentation">
<pre role="presentation"><span role="presentation"><span></span><span>prj</span> <span>=</span> <span>QgsProject</span>()</span></pre>
<pre role="presentation"><span role="presentation"><span>%</span><span>timeit</span> <span>-</span><span>n</span> <span>1</span> <span>prj</span>.<span>read</span>(<span>f"</span>{<span>datapath</span>}<span>/france_parts.qgs"</span>,<span>readflags</span>)</span></pre>
</div>
<div dir="auto">
<pre>195 ms ± 44 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
</pre>
<p>There is a factor x10 between Qgis 3.24 et Qgis 3.26 for the
exact same project. <br>
This has serious impact on requests: landing page catalog
request time increased from approximatevely 110ms to more than
3.0s with our test data set.</p>
<br>
</div>
<div>
<p> <span style="font-weight:bold;color:#9acd32">David Marteau</span>
<br>
<a href="http://www.3liz.com" style="text-decoration:none;color:#9acd32" target="_blank" rel="noreferrer">www.3liz.com</a> <br>
<span style="font-size:0.8em"> </span>
</p>
</div>
</div>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div></div></div>