8

I regularly run a .jsx script in Adobe Illustrator that saves a bunch of files in a particular format.

  • while Illustrator is the active app, running the script on 5 files takes 23 seconds.

  • When Illustrator is not the foremost app, running the script on 5 files takes more than 5 minutes.

  • According to Activity Monitor, Illustrator is using around 75% of the CPU when in the foreground but is throttled to less than 2% when in the background.

  • According to Activity Monitor, App Nap is not being used.

Why is this happening, and is there a way to change it?

I would like to be able to do other tasks while waiting for Illustrator. As it stands, I am obliged to keep Illustrator in the foreground.

Some things I have tried: I knew that

sudo sysctl debug.lowpri_throttle_enabled=0

worked to accelerate Time Machine backups, so I though it might help in this case. It had no effect.

I also tried disabling App Nap:

defaults write NSGlobalDomain NSAppSleepDisabled -bool YES

It had no effect.

I tried TinkerTool, but I believe that it's just a GUI to change the lowpri_throttle_enabled setting. It had no effect.

6
+100

This appears to be be an Adobe issue; specifically, the code-base for AI is not multi-threaded.

I was able to find a discussion in the Adobe forums that addresses your exact issue - Make Illustrator multi threaded on CPU

Illustrator performance is awful, its slow and lumbering at all but the most basic operations. It is bound to only a single cpu thread which is ridiculous now in an age of multi core and multi thread CPU's and it has been this way for many years. It cannot handle background tasks and is completely out of parity in function and performance with other Adobe software such as Photoshop and inDesign.

Emphasis mine

Unfortunately, if the code cannot support background CPU operations, there's nothing you can do from your Mac's perspective to speed things up. As the users in the forum all (begrudgingly) accept, the only solution is to wait for an update from Adobe.

Why this is so

Generally speaking, applications in the background are "paused" - technically, they are given low priority. What this means is that execution stops until the CPU has an opportunity to execute some more commands; usually during an IO fetch operation. Managing this process is called "CPU Scheduling" and is something the hardware handles for you - the application just has to allow it (relinquish control).

A common misconception of multi-threading is that things execute faster. This is not the case, it's just more things happen simultaneously making better use of the CPU resources. It's like having a single taxi (people carrier) shuttling people between an airport and a conference center versus four doing the shuttling. They're all going the same speed, it's just now you're moving more.

The application being "multi-thread capable" allows the hardware to manage and schedule CPU time and being that there's more CPU that can be allocated, the background jobs get more resources to get the job done.

  • 1
    Can you explain briefly why a non-multi-threaded application would be slower in the background? My imagination proposes: there are N threads running at one time, and the Mac automatically uses 85% of its resources on the "main" user-facing thread and 15% is divvied up for all the other threads. I don't know anything about this, I'm just making it up. – Andrew Swift Apr 20 '18 at 12:40
  • 1
    Generally speaking, single threaded apps are "paused" in the background and "run" in the foreground. To keep an app alive while in the background, it will momentarily "poll" the CPU and call some functions to do things (your file saving, for example). It's not about "allocating CPU" per se. From reading the forums, people with 8 and 16 core Mac Pros are only seeing a single core being utilized when running AI meaning it's simply not taking advantage of the full resources. – Allan Apr 20 '18 at 15:38
  • 1
    If you'd like to update your answer with this description, I'd be happy to choose it as correct. – Andrew Swift Apr 21 '18 at 14:24
  • 1
    @Allan Wow! I would have never guessed that Adobe Illustrator doesn't support multi-threading! To me it seems a likely candidate for multi-threading. Then again, it took Microsoft a long time to support multi-threading with Excel (another obvious candidate), and even now its implementation is not very good. No doubt as time goes by more and more apps will support it. – Monomeeth Apr 22 '18 at 5:11
  • 1
    @Monomeeth - I agree. I couldn't belive that AI was so far behind the dev curve. One thing I read in the forum was users lamenting that CC would essentially allow Adobe to collect revenues and not fix the product. With Apple moving to their own CPUs and killing support for 32bit apps, Adobe might be forced to fix things. – Allan Apr 22 '18 at 15:51
0

This answer is from Mordy Golding, Product Manager for Adobe Illustrator (2001-2004), at Quora:

Vector graphics have their advantages and disadvantages. This, sadly, is one of the downsides. That's because vector graphics are drawn in a linear stacking order.

Take one simple example -- take a single layer with a single rectangle. Duplicate that layer 100 times. Even though only the top layer is visible, illustrator draws each rectangle from the bottom most layer to the top. Illustrator can't draw layer 50 until the previous 49 are done. This is unlike photoshop that is just concerned with which pixels are ultimately visible.

Extending the concept further. Say you had 4 cores. You could take a photoshop file and split it into a grid of 4 areas and tell each core to draw 1 area -- all at the same time. That's because a pixel in one grid has no impact whatsoever on pixels in another grid area. Since you can split a photo into multiple independent areas, you can assign multiple cores to render each area simultaneously.

However, in illustrator, each object is drawn in the order it appears in the stacking order. So if I split an image into a grid of four, I still have to build all art object by object no matter what grid it is in. Meaning all 4 cores would still have to wait until all objects were drawn before rendering.

What this means is that only some kinds of functions can support multi-core functionality in Illustrator. For example, if you print a large file, illustrator will hand the print spooling off to another core and return you back to your document to continue working immediately. But sadly, this isn't possible for speeding up linear tasks like drawing/rendering art.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .