NetFabric.Hyperlinq — Optimizing LINQ

High tension by aalmada

Duck typing

Constrained interfaces

  • When the parameter is a value type, the method is called using the call instruction.
  • When the parameter is an interface (reference type), the method is called using the callvirt instruction.
  • When the parameter is a constrained interface, the method is called using the callvirt instruction but preceded by constrained. !!TInterface.
  • callvirt results in more expensive code than call.
  • Although the constrained interface uses a callvirt instruction, it results in the same code as call.

IReadOnlyXXX interfaces

Read-only structs and read-only refs

NetFabric.Hyperlinq

--

--

--

Principal Engineer @ Farfetch - Future Retail Lab https://about.me/antao.almada

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What is WebAuthn: Logging in with Face ID and Touch ID on the web

Offshore Developer Rates: Global Software Development Prices

Effortless file uploads with ActiveStorage, Apollo and React

AMA Recap held on ChainBoost on Oct 22, 2021

G.R.C Platform

Shedding the Pounds: Azure Cost Optimisation

Beldex is Now Listed on Perfect Nodes

Killing a hidden duplicate server

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Antão Almada

Antão Almada

Principal Engineer @ Farfetch - Future Retail Lab https://about.me/antao.almada

More from Medium

Understanding .Net Framework 4.5 Architecture

Global Using Directive in C# 10 with net 6.0

C# Mock different HttpClient calls in the same method

How to make a Section optional in ASP.NET Core MVC