Fwd: OutputModel performance

Andreas Pakulat apaku at gmx.de
Thu Feb 7 23:29:12 UTC 2013


Hi,

On Thu, Feb 7, 2013 at 11:09 PM, Andreas Pakulat <apaku at gmx.de> wrote:
>> b) create an active worker object that is moved to a thread, then let that do
>> the classification. I.e.:
>>
>> output line (QString) -> active object, run regexps -> (Categorized Data) ->
>> OutputModel
>
> I'd rather have a worker-object running in a QThread-with-event-loop,
> this has a slot to give it lines and emits a signal with batches of
> parsed-data (i.e. 50 or so). Then every time lines are added to the
> model, a signal is emitted which connects via queued-connection to the
> worker, that one adds the lines to its internal queue and processes
> lines. Once it has a batch of 50 done, it emits them and the
> outputmodel gets that through a queued-connection to add it to the
> model data and notify the view. That should be safe enough to not
> introduce many regressions and should solve the ui-lockup.

Since I was bored I've tried this now in the
wip/filter_output_threaded branch. Unfortunately the outputmodeltest
crashes and I'm too tired to debug the reason, its likely though
because the outputmodel is deleted while the background thread is
still running. I don't see a good way of stopping it earlier than the
destructor at the moment.

Andreas


More information about the KDevelop-devel mailing list