# FastEquality

> Utility to look up equality and hashcode functions for component types.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
[BurstCompile]
public struct FastEquality
```

## Remarks

The TypeManager uses this type internally and you shouldn't need to create or directly use this in the majority of use cases. When possible, a Burst-compilable implementation is preferred, but if an IEquatable\{T} method isn't marked as Burst compiled, the managed version is used instead.

## Static Methods

| Method                                                                                              | Description                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddExtraAOTTypes](/engine/7000.0/script-reference/unity/entities/fastequality/addextraaottypes.md) | Internal method used for populating closed forms of generic equality methods to ensure IL2CPP can generate transpiled implementations and ensure they are not-stripped from builds. |
| [Equals](/engine/7000.0/script-reference/unity/entities/fastequality/equals.md)                     | Compares two component types.                                                                                                                                                       |

## Structs

| Struct                                                                                           | Description                                                                                                                        |
| ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| [FastEquality.TypeInfo](/engine/7000.0/script-reference/unity/entities/fastequality/typeinfo.md) | Type holding one component's Equals and GetHashCode implementations as well as the size of the underlying unmanaged component type |
