Author Topic: Inkscape slowing down with just 6,859 to 48,018 objects.  (Read 360 times)

July 05, 2019, 06:51:59 PM
Read 360 times

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
Hi,

I am attaching a .svg file that has my latest version of my map project. 

I have an analogy so we can use the right terms that I am using to describe my "map."

I drew one hex. 
One single hex represents a farm.
I group 19 farms (a hex ring with a radius of 3) into a town.
I group 19 towns into a city.
I group 19 cities into a state.

This is the level that my map is at right now.  I have one grey State and one red State on the page in the .svg. 
I copied each one and put 3 grey states together in the lower left and 2 red States together in the upper right part of the Canvas.

19^3 = 6,859. 

And 7 * 19^3 = 48,018.

So, just in the 7 States I have in the .svg file, I have 48,018 Objects (each hex is considered a separate Object by the Inkscape program).  There are also a few hundred extra hexes in there that I used to build them so that I can control the colors in each sub-assembly.  I showed my mom this and she said it looked like an Afghan Blanket.  Yep. 

Here is where I start to get a little confused.

I have an MS Word doc that has "Jason is an idiot" copied and pasted 1,000,000 times (so I sent it to my family and said "Hey Everyone, if I have told you once then I have told you a million times that Jason is an idiot."  Cheap joke, yeah, but I am not above a cheap laugh.  Any laugh is a good laugh.  Except Dad Jokes.  I have my standards...).  If I open that document, it takes about a minute to completely open.  If I type somewhere in it, there is a delay of 1-2 seconds, and if I try to move from one page to another, there is a delay of several seconds.  However, I can still get useful work done in the document, it's just noticeably a pain to deal with when we are all use to instantaneous responses from these things on a daily basis. 

I also have a million word document that is a novel of a buddy.  It includes revisions.  That's comparably slower to work with, but not impossibly slow.  The "Jason is an idiot" fie is 21 MB, and the novel is about 30MB.  My brother in law is a finance guy at a corporation, and ALL of his job involves Excel Spreadsheets.  He's shown me some files that are hundreds of MB, but he says the biggest reason his file responds slowly is because it is grabbing data from company servers all over the world, and they are updated in real time. 

I realize that MS Word and MS Excel have over 30 years of development by the biggest corporation in the world and to compare that to an open source program is completely unfair.  I'm just explaining where my head is at.  Specifically: it does seem to me that a drawing program ought to be able to handle thousands of objects without issue.  In my mind, I figure any drawing program ought to be able to handle a canvas that is several feet by several feet.  Right?  Or am I just over-extrapolating what 50 years of Moore's Law ought to be able to handle nowadays? 

I am also guessing that maybe Adobe Illustrator could handle this better, since they are also a huge corporation with decades of development?  Although before I picked Inkscape, the reviews said that Inkscape is pretty close to matching Illustrator in most ways.  But maybe scaling up from hundreds to millions of objects isn't one of those comparables?  I wouldn't mind getting a subscription for a couple months just to do what I want as far as being able to put all the States, Countries and Continents into a single image and then pay to have it printed out in a large poster format.  I'm fine with breaking it up into different files and doing the detail work of the maps in Inkscape and all in different files. 

I am also attaching a screen grab showing the capabilities of my laptop.  I bought it a couple months ago, and while it's not a gaming computer, it is strong enough to run Dragon Naturally Speaking (speech to text) program without a hitch.  I do wonder if the 8MB of onboard memory is a bit small?  I'd be willing to trade this in on a tower that has 32 MB of onboard memory.  My budget starts to run out after a few hundred. 

I'm also wondering if I could take the "Red State" that I have already drawn in the .svg file and strip all of the data out of it and just treat it like one object that has a multicolored surface.  If I could cut it along the edges (instead of just cropping it into a rectangle), then I could line up the edges in most any print type of program and make it much bigger that way.

Oh, for the record.  Here is my goal.

I have one red State and one Grey state right now.  I'd like to make a dozen different colors of states, and then put 19 States of the same color together (same hex pattern) and then call that a country.  Then I'd like to take 19 Countries and a couple hundred grey States and put them all together into one Continent, and that would be the final picture.  It would be about 1,800 hexes across (if I kept the paper at the same scale of 1 hex = 1 cm, then it would be a sheet of paper about 19 meters by 19 meters.). 


At this red hot minute, however, my problem is that Inkscape isn't able to work with the file I have attached any more.  It takes a few minutes for it to process a "copy" and "paste" of the two red States, and when I try to align the 2 red States to the other 2 red States, it takes several minutes and the program freezes about a third of the time (especially if I go do something else (like watch a video) that requires a lot of computer processing power while I am waiting for Inkscape to finish processing.). 

Or maybe I am overlooking something?  I don't know.  It could be an easy fix, or it could be time to rethink how much I want to spend on this map?

Thank you for reading and any help or insight you can provide.

BHD

PC System:
  • 1.0 Alpha
  • Win10

July 05, 2019, 06:52:41 PM
Reply #1

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
attachments didn't attach...
  • 1.0 Alpha
  • Win10

July 05, 2019, 06:55:29 PM
Reply #2

Bad Hair Day

  • Jr. Member

  • Offline
  • ***

  • 38
  • Gender
    Male

    Male
  • 1.0 Alpha
  • Win10

July 06, 2019, 07:02:06 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Well, I tried to explain this before.  Looks like you're up to approx 13 mb.  Have you tried using File menu > Clean Up Document yet?  If you do it when nothing is selected, and watch the status bar, you can see how much data was removed.  In your case, it probably won't help much.  But maybe?

I can't speak in a technical way about the difference between a text file and a vector graphics file.  But it's really, and not just with proprietary vs opensource, comparing text files to graphics files is also apples and oranges.

The SVG file is not just the drawing that you see on the canvas.  Have you ventured to look at the XML Editor yet?  As far as I understand (and when it comes to technical things like this, there's a good chance I don't understand - someone is probably going to correct something I'm about to say) it's the XML code which is responsible for most of the file size for an SVG file.  The code is what creates the display that you see (wherever you view the image).  If you wanted to, you could create your drawing by coding alone, without any interactive canvas.

There's probably a free Illustrator trial available.

I still don't have a clear understanding of what you'll be doing with this file.  If you could do it with raster graphics, you could probably go much bigger.  Or maybe you could make a raster export for as much as you have made now, and use that for a background, while you work on only a small portion of the canvas with "live" vector contents?

Or even hiding 90% of the drawing on a separate layer might allow you to add more contents?  Did I give you that little tutorial I wrote, with techniques to avoid performance issues?

It IS possible to optimize the file, and reduce it's size.  So you might gain a little more that way.  I think there's an extension for optimizing the file (external, I think) or you could just use Save As SVGO, and you'll be presented with a dialog with lots of options.  (I couldn't help with that much, because I don't understand most of it.  But I'm sure others could help.)  (I should probably add optimization to that little tutorial....)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 07, 2019, 01:36:56 AM
Reply #4

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Currently I'm working on a 25+ MB svg -containing mostly paths. There is a certain lagging.

Checking your file for optimisation.

July 07, 2019, 02:55:33 AM
Reply #5

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
You can create a pattern fill that provides the black strokes contouring small hex tiles and ditch alot of unnecessary cloning by merging the small hexagons to be districts or even a whole town.


Attaching an example.


Side note:
1000 cm / 600 cm is an unreasonably large page size for production.