Were you to manually put all of the files into a single temporary file,
and compile that temporary file, what speed benefit would you see? If
the benefit is large, why not write a program to do all of the
<include>s and <uses> automatically and then only use separate files for
writing and the automatically generated temporary file for compiling?
On 6/15/2020 8:16 AM, nop head wrote:
Well I included a lot of the files that were used by main but then
they all include the global definitions instead of just using the ones
at the top of main. That did give a speed up but is not optimum
without removing all the extra includes.
Some time ago the main file had most of the machine in it and was a
lot faster but was huge and hard to navigate. With other languages you
don't get a huge penalty when you break the problem into smaller
modules. OpenSCAD has a massive bug where calling a function or a
module in a used file recalculates all the constants. I think it only
needs to calculate any that involve $variables, (directly or
indirectly) that have changed since the last time they were
evaluated and that would affect the function or module being called.
So not an easy bug to fix.
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
When I made the change it went from a minute to about 30 seconds. When I
added all the code to drill the screw holes in all the panels that mate
with the shelf bracket it slowed down to a minute again. Caching the three
function calls got it down to 45 seconds.
The shelf bracket is pathological because it depends on all the sides and
affects all the sides. It is also too big to print so needs to be slit into
sections. That will add more screw holes so it will end up even slower.
On Mon, 15 Jun 2020 at 13:27, jon jon@jonbondy.com wrote:
Were you to manually put all of the files into a single temporary file,
and compile that temporary file, what speed benefit would you see? If the
benefit is large, why not write a program to do all of the <include>s and
<uses> automatically and then only use separate files for writing and the
automatically generated temporary file for compiling?
On 6/15/2020 8:16 AM, nop head wrote:
Well I included a lot of the files that were used by main but then they
all include the global definitions instead of just using the ones at the
top of main. That did give a speed up but is not optimum without removing
all the extra includes.
Some time ago the main file had most of the machine in it and was a lot
faster but was huge and hard to navigate. With other languages you don't
get a huge penalty when you break the problem into smaller modules.
OpenSCAD has a massive bug where calling a function or a module in a used
file recalculates all the constants. I think it only needs to calculate any
that involve $variables, (directly or indirectly) that have changed since
the last time they were evaluated and that would affect the function or
module being called. So not an easy bug to fix.
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org