The fastest .NET object mapper
Drop-in AutoMapper replacement. Same API. 2–5× faster. Zero extra allocations. AutoMapper went commercial — swap the NuGet package, change one using, done.
Install
Supports netstandard2.0, net462, net8.0, net9.0, net10.0.
Why EggMapper?
| AutoMapper | EggMapper | |
|---|---|---|
| License | Commercial RPL (v13+) | MIT — free forever |
| Performance | Baseline | 2–5× faster |
| Allocations | Extra per-map | Zero extra |
| Runtime reflection | Yes | No — compiled expressions |
| API | Original | Same API, drop-in swap |
30-Second Quick Start
using EggMapper;
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<Customer, CustomerDto>()
.ForMember(d => d.FullName, o => o.MapFrom(s => $"{s.First} {s.Last}"));
});
var mapper = config.CreateMapper();
var dto = mapper.Map<CustomerDto>(customer);
Performance
EggMapper matches hand-written code. The only allocation is the destination object itself:
| Scenario | Manual | EggMapper | AutoMapper | Mapster |
|---|---|---|---|---|
| Flat (10 props) | 104 B | 104 B | 232 B | 104 B |
| Nested (2 objects) | 248 B | 248 B | 504 B | 248 B |
| Collection (100 items) | 10,824 B | 10,824 B | 14,424 B | 10,824 B |
| Deep collection (100 items, nested) | 34,424 B | 34,424 B | 52,824 B | 34,424 B |
Full benchmarks and methodology →
Key Features
CreateMap, ForMember, Profile, IMapper — same signatures, no code changes.
Compiled expression trees. No ResolutionContext, no boxing, no per-property delegates.
ProjectTo<S,D>(config) translates mapping to SQL via LINQ — no entity materialization.
MapList<S,D>() compiles the entire loop as one expression tree. Near-manual speed.
Map<T,T>(obj) creates a deep copy with no configuration needed.
Patch<S,D>(src, dest) only overwrites non-null properties — ideal for PATCH endpoints.
services.AddEggMapper(assembly) registers MapperConfiguration + IMapper as singletons.
Optional [MapTo] and [EggMapper] source generators for compile-time zero-overhead mapping.