Skip to content

Evyatar108/TMagic-Optimized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TMagic-Optimized

Optimizations

  • Replaced linear searches over lists with hash sets.
  • Removed many creations of new lists objects when not needed.
  • Caching computations when possible:
    • Creating lists objects for enumerable when they are iterated more than once.
    • Caching global getters' computation as a static object if they are practiacally immutable.
    • Store indexing of arrays in local objects instead of performing multiple indexing calls.
  • Replace DistanceTo() calls with DistanceToSquared() to reduce Math.Sqrt() calls.
  • Replaced string concatination with an equivalent procedure using StringBuilder and string interpolation.
  • Reducing reflection operations when possible by using Traverse of the Harmony library.
  • Reduced nested loops when possible, avoiding redundant iterations.
  • Replaced some LINQ method calls with for and foreach loops.
  • Replaced with ContainsKey()+indexing with a single TryGetValue().
  • Replaced AddDistinct() calls on lists with hash sets.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages