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

2022-01-31 Thread Andrei Golubev
(Accidentally sent previous email.) To conclude my code snippet: // ... auto step1Future = QtConcurrent::map(tiles, processTile): step1Watcher.setFuture(step1Future); // the charade with "internal" future is needed to get the progress from the second stage. // I think there's no simpler way cu

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

2022-01-31 Thread Andrei Golubev
Hi, I am not 100% certain what reduction does in QtConcurrent, but guessing this is generally not what you need (there's no "convert N to 1", but "convert N to N"). Also, is QtConcurrent's reduction concurrent? The docs [1] state that it is not, so you are likely to get a sequential second pass

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

2022-01-31 Thread Scott Bloom
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. If you need the gui, setting up a qfuturewatcher on the resu

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

2022-01-31 Thread Scott Bloom
Ahh that does fill in a bunch of holes 😊 I would definitely scrap using QSharedPointer as well as QObject, and instead monitoring of the QObject, montor the QFuture that is returned from your map call. Scott -Original Message- From: Interest On Behalf Of Murphy, Sean Sent: Monday, Jan

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

2022-01-31 Thread Murphy, Sean
Thanks for the reply, Scott. My responses below: > Couple things I would try. > > First, preallocate the size of the vector, or use a list if you don't need > random access into it.  I had attempted this before my original post. My sequence of attempts before I posted went like this: 1. St

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

2022-01-31 Thread w...@warmi.net
It does not make sense to me to have allocation/population of 60k instances of Tile + QPoint into a QVector taking 5 seconds. It took 5 ms on my computer… Having said that , if allocation and assignment are your bottleneck , just use placement new operator with a large block of memory or just pu

Re: [Interest] Qt Android: how to set __ANDROID_API__ ?

2022-01-31 Thread Nuno Santos
Alexander, Thanks for your reply. In the mean time I have discovered that I had to change ANDROID_NDK_PLATFORM env var to android-23. By default it was set to android-21. Best regards, Nuno > On 25 Jan 2022, at 22:50, Alexander Dyagilev wrote: > > Sorry, forgot to say. As far as I know, the

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

2022-01-31 Thread Andrei Golubev
Hello, What Scott suggests should help a lot. Using a slightly different approach, if you know how many tiles you need, say 60k, isn't it enough to figure out the tile position already? Given an index 0 <= i < 60k, you should be able to map it to a 2-dimensional coordinates if you know how many