Skip to content

Maximizing performance

Ben Thompson edited this page Nov 19, 2017 · 2 revisions

Only fetch properties that you need

When you call a blank Query() we ask the router to supply all records (of that type), and include all properties on those records. It's important to note though that the router does not keep all properties in memory. Some properties (typically the lesser used ones) may only be stored on disk. So retrieving those properties are relatively expensive. You should always specify the properties that you're interested in to remove unnecessary overheads:

var arps = link.Ip.Arp.Query(
    new string[] { // Include only the required properties
        nameof(IpArp.Id),
        nameof(IpArp.MacAddress)
    }
);

Clone this wiki locally