Bub-MicroOptimizer icon

MicroOptimizer

Micro-optimizations for smoother gameplay. Reduces lag spikes through component caching, string optimization, and HashSet lookups.

By Bub
Last updated 2 hours ago
Total downloads 388
Total rating 1 
Categories Client-side Server-side Performance Tweaks & Quality Of Life
Dependency string Bub-MicroOptimizer-1.0.3
Dependants 2 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2304 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2304

README

Micro Optimizer

Report any issues in the Lethal Company Modding Discord! I will be more than happy to fix any issues you find. Its only one person making this mod and I can't really test all the time.

Micro Optimizer focuses on micro-optimizations not covered by other performance mods. It targets specific bottlenecks that cause stuttering during gameplay.

Features

  • Collision Component Caching - Caches PlayerControllerB lookups in quicksand/water triggers to prevent repeated GetComponent calls
  • String Allocation Optimization - Uses StringBuilder for scrap value formatting and clock strings to reduce GC pressure
  • Component Lookup Caching - Caches NetworkObject lookups during enemy and scrap spawning
  • Ship Item Collection - Uses HashSet instead of List.Contains() for O(1) lookups when collecting scrap

Configuration

A config file is generated at:

<game directory>\BepInEx\config\mrbub.microoptimizer.cfg

Available settings:

  • CacheCollisionComponents
    Cache PlayerControllerB lookups in collision handlers.
    Default: true

  • OptimizeStringAllocations
    Use StringBuilder for string formatting to reduce allocations.
    Default: true

  • CacheRepeatedLookups
    Cache NetworkObject lookups during spawning.
    Default: true

Installation

Drop the MicroOptimizer.dll into your game's BepInEx plugins folder:

<game directory>\BepInEx\plugins

Credits

Made with love by mrbub.