Arrowheads are eating my CPU

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
Posts: 5
Joined: Sun Jun 12, 2016 8:34 am

Arrowheads are eating my CPU

Postby halkun » Thu Jul 20, 2017 10:21 am

Now I have a pretty beefy mid range system. (Win10, i7-6700 @ 3.4 Ghz w/16GB Ram) but arrowheads seem to make my computer crawl.

I'm re-drafting some aircraft carrier bluepints, and I need to delineate the spaces in the holds with little arrows that point to the center of the tank. It's all good, but when I place an arrowhead on my line, the system pauses for a good 6 seconds before I can put down my next shape. I also seem to have accumulated a collection of arrows (all the same) in my arrow selecter. I've done a document cleanup, but the arrows persist. Why would placing an arrowhead eat up so much resourses? I've made about 400 of these arrows so far and need about 2k when I'm done with the holds. Am I in danger of running out of resourses, or is the arrowhead pause just a thing it does?

Posts: 4575
Joined: Tue Jun 14, 2016 10:38 am

Re: Arrowheads are eating my CPU

Postby Lazur » Thu Jul 20, 2017 10:52 am

Welcome aboard!

The danger is real as of 0.48 that was the main reason of crashing -timing out due to garbage collector hanging while dealing with hundreds or thousands of unused defs. (There the problem was every gradient tweaking resulted in a new gradient definition. Tested on i5.)
Probably you don't need a collection of the same arrows. Haven't checked if there is a similar setting to gradients where you can "lock" definitions,
but apart that there should be a workaround.

By duplicating one arrow (Ctrl+D) instead of copy-pasting, there won't be a new definition created.

The fact you can't use cleanup document on all the unnecessary arrows means they are being used somewhere in the document.
So before vacuuming defs select all objects and set 1 arrow type for all, then the rest can be sorted out.

Posts: 5
Joined: Sun Jun 12, 2016 8:34 am

Re: Arrowheads are eating my CPU

Postby halkun » Thu Jul 20, 2017 3:19 pm

I'm not cutting and pasting... I'm creating a new arrowhead for every line I draw. It's just duplicating the arrow head in the drop-down so I have this HUGE drop down of one arrow head type

I need all of these arrows. I don't see how a tiny three-vertex object can cause inkscape to crash after a while

I should just have one arrow in "palette" and duplicate that then? What should I do with the 400 some-odd arrows that I already have, select them and then have them all be one arrow type and then do a document cleanup?

Ninja Edit

Ok, I purged all the arrowheads by turning them back into lines again, Now it's *MUCH* better.... but now what? Now I have little sticks everywhere. Do I select all my arrow lines at once and apply just one arrowhead to all of them?

Ninja Edit 2

Nope. That just put ALL the duplicates back again... How do I fix this so I can have my sweet, sweet arrowheads?

Ninja Edit 3

aaaannd duplication (CTRL+D) also does not work. It creates a duplicate arrowhead in the list as well. It looks like The arrowhead system is completely boned!

User avatar
Posts: 9931
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA

Re: Arrowheads are eating my CPU

Postby brynn » Fri Jul 21, 2017 12:40 am

I can't help much with the marker issue. It does appear that a new def is created each time you apply a marker. It doesn't matter whether I create them one at a time, or select many paths, and apply the same marker to each, all at once. It still creates a new def for every single marker.

There's a chance you had a build-up of unused defs, and once you cleared them out, things will go more smoothly. But it looks like every time you apply a marker it creates a new def. It's hard for me to imagine using so many markers that it impacts the cpu. Oh wow, you said 400 so far, and you need 2000?

I guess I would consider drawing an arrow head, just using regular paths. And then use that instead of markers. If that starts to make the file heavy, by sheer number of nodes, you could try cloning the original arrow head. Clones do not generate defs like markers (as far as I can tell anyway).

You can use the Tiled Clones dialog to create a large number of them all at once. Cloning is a way to cut down a large file size, if you use many of the same object repeatedly. But then you still need to place them on the paths, one at a time.

(Note that you must clone off of the original each time, if you don't use the tiled clones dialog. It's a lot faster to repeatedly click the clone button (or key shortcut), but when you start to have a clone of a clone of a clone of a clone, it wreaks some kind of havoc on the file, which is good to avoid. So I would suggest using tiled clones. You don't need to create any special array. Just have them created on top of each other, since you can only use them one at a time anyway. Note that if you try to create 2000 all at the same time, it will probably take a minute or 2 or 3.)

Return to “Discuss Software Issues”

Who is online

Users browsing this forum: No registered users and 1 guest