Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder mode performance issues #612

Open
MatthiasJ1 opened this issue Apr 25, 2024 · 2 comments
Open

Builder mode performance issues #612

MatthiasJ1 opened this issue Apr 25, 2024 · 2 comments

Comments

@MatthiasJ1
Copy link
Contributor

In the following example, the Builder version is 16x slower:

with print_time():
    p = Cylinder(20, 20)
    p += TrapezoidalThread(2*20+2, 2, 60, 10)

with print_time():
    with BuildPart() as p2:
        Cylinder(20, 20)
        TrapezoidalThread(2*20+2, 2, 60, 10)

gives:

0.5091060638427734s
8.107296800613403s
@gumyr
Copy link
Owner

gumyr commented Apr 26, 2024

This is very interesting - the difference in time is just in time it takes to call TrapezoidalThread. The Algebra result also looks correct while the Builder version is missing some of the thread - curious! Some good clues here.

@jdegenstein
Copy link
Collaborator

Here's another slightly tweaked version, that predictably works more quickly and interestingly is not missing any thread:

from build123d import *
from bd_warehouse.thread import *
import time
start_time = time.time()
th = TrapezoidalThread(2*20+2, 2, 60, 10)
with BuildPart() as p3:
    Cylinder(20, 20)
    add(th)
print("--- %s seconds ---" % (time.time() - start_time))

Time is approximately 2x the algebra version above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants