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

Various optimizations #319

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Various optimizations #319

wants to merge 23 commits into from

Conversation

dfremont
Copy link
Collaborator

Description

This PR implements a variety of optimizations, mostly to collision detection and related region operations.

Note: a bunch of old commits that were previously merged to main are still showing up in the history below. The first unmerged commit is the one from April 28. (All older changes don't show up in "Files changed", so this shouldn't make reviewing harder.)

Issue Link

n/a

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

Additional Notes

The following simple benchmark is 100x faster with this PR than on current main:

workspace = Workspace(RectangularRegion(0@0, 0, 100,100))

plane_shape = MeshShape.fromFile(localPath("assets/meshes/classic_plane.obj.bz2"), initial_rotation=(-90 deg, 0, -10 deg))

for i in range(20):
    new Object at Range(-40, 40) @ Range(-40, 40), with shape plane_shape

@sunyesta's woods example is sped up 2-3x.

@dfremont dfremont requested a review from Eric-Vin December 11, 2024 05:24
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 98.27586% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.49%. Comparing base (fe28e13) to head (568a6e3).

Files with missing lines Patch % Lines
src/scenic/core/regions.py 98.51% 2 Missing ⚠️
src/scenic/core/utils.py 90.90% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
+ Coverage   91.42%   91.49%   +0.07%     
==========================================
  Files          54       54              
  Lines       13575    13735     +160     
==========================================
+ Hits        12411    12567     +156     
- Misses       1164     1168       +4     
Files with missing lines Coverage Δ
src/scenic/core/object_types.py 93.16% <100.00%> (+0.30%) ⬆️
src/scenic/core/requirements.py 96.07% <100.00%> (+0.16%) ⬆️
src/scenic/core/sample_checking.py 83.13% <100.00%> (+0.85%) ⬆️
src/scenic/core/scenarios.py 94.39% <100.00%> (+0.01%) ⬆️
src/scenic/core/shapes.py 95.74% <100.00%> (+0.50%) ⬆️
src/scenic/core/regions.py 88.40% <98.51%> (+1.00%) ⬆️
src/scenic/core/utils.py 82.92% <90.90%> (+0.95%) ⬆️

... and 5 files with indirect coverage changes

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

Successfully merging this pull request may close these issues.

1 participant