Inkscape.org
Beyond the Basics Optimizing performance of a document.
  1. #1
    2-Zons 2-Zons @2-Zons

    I am using a pattern of hundreds of  tiled clones as a background.  Once I added these clones the file is verry sluggish.   Doing any editing at all has huge lag.  In some cases it takes up to 10 min to respond.  I've got a pretty powerful workstation with 32GB of RAM.  Are there methods to use hundreds of objects that don't lag the file down.  I can't combine these objects as they each have a gradient fill. I tried saving it as a compressed inkscape SVG but it had no effect on performance. I also increased the threads and memory cache size in the preferences but it made little if any difference. When the program is frozen (usually from deleting a large amount of objects at once) the CPU usage never gets above 13%.

    When you think of the amount of computations that a typical game does on the billiions of datapoints that represent a 3D scene, with reflections, shadows, depth of field, and other effects, at 100 frames per second, it's crazy to think that a few thousand datapoints of beizier curves and gradient fills would be such a chore.  I wonder if they could use the GPU to speed up performance. 

  2. #2
    Tyler Durden Tyler Durden @TylerDurden
    *

    The filters are a killer... remember svgs are pretty much rendered real-time.

    Try cloning the attached. I put 2500 of them in the image and working still seemed responsive after the clones were created.

    I converted the filter/shadow behind the $ to a bitmap (Alt+B). 

    Dolla
  3. #3
    2-Zons 2-Zons @2-Zons

    I did a test with 3000 of them.  it seems like it might be better but there is still lag.   I guess I should get in the habit of converting all my filter effects to bitmaps?  I imagine that filters are causing more intensive calculations than a simple bitmapped alpha channel.  Thanks for the tip.

  4. #4
    brynn brynn @brynn
    *
    2-Zons

    I guess I should get in the habit of converting all my filter effects to bitmaps?

    Only if you're always going to be making this kind of file, with thousands of filtered objects.  In a more typical file, there should be no need to convert filters to raster image.

    I would think that if this image with thousands of objects is going to be a background for a game or something, another option would be to convert that whole image to raster (PNG).  That should make it much smaller as well.

  5. #5
    2-Zons 2-Zons @2-Zons

    The problem is that the file is 105" by 52".  That would be one hell of a bitmap even at 150dpi.  But I could turn the indivial graphic into a bitmap without transparency.  It might perform better that way. 

  6. #6
    Xav Xav @Xav👹

    If filters are causing your problems, don't forget you can temporarily turn them off through View > Display Mode > No Filters. Other things that can speed up rendering:

    • Try to avoid zooming in and out too much - particularly zooming far in.
    • Reduce the size of your window, so there's less area to repaint (and recalculate). Move dialogs out into separate windows rather than docking them, to give you more flexibility with the canvas size.
    • Spread your filtered elements across multiple layers, so you only need to turn on the ones for the area you're working on at any time.
    • If you need the filtered version of things as a reference, use Edit > Make Bitmap Copy then hide the originals or use No Filters mode.

    As you've found, a compressed Inkscape file makes no difference - it's just a normal Inkscape file that's zipped on saving and has no impact on the drawing itself.

  7. #7
    Lazur Lazur @Lazur

    Hi. 

     

    Didn't see it as a filter rendering issue from your first post. With 3000 clones and/or using clones of clones, cloning to that extent can be a performance killer itself.

    Wherever possible I'd try using a pattern fill instead of tiled clones. That way the rendering gap issue can also be avoided. Probably the file size will end up smaller too. 

    Needs some testing but as far as I could see it's the nested attributes/transformations that are spread over the file can cause slowdowns. 

    So if you have to rely on cloning, make the parent as simple as possible. Remember the built in tiled clones panel has a 20*20 number of clones limit for some reason. 3000 clones are an excessive amount. 

     

     

    On the filtering: svg seems to lack a certain support from the rendering side in general. The only positive side is the scalability -that theoretically you can export at any given size, although the resources needed grow exponentially with the zoom level (if gaussian blur is used in the filter chain). 

    Then again, for printing you'd need to rasterize those filter effects when saving as pdf. Pdf doesn't support filtering nor regular printers would be capable of rendering and ripping the filter effects on the fly, at a larger resolution than on screen.

     

    Contrary using blender. There you can chose between render engines and edit a material shader relatively fast whilst still having the ability to render the scene at any given output size, at any given samples and additional denoising. In most aspects production-wise that's a more powerful tool for fancy design.

  8. #8
    brynn brynn @brynn
    2-Zons

    The problem is that the file is 105" by 52". That would be one hell of a bitmap

    It would be one helluva any image made on a computer!  That's over 8 ft x 4 ft, roughly ! 

  9. #9
    2-Zons 2-Zons @2-Zons

    Yes, it's a layout for a craps table felt.

  10. #10
    brynn brynn @brynn

    I wrote this tutorial some time ago.  It will help you to identify things that cause performance issues, and tips and techniques to avoid them.  (Note that it will be disappearing from the internet shortly after the first of next year (I have to close my site).  So if you want to keep it, be sure to save it on your computer.)

    Tips to Avoid Performance Issues

  11. #11
    2-Zons 2-Zons @2-Zons

    There's some goon info, thanks.  

  12. #12
    Kirstie Kirstie @Kirstie🌷

    Hi Brynn,
    That is a very useful tutorial you wrote there. Will you still have it when you close your site?
    Is it possible to store it in a wiki somewhere? I could you help you with that. It would take far less time to copy it then writing it again :-)

  13. #13
    brynn brynn @brynn

    off topic

    I've been trying to create a similar system to what I have on Inkscape Community, where people who are interested can write tutorials, for the Inkscape website.  The main difference is that on the website, the tutorials would be "official".  (the feature request)  (and there's a bit of discussion in the Documentation chatroom, just now)   This would be a way of, over time, helping to eliminate the nightmare of having countless Inkscape tutorials, scattered hither and yon across the internet, by collecting tutorials on the website.  So we would not need so much the huge listings that I have on Inkscape Community.  More, and hopefully the best tutorials would be on the website.

    So far, there has not been much interest.  But if I can get at least a couple of people to say "good idea" I can justify my time to get it started.  In that case, that tutorial would definitely be one that I'll update and put on the website.

    Otherwise, I'm not sure.  All these tutorials (nearly 40) will be lost when I close my site.  I think I'll be able to put the tutorial listings (links to 3rd party tutorials) on a page provided by my ISP - will have probably a qwest.com address.  But I have not thought of any way to save those tutorials which are hosted on Inkscape Community.

    (There's been an effort over the last few years, to make the Inkscape website user-facing, and make the wiki developer-facing.  So putting them on the Inkscape wiki would not be the best approach.  I'm not really sure how to have a personal wiki.  Wouldn't I need to have server space?  Moini suggested I could open a GitLab account as a repo.  But for a number of reasons, I can't see doing that.  But hopefully, one way or another, the most vital contents of Inkscape Community will remain available.)

    You might want to answer this privately.  But do you know how you're going to share the resources you're writing?  I know they will not be in English.  But since we're on the subject of hosting resources, I got curious  🙂

  14. #14
    Maren Hachmann Maren Hachmann @Moini
    brynn

    But for a number of reasons, I can't see doing that

    Which ones?

  15. #15
    Maren Hachmann Maren Hachmann @Moini

    (Actually, I proposed using a free gitlab.io homepage for that)

  16. #16
    brynn brynn @brynn
    Moini

    Which ones?

    For one, I don't even know what a free gitllab.io homepage is.  (It's the .io that I would need to look up.)  2nd, navigating GL is difficult for me.  I don't even understand what a pull request or a merger is.  I generally know what a commit is, but no clue how to do it.  Creating the forum rules and guidelines in GL drove me absolutely crazy with those codes, whatever it's called.  So I can't see trying to re-create the Inkscape Community Resources page there -- even if I could sort out navigation.  So in all, GL is not a good fit for me.

    I think I'll have better luck tweaking the html a bit, and using the space which my ISP gives me.  But, that still cannot save those tutorials.  Patrick and I are still discussing possibilities for "official tutorials" in Documentation chatroom.  So far, it's a big maybe.

  17. #17
    Maren Hachmann Maren Hachmann @Moini

    You'd only have to upload the html pages and give me access, then I'd do the rest. As offered.

  18. #18
    brynn brynn @brynn
    *

    Can you show an example what it would look like, in the end, after you work on it?

    There's only one html page, but it won't load in a browser alone.  It had to be modified a bit to work in the SMF software.

    Edit

    Well, it will load in a browser, but it doesn't have the proper html headers.  That's what I would need to fix, to be a standalone webpage.  Plus....I can't remember exactly what, but I had to omit certain codes, because they interfere with the SMF codes.

    Edit #2

    But if I can't work on it, to keep it updated, I might as well just give it to you, and you make the new GL account.  Right?

  19. #19
    Maren Hachmann Maren Hachmann @Moini

    You could work on it to keep it updated. I would do the work that is needed to make it show up as a web page. You'd follow the instructions at https://docs.gitlab.com/ee/user/project/pages/  or, if needed, a short screencast that I'd make.

    You'd choose the plain html option, and then you'd still need to give me developer access to the new repository, so I can put in some fixes and setup the rest. I don't much care how the html comes in - either you can give it to me, or you can upload it yourself. I have no idea what it will look like, I suppose that will depend on what we put in.

    In any case, you can make changes to plain html files via the 'Edit' option in the Gitlab interface for the file. Works like a normal text editor, nothing to fear.

  20. #20
    brynn brynn @brynn

    Well, wherever it was where I was writing the Rules document, that looked like a plain text editor too.  But it didn't work like one, except for actually, only, plain text.  There were all these codes to make any kind of formatting.

    You mean it would look like a standalone webpage?  I found this https://gitlab.com/pages/plain-html  and it gives this result:  https://pages.gitlab.io/plain-html    That looks like a standalone page.

    I guess I just hesitate to start a whole new "thing" which is my responsibility, especially when I'm ready for a break.  Could this page be made under the project repo....somehow, but still show up as a separate webpage?

    I'm looking at this page:  https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html

    And where it's talking about domain names, and "Project pages owned by a user".  So the domain would be hllps://brynn.resources.io/inkscape  Would that work?  Or would that still be only my responsibility?  Or is that not what I think it is?

    omg, just trying to sort out those help pages is a nightmare!  It talks about "project pages owned by a user" and all it says about it is the domain name.  It doesn't tell where to go or how to learn more, or how to get started.  That's all there is about it!

    Let me contact my ISP and ask how much space they give me.  If I can't make that work, I'll let you know, and we can try this.  Or if I get really frustrated, I might just zip it up and upload it to my InkSpace (in the gallery).  Then anyone can grab it and do something with it.

  21. #21
    Maren Hachmann Maren Hachmann @Moini

    You don't need to overcomplicate things, brynn. As I said, you create the repository and put the files you want to have on your site in, and I can do the rest. Editing is like editing html in a text editor. You still own it, but if you give access to a couple people, then they can make changes as needed, too. The domain would be brynn.gitlab.io or brynn.gitlab.io/inkscape-tips (or whatever you call the repository).

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Optimizing performance of a document.