Jump to content

Performance

Pending 1.0.9

MoonDoggy
MoonDoggy

Posted

Hi

! Found a performance issue in Basements 1.0.9 on our server (~147k entities). FindBaseEntity(ulong) loops over every entity in BaseNetworkable.serverEntities. When the entity no longer exists (destroyed hatch or relay box), nothing gets cached, so the full loop repeats on every call. Through ConnectedHatch and the industrial relay hooks (CanAcceptItem / OnItemAddedToContainer), that can happen several times a second and was dragging our FPS down. One-line fix, using Rust’s own ID lookup:

csharp

public static BaseEntity FindBaseEntity(ulong entityID) { if (entityID == 0) { return null; } return BaseNetworkable.serverEntities.Find(new NetworkableId(entityID)) as BaseEntity; }

Thanks for the plugin, I love it!

MoonDoggy, Celestial Misfits Rust server.

  • Like 1

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
3.2m
Total downloads
Customers
12.3k
Customers served
Files Sold
174k
Total sales
Payments
3.8m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.