Thread: Two questions
View Single Post
  #22  
Old September 16th 15, 04:54 PM posted to rec.photo.digital
Floyd L. Davidson
external usenet poster
 
Posts: 5,138
Default Two questions

"Mayayana" wrote:
| second of all, you haven't any clue about multithreading. zero.

Multi-threading is not the issue.

https://en.wikipedia.org/wiki/Multit...%28software%29

A single core CPU has multithreading via
time slices. The advantage of multi-core is
that a single, intensive operation can have
a dedicated core, without locking up the
machine and without needing to share time
slices.


That is very clearly correct. Multi-threading, unlike a
multi-core system, shares CPU GHz between all processes.
There is no speed up at all. Multi-threading a single
core actually slows down any single threaded process
running.

The issue is whether PS can actually
use multiple cores in any significant way. For
that it needs to be running two or more processor
-intensive operations concurrently. Do you often
run a sharpening routine on a 40 MB image while
at the same time running another filter? If not
then the sharpening will run faster with less cores
because the core being used will have a higher
MHz speed.


That isn't quite right. The sharpening routine can
easily be coded to run on multiple cores simultaneously.
Sharpening can be divided up over different geographic
areas of the image, each core doing just one section,
and all cores working at once.

That is just one way, and certainly there are others.

No one needs to go by what I'm saying. In
Windows one can run Task Manager to see usage
in real time. There may be something similar on
Macs. So rather than carpet-bombing the thread
with empty, un-qualified pronouncements and
insults, why not do some experimenting for
yourself? You can then decide what's best for
you. Maybe you'll find that PS is somehow running
your sharpening routine on 2 cores, but that's *very*
unlikely.


I would expect it to use multiple cores. I don't use
Windows or a Mac, but I have system monitoring software
that graphically shows the load on each core. Typically
a sharpen operation on a large image takes long enough
to easily see what actually does happen. On a 8 core
system about 90 percent of the time is spend with 1
single core showing 100% usage all of the time, and from
2 to 3 other cores being hit repeatedly for short
intervals. In the last few seconds, which I assume is
when it puts all of the segments back into the image
buffer, all 8 cores get hit together for an extended
period. Extended is longer than the short hits earlier
in the process, but it doesn't actually last very long
and the entire process is finished.

Another program uses one single core for the entire
process.

The routine is a single operation that needs
to go through the image bytes with a math operation.
There just aren't two things to do at once.


But there can be. Different parts of the image can be
done separately, as just one example.

Much of the time there's very little CPU
usage on a typical machine. If I do something like
run a CPU-demanding script then I'll see 48-50%
usage by that process, because I'm using a 2-core
machine. Meanwhile, nothing much else is registering.
If I had four cores the script would run at about
half the speed, because it can't be run across 2
threads. For that the script would have to be
running multiple, separate operations. Likewise
with PS. A sharpening routine is a single operation.
You can't spread it across 2 threads or processes.


If you had four cores it would not run at half the
speed. Same two cores, same speed. Just that the other
two cores would be idle.

I use UFRAW as a RAW converter. It can be compiled to
take advantage of multi-threading. On a multi-core
system that means it runs significantly faster. But for
my purposes I compile it without the multi-threading
because I virtually always run it via a shell script
that launches multiple processes, one per CPU core, and
has measured efficiency that is greater than
multi-threading a single process.

The difference is that if I compiled with
multi-threading and ran UFRAW process sequentially it
does not process a large batch of files as fast as when
compiled for single threading but is invoked with 8
process in parallel.

If you print and go online and have AV scanning
while you're doing the sharpening routine then the
4 cores might be better than 2. But what I'm getting
at is that much of the time, for most people, only
one CPU-demanding operation at a time is happening.


Image editing is generally a case where the more cores
the faster many, but not all, individual edit commands
will be executed.

--
Floyd L. Davidson http://www.apaflo.com/
Ukpeagvik (Barrow, Alaska)