[Kst] : Huge performance problem under Windows
Peter Kümmel
syntheticpp at gmx.net
Thu Nov 19 18:10:57 CET 2009
As I understand it the object store is not global, but
many classes have an instance of it (search for "ObjectStore *_").
Anyway, as you said, using reference counted pointers should make
ObjectStore
superfluous. A container of refcounted pointers should be enough.
And I also don't like all the casting when getting a object from
the store,
we are not using Java, with a master class 'Object', or
Objective-C with 'NSObject'.
One advantage of using C++ is to check at compile-time for
type-correctness
not at runtime, with the help of templates.
A first fix would be to replace all ObjectStore member variables with
a container holding QSharedPtrs. This also makes the code more
readable.
Peter
Barth Netterfield wrote:
> I've been diving into this stuff for the last couple days trying to sort out
> what is going on.
>
> The object store is the global list of all Objects - dataSources (ie, files),
> primitives (ie, scalars, vectors, matrices, and strings), dataObjects (ie,
> equations, histograms, spectra, filters & fits) and relations (ie, curves and
> images).
>
> It does not hold the list of viewItems (ie, plots, labels, lines, etc).
>
> I think the crash on exit comes from removing from the store and deleting
> 'slave primitives' before deleting Objects which create/hold them.
>
> 'slave primitives' have a _provider, which tells if they are owned by someone
> else. If they are, then perhaps the store should not delete them when it
> removes them from the list.
>
> The thing that is really bugging me here is that I thought that the point of
> KstSharedPtr was that you don't need to delete the objects they point to -
> they get automatically deleted when all of the pointers get deleted. But I
> don't see that happening. In fact, I can't tell what they are doing.
>
> Hmmm... (arggg?)
>
> cbn
>
> On Thursday 19 November 2009 09:29:29 Peter Kümmel wrote:
>> Could someone give me the big picture what ObjectStore is good for?
>> It's all over the place and often reason for the crashs on exit.
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>
More information about the Kst
mailing list