Profiling the module/function performance ?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Profiling the module/function performance ?

runsun
Is there any way to profile the module/function performances ?
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

MichaelAtOz
Administrator
Not that I know of, without getting into the source code.

Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

vicnet
Hello,

I have almost 2 solutions to implements a module.
I there a way to test performance (time and/or nb triangles) of each
implementation ?

"F6 render" show some informations (cleaning cache every time) but my module
is too small to display something useful.
I try to duplicate the module with a loop on children but I have the same
result in two case so I suspect that I measure duplication time and not my
module time !


One module use polygon with point list.
Second one use difference().

a+
Vicnet



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

thehans
I don't understand what the question is.  When you preview or render,
it reports the number of seconds it took to process the geometry. If
the number is too high for your taste, then you can try to make more
efficient module etc. and see if it runs in less time.


On Thu, Mar 22, 2018 at 8:03 AM, vicnet <[hidden email]> wrote:

> Hello,
>
> I have almost 2 solutions to implements a module.
> I there a way to test performance (time and/or nb triangles) of each
> implementation ?
>
> "F6 render" show some informations (cleaning cache every time) but my module
> is too small to display something useful.
> I try to duplicate the module with a loop on children but I have the same
> result in two case so I suspect that I measure duplication time and not my
> module time !
>
>
> One module use polygon with point list.
> Second one use difference().
>
> a+
> Vicnet
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

Ronaldo

Em 22 de mar de 2018 13:42, "Hans L" <[hidden email]> escreveu:
I don't understand what the question is.  When you preview or render,
it reports the number of seconds it took to process the geometry. If
the number is too high for your taste, then you can try to make more
efficient module etc. and see if it runs in less time.


On Thu, Mar 22, 2018 at 8:03 AM, vicnet <[hidden email]> wrote:
> Hello,
>
> I have almost 2 solutions to implements a module.
> I there a way to test performance (time and/or nb triangles) of each
> implementation ?
>
> "F6 render" show some informations (cleaning cache every time) but my module
> is too small to display something useful.
> I try to duplicate the module with a loop on children but I have the same
> result in two case so I suspect that I measure duplication time and not my
> module time !
>
>
> One module use polygon with point list.
> Second one use difference().
>
> a+
> Vicnet
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

Troberg
In reply to this post by vicnet
> I try to duplicate the module with a loop on children but I have the same
> result in two case so I suspect that I measure duplication time and not my
> module time !

Have you tried not using children (which I suppose is just making copies of
the already generated object) and instead repeatedly call the module in a
loop?



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

Ronaldo
In reply to this post by vicnet
One module use polygon with point list.
Second one use difference().

​I would not expect big differences with 2D models. Anyway, remember that OpenSCAD saves models in cache so there is no duplicate effort if the very same model is used many times.​

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Profiling the module/function performance ?

vicnet
In reply to this post by Troberg

> I don't understand what the question is.  When you preview or render,
> it reports the number of seconds it took to process the geometry. If
> the number is too high for your taste, then you can try to make more
> efficient module etc. and see if it runs in less time.

The render value is fine to have some perf values.
The pb is how to test 2 implementations that take few time (milliseconds o
rless?) each so that it is not comparable for one call with render?


Troberg wrote
> Have you tried not using children (which I suppose is just making copies
> of
> the already generated object) and instead repeatedly call the module in a
> loop?

Yes, you're right.
i use children() to duplicate so certainly cache is used and I measure
children+cache functions not my module !

I will try to duplicate directly.

Thanks.

a+
vicnet



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org