Hi,

I was working on a plugin, but I wanted to increase performance by using
multiple threads for my plugin. I was doing this either by creating a
QObject and moving it to a new QThread, but I also tried inheriting from a
QThread class, but both options didn't have any performance increase.

In general my code workflow is as follows (I tried both 1a and 1b):
1a. plugin_dialog.accept() starts two workers (class
FeatureSelector(QThread))
1b. plugin_dialog.accept() starts two workers (class Worker(QObject)) and
moves each instance to a seperate QThread
2. Each worker iterates over half of the total features and select features
based on a expression (QgsFeatureRequest().setFilterExpression(expression)).
3. On signal finished of each FeatureSelector instance, the return values
are put back together again and used to create a new memory layer)

I thought, maybe QGIS already optimized threads and therefore, this is the
fastest my plugin is going to be, no matter how many threads I use? Or
maybe there is a better way of running multiple threads in QGIS?

Best,
Matthijs
-- 
*Matthijs Bon*
*Student Geomatics*
*Delft University of Technology*
*4133390*

*T:* +31 (0)6 816 766 79
*E: *[email protected]
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to