Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> On Tuesday, 1 February 2022 11:12:29 PST Murphy, Sean wrote: > > So if I understand you correctly, instantiating 60,000 of them when > > you really only need one would be considered Not Advised?!?! > > Correct. > > I find it hard to believe you have a valid use-case for 60,000 deterministic > p

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Thiago Macieira
On Tuesday, 1 February 2022 11:12:29 PST Murphy, Sean wrote: > So if I understand you correctly, instantiating 60,000 of them when you > really only need one would be considered Not Advised?!?! Correct. I find it hard to believe you have a valid use-case for 60,000 deterministic pseudo-random ge

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> On Tuesday, 1 February 2022 08:30:52 PST Murphy, Sean wrote: > > I just made that switch - removed the QRandomGenerator member > variable > > From the tile class, and calling > > QRandomGenerator::global()->bounded(min, > > max). Now creating + assigning each tile plummeted from 18 seconds to >

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Thiago Macieira
On Tuesday, 1 February 2022 08:30:52 PST Murphy, Sean wrote: > I just made that switch - removed the QRandomGenerator member variable > From the tile class, and calling QRandomGenerator::global()->bounded(min, > max). Now creating + assigning each tile plummeted from 18 seconds to 15 > millisecond

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> Depending on your QFuture setup, you could monitor each tile, and when it > completes, update the min max... I think from the testing I did yesterday, and this comment from https://doc.qt.io/qt-5/qfuturewatcher.html prevents you from knowing WHICH result is ready if your map function returns vo

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Scott Bloom
Depending on your QFuture setup, you could monitor each tile, and when it completes, update the min max... Passing the manager to each tile, and when the tile is finished update the manager with the tiles value. Then a simple mutex should allow you to not collide. No signals, just a simple fu

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> 😊 that definitely does. > > Of course I wonder if you had removed that, but left in the QObject etc > etc, what would it have been. Likely, not much worse than 15ms. Yep, once I removed the random generator object, I had the same thought: "could I go back to QObject?!?!", but as you ment

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Scott Bloom
😊 that definitely does. Of course I wonder if you had removed that, but left in the QObject etc etc, what would it have been. Likely, not much worse than 15ms. Why? IMO, Qt wouldn’t be what it is today, if simply allocating 60k QObjects and connecting a signal to them too that long. But

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> Subject: RE: [Interest] [External]Re: How to get QtConcurrent to do what I > want? > > Something seems off. > > But without looking at the actual code that is allocation 60k tiles and the > constructor itself, it just seems like a very expensive construction if the > "new" + "moving a pointer"

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Scott Bloom
Something seems off. But without looking at the actual code that is allocation 60k tiles and the constructor itself, it just seems like a very expensive construction if the "new" + "moving a pointer" is taking 3ms each. Scott -Original Message- From: Interest On Behalf Of Murphy, Se

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Michael Jackson
I've gotten a bit lost in these requirements but having written a large piece of open source data analysis software (including image processing and tiling of data to form and image) there are certain scenarios when processing an image that you can share the entire image with *all* of the threads

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> Not knowing if a partial value makes any sense to your system. > Qt::Concurrent::mappedReduced might make more sense, if its purely a > speedup you are looking for, and not a "keep the GUI alive during it" possibly > blockingMappedReduced. I don't think mappedReduced would help me until after th

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> > What's the significance of the tiles? As far as I can tell from your > requirements, you don't care about > > the "true geometry" of the data. > > Either I'm understanding what you mean by "true geometry", or this Oops! This was supposed to say "Either I'm NOT understanding..." _

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Murphy, Sean
> On Mon, Jan 31, 2022 at 7:15 PM Murphy, Sean > wrote: > >   1. Creating 60,000 QObjects in a single thread appears to be slow   > [...] > > Ehm, maybe I'm not understanding something, but why do you need objects to > begin with? I do need to report progres

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Konstantin Shegunov
On Mon, Jan 31, 2022 at 7:15 PM Murphy, Sean wrote: > 1. Creating 60,000 QObjects in a single thread appears to be slow [...] > Ehm, maybe I'm not understanding something, but why do you need objects to begin with? > The actual loop is this: > // generate each tile with its assignment >