Tweaking for speed of text insertion in LibreCAD

I should write something about what we are doing now. At least to assure users that we are working hard to make LibreCAD better.

While doing the never ending task of testing, Claude, our quality control master from Quebec,  exposed the issue of text insertion speed in LibreCAD, and it turned out to be a bug hard to fix.

We have made some progress, but the battle is not over yet.

First, I did a code review for math functions, rewrote many math functions, and many core math functions are now at least 100% faster, and 400% faster in some cases by my own benchmarking. I enabled using of 2D vectors, instead of 3D vectors for our core vector class, in hope of processing one third less of data. Still, the speed improvement is not enough.

Then, there was a turning point. Rallaz  identified excessive creation of new preview for text in the drawing part, and fixed it in a simple and elegant patch. For a while, we celebrated the catch, and called it a win.

To our surprise, Claude reported speed trouble once again. It turned out the previous fast text insertion in testing of Rallaz’s patch was coincident with an error in container’s move() function (bug#3420260). After we fixed the bug#3420260, the speed issue resurfaced again. Rallaz fixed a serious speed bug, but it’s still not enough.

Performance tweaking is going on for the spline class, which is used heavily in text processing.

Ries wants LibreCAD to be fast and lite, and that’s exaclty what we are doing now!

If you would like to help, please join the team!

UPDATE: spline/text draw() methods updated, preview procedure also updated. The speed of text/spline handling has improved significantly. Code review is still going on.

7 thoughts on “Tweaking for speed of text insertion in LibreCAD

  1. Ries,
    I tried to get the RC3 files, but git reported:

    Initialized empty Git repository in /mnt/local/LibreCAD/.git/
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly

    and the tarball, after untarring and trying qmake:

    fatal: Not a git repository (or any of the parent directories): .git

    I am not a git expert, but something is wrong here.

    Regards,

    Robert

    • Sounds like you registered your ssh public key, but not be able to use it.

      have a look at github help:

      http://help.github.com/ssh-issues/

      the git warning from the rc3 tarball has been fixed in the snapshot after the rc3 release. If you may still see the same warning if you are building from a tarball of the master branch. The warning seems to be harmless though.

      Regards,

      Dongxu Li

      • OK Dongxu,

        I’ve never used github before – I didn’t realise you had to set up public key exchange, I’ll do that.
        The tarball message in my case was not a warning, it was fatal.

        Thanks,
        Robert

  2. To you have plans to revamp text editing completely? The new commercial version of QCad has much, much better text input. Something along those lines would be really useful.

    • Hello Alexandre,

      Could you provide more details?

      We don’t really run qcad here. Our goal is to make LibreCAD good for as more users as possible. We have implemented mang new features, which we see as useful.

      The text/spline part needs some redesign, so, new ideas/suggestions are invaluable during the design phase.

      Thanks,

      Dongxu Li

Leave a Reply to Lisandro Damián Nicanor Pérez Meyer Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>