Inkscape.org
Beginners' Questions [MacOS] Inkscape lagging
  1. #1
    petiti petiti @petiti

    Hi everyone, i hope you can help me with this issue.

    I have been starting to use Inkscape for music composition (lots of graphics), mostly only black lines and symbols. After a few pages now and a file size of the inskscape session .svg of 7.5MB it started lagging a lot.

    I am using a quite old macbook from 2013. Is that the only reason or would it lag anyway because Inkscape can't handle so many single objects and groups and paths?

    thank you for helping me :-)

  2. #2
    COD COD @COD

    7.5MB seems huge for a vector file. Are the black lines and music symbols vector or raster format? 

    Don't know anything about music symbols but I do know about Inkscape symbols. Using Inkscape symbols can dramatically reduce the file size.  I use them in almost everything I do that has repetitive objects. 

    Have you tried this Musical symbol library? 
    https://inkscape.org/~HongKong-3/★musical-symbols

  3. #3
    COD COD @COD

    This around 2200 objects and only takes up around 370k bytes - using symbols

     

  4. #4
    petiti petiti @petiti

    Hi and thanks. Really is that an issue now? Would love to continue like that, and i don't want to change anything from this file. I can give you an example how this looks like: Everything is vector format, (i guess) i am new to that. I export .svg files from a regular music composition software and then import it there because the arranging of graphical elements is amazingly intuitive in something like inkscape.

    I am copy pasting almost every object you see there on these pages.

    So a very strong computer with like 24gb of ram etc. would also have issues with big inkscape files?

     

  5. #5
    petiti petiti @petiti

    Here more screenshots with additional info of the file:

  6. #6
    COD COD @COD

    It could be that the music software you are using is creating paths that involve a ton of nodes when it exports out. Obviously the software is not using SVG symbols. Even if the software used SVG symbols you would only save maybe 50% in file size (maybe more-maybe less). 

    Any particular reason you are exporting out as SVG? 

    I looked at that symbol file that I sent you the link to. It seems to be very efficient. Could be made more efficient if the designer rounded off the path data. No degradation of quality. 

    To answer your "bottom line" question, Inkscape tends to get laggy around 2000 path mark for me on WIndows 11. I don't think it is a question of memory because I have 32gb and I rarely see Inkscape using more than 5% of my memory. 

    When I import my SVG designs into Affinity Designer, it tends to get laggy around the 10,000 -20,000 path mark. Wild guess because I can't tell how many paths. 

     

  7. #7
    Polygon Polygon @Polygon🌶
    petiti

    I am using a quite old macbook from 2013

    In combination with macOS version? Is it the MacBook Pro and in which configuration. It´s old in tech not so much in years methinks. 😅

    COD

    When I import my SVG designs into Affinity Designer, it tends to get laggy around the 10,000 -20,000 path mark. Wild guess because I can't tell how many paths. 

    I have not yet succeeded in bringing it to its knees. Depends on the machine/macOS combo I guess.

  8. #8
    COD COD @COD

    Polygon-

    If you are referring to AD, yeah I was stunned not only how fast it is - but how stable it is on a Windud machine. Did some tests on it when I first purchased it last spring. Blown away to be honest. 

     

  9. #9
    Polygon Polygon @Polygon🌶

    @COD yes AffinitySuite is sick on M-SOCs/macOS/iPadOS

  10. #10
    petiti petiti @petiti

    @Polygon: My macbook pro is from 2013 and runs Big Sur 11.7.10. Storage 512GB, RAM 16GB, Quad Core Intel Core i7 Processor. It still works in most applications but the fans go crazy already watching even youtube videos. 

     

  11. #11
    petiti petiti @petiti

    @COD: So Affinity Designer can stem larger .svg sessions without lagging? I also thought about either switching software if Inkscape is not fine with such large files or upgrading computer

  12. #12
    Polygon Polygon @Polygon🌶

    @petiti Big Sur was the first macOS for the new SoC Macs (M1) in 2020 what I still use - see screenshot and 16GB Ram is shared memory. Does it run natively on your MB-Pro or did you used a Patcher? I believe it´s the latest for a 2013 MB-Pro. In the info box about Inkscape.app you can choose to run it in a "low resolution" - needs a restart - maybe that can help.

  13. #13
    COD COD @COD

    Seeing how you are using pages, I would suggest Affinity Suite (Designer, Photo and Publisher). Designer is vector based but it is not SVG. However, you can export/import SVG. 

    I have my own pet peeve on how software import/exports SVG. The SVG specifications have been around since 2003 but I haven't found one that trully followed the specs. Not even Inkscape. 

     

    I suggest finding a group on FB or Reddit and ask questions before you commit. 

  14. #14
    petiti petiti @petiti

    @Polygon: It runs natively, i updated it regularly over the macOS function and was reminded by it to upgrade the OS. I did that low resolution setting  (see image above) and it went better, but still lagging and annoying and makes everything i do take way longer.

  15. #15
    petiti petiti @petiti

    @COD: Great i will run the freeware of Affinity Designer now and check if i can import that big 7.5MB music composition file. And also i will run this 7.5MB file on a different, newer mac to see if its that.

  16. #16
    petiti petiti @petiti
    *

    I am this moment trying out Affinity and it seems like a nice software.

    1) Only my workflow where i benefit from having all previous pages open and copy past"able" is essential to my workflow.

    In Affinity you work with Art boards which are line up next to each other. As soon as i would want to edit something, a new document opens up where you can edit this page, and only this page without seeing the rest.

    2) Copy Pasting is a hassle! The object gets copied always exactly where the previous one is located. Meaning: If you would want to copy it to a specific position, it doesn't. Inkscape copy pasts exactly where my mouse cursor is located.

  17. #17
    COD COD @COD

    Affinity Publisher

     

  18. #18
    Polygon Polygon @Polygon🌶
    petiti

    freeware of Affinity Designer

    What´s that? The test version?

  19. #19
    petiti petiti @petiti

    It is a test version for 7 days but with all the features.

    But yes, it might be Affinity Publisher, the one i need. Or Adobe Illustrator. As an inkscape alternative for manly music notes.

  20. #20
    Tyler Durden Tyler Durden @TylerDurden

    @petiti Please share an example SVG file for examination. Thanks.

  21. #21
    petiti petiti @petiti

    @Tlyer Duden: Can send it to you via private message

  22. #22
    Tyler Durden Tyler Durden @TylerDurden

    Replied to PM with my email addy. 

  23. #23
    petiti petiti @petiti

    Thank you

  24. #24
    Tyler Durden Tyler Durden @TylerDurden

    For the benefit of any readers with a similar issue:

    I'd work on a copy of the document, in case I break something.

    First, I'd use File>Clean Document, which can remove unused elements, sometimes thousands of them. (In this case, only a couple hundred.)

     

    Continuing:

     

    There are many many areas where the document has unnecessary style information that bloats the document dramatically.  >1500

     

    An example attached shows font styling for a polyline that is not a text object.  

     

    There are are also many many groups containing one object, that do not need to be grouped. >1500

     

    There may be a way to remove the improper information in an efficient manner.

     

     

    Here's a polyline with font styling that is not needed:

    The Inkscape XML editor can show us the information, but it's not the most powerful tool for cleaning up large documents (or multiple documents).

    The existing document could be edited in a text editor (Atom, Notepad++, etc.), where Find/Replace can be used to remove all instances of useless style and grouping information.

    Here, Find indicates there are instances of text style information applied to >4000 groups. That's four lines of code for over 4000 groups that don't need it.

     

    There is font styling of thousands of polylines as well.

    The general idea here is to reduce the unneeded information in the document so Inkscape doesn't try to parse it all.

    I'll usually make a large change, save the copy, then check in Inkscape that nothing got broken. Repeat as needed.

     

    In new documents, I'd try to minimize the inclusion of any unneeded bits, so that they don't propagate by multiple copy/paste operations.

    Any assets I import that will get re-used (lines, notations, markers, etc.), I'd turn them into symbols and keep them in a document as a repository to use in any documents that also use them.

     

  25. #25
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Maybe this can help.
     

  26. #26
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Here's a file optimiser that provides some of Tyler's suggestions in a GUI.
    https://jakearchibald.github.io/svgomg/

  27. #27
    petiti petiti @petiti

    @Paddy_CAD: Thats an amazing tool. Works so far great. Only thing is it deletes the pages (white blank pages from inkscape) but keeps my graphical information inside. But yeah it makes the file super small .)

  28. #28
    COD COD @COD

    petiti - this is not  related to your issue but I wanted to add that if you use a ton of live path effects in a design it is best to finalize the path effect. live path effects that have not been finalized can really destroy your performance no matter how much memory you have. 

    Tyler, Paddy - I come across these redundant style issues - cleaning the document helps sometimes (sometimes not)  - Thanks

  29. #29
    DeclanWolfe DeclanWolfe @DeclanWolfe

    Thank you so much for the help.

  30. #30
    petiti petiti @petiti
    *

    Yes thank you all for the amazing tipps! I will stay with inkscape and not switch to publisher or illustrator. 

    cleaning the file, and also upgrading computer (from 2013) makes performance much better and usable again! 

  31. #31
    COD COD @COD

    petiti - you didn't mention the music software you used to create the SVGs. May I ask?

    If I get bold enough, I might contact them and see if I can get them to create more optimized SVGs. 

  32. #32
    petiti petiti @petiti

    @COD: It was rendered out in Dorico 5. With the graphical slices option you can render out either pdf, svg, png, tiff.

  33. #33
    COD COD @COD

    Didn't even know that existed. 

    Really curious now. Can you attach a sample? Single page? 

  34. #34
    petiti petiti @petiti

  35. #35
    COD COD @COD

    Oh yeah - that is a complete SVG mess.

    Sample path data applying redundant text style. Could also round those to 1 decimal place. OMG

    I wonder if you could export out of Dorico as PDF then import back in to Inkscape would "help"?

     

  36. #36
    petiti petiti @petiti
    🙈

    Yes maybe in the future i will do that, exporting pdf.

    But for now i did all the work and exported these symbols and arranged it in my file which took days.

     

  37. #37
    Tyler Durden Tyler Durden @TylerDurden
    👍

    I would caution that pdf has its own set of issues when importing to Inkscape.

    @COD, Here's a shot of the raw Dorico file in a text editor before Inkscape.

    The decimals are not so many, so I'd check your Inkscape settings.

    It appears that COD's screenshot of the Inkscape XML editor also shows Style tags for paths that are not in the Dorico SVG nor in the unedited Inkscape import, until the groups containing paths are ungrouped - causing the paths to inherit the attributes of the groups (the coordinates also seem to differ in the raw file supporting the ungrouping theory).

    We can easily say that the Dorico svg is lacking in the basics: object IDs of SVG, styling and grouping (no need to create groups for every object), etc.. Inkscape's re-formatting of the svg upon import may be adding to the confusion.

  38. #38
    COD COD @COD
    *

    Tyler: 
    This what I am seeing in Visual Studio Code on the raw Dorinco SVG export:
     

    <g fill="none" stroke="#000000" stroke-opacity="1" stroke-width="1" stroke-linecap="square" stroke-linejoin="bevel" transform="matrix(0.499998,0.00140702,-0.00140702,0.499998,75.7424,77.6946)"
    font-family="Bravura" font-size="37" font-weight="400" font-style="normal" 
    >
    <text fill="#000000" fill-opacity="1" stroke="none" xml:space="preserve" x="0" y="0" font-family=".AppleSystemUIFont" font-size="13" font-weight="400" font-style="normal" 
     ></text>
    </g>

    Basically an empty group containing trash.

    font-family="Bravura" font-size="37" font-weight="400" font-style="normal" 

    I see that style 576 times on valid path data and it is totally redundant and not applicable. 

    When I opened that in v1.4 - I get a blank canvas. So, I opened a new document and imported the SVG. Worked. However 1.4 added extra decimal places because I have the precision set to 16. I had that setting because I was documenting a bug in v1.4 at the time.

    When importing SVG with valid path data, Inkscape shouldn't do that. I consider that a bug. So - I have to fill out yet another bug report. If that raw svg file loaded up correctly for you without doing an import, then I have to fill out two bug reports. LOL

  39. #39
    COD COD @COD

    Tyler 
    As I suspected, that Dorico SVG export will not load up correctly in v1.4 and will load up in v1.3.2. The only way I can get that into v1.4 is to actually import it. Which as you documented causes other issues for me. Yet another bug report for 1.4 - lol. 

    I sort of figured that out because I know you switched back to 1.3.2. ,
    Unfortunately for me, 1.3.2 has a serious symbol bug that is fixed in v 1.4. 

  40. #40
    Tyler Durden Tyler Durden @TylerDurden

    Yeah, If Inkscape would actually clean the useless style info, the situation would be greatly improved.

    These settings are not removing the text styles from the groups. :-/

    The issue rapidly compounds when groups with styles are ungrouped, multiplying the useless styles to all the objects freed from the group. 

  41. #41
    COD COD @COD

    I have not been able to get that to actually work ... period. It actually crashes inkscape 1.4 for me. 

    Guess what? When I reset my preferences in 1.4, I can now directly open that original SVG Dorico export. I have no clue what is going on with v 1.4 now. 

    Before I first installed 1.4 - I deleted the preferences to 1.3.2. So - somewhere along the line, the preference file has become corrupt. I have read reports about this before. I cannot think of anything in a preference that would prevent me from loading that file directly. So I am guessing that a corrupt preference file literally screws up the behavior of Inkscape. That in itself is a bug. 

    Now - I am thinking that the bug reports I filed yesterday (unrelated to this thread)  are invalid. lol

  42. #42
    Tyler Durden Tyler Durden @TylerDurden

    Ugh.

    We are seeing a number of users who cannot launch Inkscape after closing a file in 1.4, even after reinstall, so I'm pretty sure there is preferences corruption for some unknown reason.

  43. #43
    COD COD @COD

    I first heard these reports of preference file corruption a while back. So, I reset my preferences. Set them to what I wanted. Then slapped a read only attribute to it. Inkscape worked perfect for a long time. That in itself is a bug because Inkscape is obviously not checking the error code when trying to rewrite the preference file and can't. lol

    As I said - it has worked without errors until this week I was trying to verify a bug I found and wanted to see if was due to my preferences and disabled the read attribute of the file. 

    Obviously in the last week I guess Inkscape corrupted my preference file and prevented me from loading that Dorico SVG export directly. I can't think of anything, even in a corrupt preference that would cause that. 

    Sad thing is - now that I have reset my preferences again - I can't duplicate that Dorico loading bug. If I can't duplicate it, be useless to report it.

    Corrupting the preference file is a huge bug. However, a corrupt preference file causing these issues is even a bigger bug.