Will this make FreeCAD Run Faster on Linux?

Buried deep in a forum post, missed by many eyes was a little snippet of terminal code that will change the processor priority to allow FreeCAD to be assigned the maximum cpu power. After about an hour of digging I finally found the snippet I sent to myself (unfortunately not the link to the post).

sudo nice -n -20 sudo -u yourusername ~/your/location/of/freecad.AppImage

This 'nice' command sets the priority of freeCAD to -20, there are 140 priorities in total split into two priority ranges. The first of the two is the 'niceness' where default niceness priority is 0 and ranges from the highest (-20) to the lowest (19). This is the one we are interested in and can be customised to our needs. The second ranges from 1 - 99 (default) and 100 - 139 (user space) as is the real time priority.

We can see the niceness of the current running process by using the command: top or htop. The NI column shows the current niceness.

I have yet to try this command on freeCAD but there is more information regarding the nice command.

With the Nice command and having the privileges of a super user you can have a direct influence on managing the amount of resources that your computers CPU can provide. By giving a process a much larger 'chunk' of CPU time to process the task in question, allowing it to take precedence over lower priority tasks and processes. This is know as setting the 'niceness', the lower the value the higher the priority.

https://en.wikipedia.org/wiki/Nice_(Unix)

This link goes deeper into the workings of the linux kernel scheduler and gives a more in-depth understanding of the command, including the renice command and how it works.

https://www.tecmint.com/set-linux-process-priority-using-nice-and-renice-commands/

The Results:

Well after going to twitter we had a responses back. Unfortunately this may not be the answer we are looking for.  

FreeCADNews, a great twitter account to follow, not just for freeCAD but for all opensource CAD information, replied back with 

'This has been discussed on the forum but it's not the answer you're hoping for.' 

They also made a good point explaining that one of the speed bottleneck is the main FreeCAD dependency; OpenCascade CAD kernel. This along with other third part dependencies such as Qt, Python, Coin3d (the list goes on) can also cause their own issues.

When you look through forum comments and tweets you will find a fair amount of criticism over how freeCAD is programed (most of these comments come from posters who haven't even seen the code base and are mealy failing to wind up certain advocates of the software!) it is obviously that FreeCAD's codebase isn't the primary factor. As with all Opensource alternatives moving forward involves collaboration across dependencies to stabilise the platform. This not only benefit FreeCAD but all those that include these libraries. This is what open source stands for and it's up to us to keep those bug reports flowing, test those new features and keep building the community that supports those projects.

Comments

  1. How do you locate the directory where the FreeCAD is located using terminal?

    ReplyDelete

Post a Comment

Popular posts from this blog

Reference Images For Beginners FreeCAD: Exercise 5.1 & 5.2

Beginner FreeCAD Tutorial 14: Reference Document for Exercise 1

FreeCAD For Beginners: CAD Thinking Part 1