Skip to content

To what extent applications made with Unity can be optimized to achieve the best performance and memory efficiency utilizing C# specific techniques, Unity Burst Compiler, Unity Jobs System, and Entity Component System?

License

Notifications You must be signed in to change notification settings

Fire-Aalt/Extended-Essay-CS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boids Simulation Project for the Extended Essay in Computer Science

By Krasutski Maksim

Topic: Optimization tools and techniques in the Unity game engine.

Research question: To what extent does Unity’s Data-Oriented Technology Stack (Burst, Jobs System, Entity Component System) improve runtime performance and memory efficiency compared to traditional object-oriented approaches?

Showcase.gif

Installation

Download ZIP using Code/Download ZIP, as it is a complete project

Dependencies

These packages are already embedded into the project:

  1. ZString: for 0 GC string building: https://github.com/Cysharp/ZString
  2. UniTask, for less GC async tests: https://github.com/Cysharp/UniTask

Profiling

After each simulation, the saved CSV is of a format:

EEProfilerLog_{Part}_{N}boids_Auto.csv

Where {Part} is the name of the profiled Part (can be Part1, Part2, etc.), and {N} is the number of boids simulated. For more info on what is being profiled, refer to ProfilerLogger.cs.

Data Analysis

Check Extended Essay CS Template.xlsx to see the template for data processing, and Results Charts.xlsx for detailed results with charts.

Main Menu

Provides all the essential buttons and input fields to adjust the tests in the standalone build. Features:

  1. You can select any combination of Parts to simulate;
  2. Manual Test: start a simulation without any test automation (data profiling is always on)
  3. Automated Test: starts a simulation for a specified warmup time and duration. For consistent data results, you there is no "Back" option in this mode;
  4. Automated Test Sequence: starts Parts in a sequence (first Part 1, then Part 2, etc.) with the same boid count.

MainMenu.png

Different Optimization Parts

Part 1: Naive solution (30 boids)

Part1.png

Part 2: C# optimized solution (300 boids)

Part2.png

Part 3: Burst compiled solution (2000 boids)

Part3.png

Part 4: Jobs System + Burst solution (4000 boids)

Part4.png

Part 5: ECS + Jobs + Burst solution (6000 boids)

Part5.png

About

To what extent applications made with Unity can be optimized to achieve the best performance and memory efficiency utilizing C# specific techniques, Unity Burst Compiler, Unity Jobs System, and Entity Component System?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published