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

fetch main #197

Closed
wants to merge 12 commits into from
Closed

fetch main #197

wants to merge 12 commits into from

Conversation

miniJmo
Copy link

@miniJmo miniJmo commented Jan 21, 2025

No description provided.

mads256h and others added 12 commits December 11, 2024 10:57
Can you believe it guys?
It's finally here!
* Add a test for ComputeVisibilityOfPoint

This test case illustrates the difference between the original and optimized version
Removes a bunch of useless stuff from our repo
It was broken in an optimization pass.
* Add tests that run patrolling until completion

Both on building map and cave map

* Formatting

* Remove private method

* don't use broken collision map

---------

Co-authored-by: Mads Mogensen <[email protected]>
* pasted everything from the old CC branch

* trying to fix broadcast

* receive messages every tick

* assorted fixes

---------

Co-authored-by: miniJmo <jmol20student.aau.dk>
Co-authored-by: Mads Mogensen <[email protected]>
Move ExplorationCell and PatrollingCell into one Cell class. These two
classes were identical anyway. This allows Cell to be sealed which
allows the compiler to optimize function calls as they no longer can be
overridden.

Rip out the home-cooked priority queue stuff and replace it with an
existing faster implementation.

Cache delegates to reduce memory allocations.

Use spans instead of array slices where possible to reduce memory
allocations.

Use arrays instead of lists where the size of the list is fixed / known
as arrays are faster than lists and does less memory allocations.

Replace Linq with foreach loops in performance critical sections where
convenient to reduce memory allocations due to Linq and delegate
allocations.

Use x and y function parameters instead of Vector2 in very hot code as
Vector2 construction and X and Y getters are unfortunately not free.

Move function local collections out into the class and reuse them for
every function call in very hot functions to reduce memory allocations.

Use fixed array in RaytracingTriangle so that the array memory is part
of the struct. This reduces memory allocations and improves cache
locality. RaytracingTriangle is very hot.

Tell the compiler to aggressively inline trivial functions in very hot
parts of the code.

Use unity's builtin time since startup instead of DateTime.now as
DateTime.now is incredibly slow.

Clean up the code.
Fix cache issues.
This allows for advanced algorithms that does not make use of the
PatrollingAlgorithm base class.
@miniJmo miniJmo marked this pull request as ready for review January 21, 2025 10:24
@miniJmo miniJmo closed this Jan 21, 2025
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.

3 participants