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

🚧Convert to structs #80

Closed
12 tasks done
CalvinWilkinson opened this issue May 30, 2024 · 0 comments · Fixed by #83
Closed
12 tasks done

🚧Convert to structs #80

CalvinWilkinson opened this issue May 30, 2024 · 0 comments · Fixed by #83
Assignees
Labels
🧨breaking-changes Feature/changes contains breaking changes high-priority High Priority 🏎️performance Performance improvements preview Done while in preview 🔬research Research collection / investigation tech-debt Code refactoring or cleanup / tech debt reduction

Comments

@CalvinWilkinson
Copy link
Member

CalvinWilkinson commented May 30, 2024

Complete The Item Below

  • I have updated the title without removing the 🚧 emoji.

Description

Look into converting types into read-only record structs. This issue will be half research and investigating what is possible; the other half will be the work to convert what we can.

Also, convert all the time values for the ParticleEffect class to floating point numbers instead of an int. This is important for accurately changing of the values over time, which is important in particle engines.

We can also investigate the impact of using static abstract interface members to see if this can get us the restrictions we want for float vs. double data types. We could also use generic math to achieve what we want, a C# 11 feature.

If this is the case, maybe we can have ParticleF and Particle types where Particle will be for double and ParticleF will be for floats. Again, this is all theory but will require research.

Note

It might not be possible to convert the Particle type to a read-only record struct due to the current IParticle interface, which is needed, and the method implementations.

Warning

This will require further thought regarding how this might be used in other applications. One, in particular, will be Plazma Studio. Make sure to build the project into a local test nuget package and bring it into Plazma Studio to see the impact it will have

Reason:

This will improve ease of use and performance. Since this is a particle engine, we want to keep things fast. This means changing the engine to reduce memory pressure and GC collections.

Note

Take the time to do baseline performance testing and comparisons to ensure we increase performance. This is fine if this means creating some perf projects to add to the code base/solution.

Acceptance Criteria

The items to complete to satisfy the Definition of Done.

ToDo Items

The items to complete to satisfy the Definition of Done.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Unit Tests

Reasons for local unit test execution:

  • Unit tests might pass locally but not in the CI environment during the status check process or vice-versa.
  • Tests might pass on the developer's machine but not necessarily on the code reviewer's machine.
  • If you notice that the test status check has passed but the test failed locally, please notify a project maintainer!

💡Warning💡
If the unit tests pass remotely and are not executed locally, this means we could be letting a bug slip into production.
Though bugs will always exist in some capacity, we should all do our part to help prevent them from happening.

Change Type Labels

Change Type Label
Bug Fixes 🐛bug
Breaking Changes 🧨breaking changes
New Feature ✨new feature
CICD Changes ♻️cicd
Config Changes ⚙️config
Performance Improvements 🏎️performance
Code Doc Changes 🗒️documentation/code
Product Doc Changes 📝documentation/product

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@CalvinWilkinson CalvinWilkinson added high-priority High Priority preview Done while in preview tech-debt Code refactoring or cleanup / tech debt reduction 🏎️performance Performance improvements 🔬research Research collection / investigation labels May 30, 2024
@CalvinWilkinson CalvinWilkinson added this to the v1.0.0-preview.3 milestone May 30, 2024
@CalvinWilkinson CalvinWilkinson self-assigned this May 30, 2024
@github-project-automation github-project-automation bot moved this to ⚪Not Set in KD-Team May 30, 2024
@CalvinWilkinson CalvinWilkinson moved this from ⚪Not Set to 🏗️In Development in KD-Team Jun 8, 2024
CalvinWilkinson added a commit that referenced this issue Jun 8, 2024
@CalvinWilkinson CalvinWilkinson added the 🧨breaking-changes Feature/changes contains breaking changes label Jun 11, 2024
CalvinWilkinson added a commit that referenced this issue Jun 14, 2024
* Start work for issue #80

* ide: add perf results as a solution folder

* test: add engine perf project to the solution

* ci: add perf project to build status check workflow

* docs: fix grammary issues in comments

* chore!: convert particle to readonly record struct

* chore: move particle update processing and logic to particle pool

* refactor: make simple improvements

* fix: add content load state checks to content methods

* test: remove particle tests

* refactor: make simple improvements to array creation

* docs: improve comments

* test: set up simple perf tests

* docs: update perf results

* docs: fix grammar issues in comments

* refactor: add simple code improvements

* perf: improve perf project

* perf: implement 0.62% to 5.15% perf improvement

This is based on how many particles are being processed

* refactor!: change property setter scopes

* refactor: convert prop to auto prop

* test: improve performance tests

* perf: collect perf results

* refactor: fix grammar issues, improve code for standards, and clean up code

* perf: performance improvement

asdf

* refactor: improve code readability

* ide: adjust project run configs

* test: create shared project for perf projects to utilize

* test: create perf project for particle pool

* docs: update and add perf results

* chore: add kill all particles on click to color scene

* docs: improve grammar/spelling in code docs

* refactor!: all rate values types changed from int to floating point

* refactor!: changed the particle effect class to readonly record struct

* chore: updated testing scenes to accommodate changes

* cleanup: improve code in perf test project

* chore!: changed easing function types from double to float

* chore!: changed behavior props from double to float

* chore!: changed return type of easing random behavior settings props

* chore!: changed type for easing random behavior props

* chore: update color scene literal values to floats

* chore!: moved the add and remove behavior logic to the particle pool

* chore: add default constructor to ensure that prop is init

* chore: perform null checks on behavior property

* chore: add perf project improvements

* test: fix and improve tests

* test,perf: improve perf project set up

* refactor: change foreach loops to for loops

* config: set internals visible to unit test project

* chore!: add disposal checks to class members

* test,chore: improve content loading and unloading in scenes

* chore: change return type of factory to interface

* refactor: remove unneccesary code

* test: increase code coverage for particle pool class

* ide: ignore code coverage for perf projects

* test: increase code coverage of particle struct

* test: increase code coverage of particle engine class

* test: increase code coverage of particle effect struct

* test: increase code coverage of extension methods

* test: increase code coverage of easing random behavior

* chore: add settings property to easing random behaviors

* chore: setup default values for default constructor
@github-project-automation github-project-automation bot moved this from 🏗️In Development to ✅Done in KD-Team Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧨breaking-changes Feature/changes contains breaking changes high-priority High Priority 🏎️performance Performance improvements preview Done while in preview 🔬research Research collection / investigation tech-debt Code refactoring or cleanup / tech debt reduction
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant