{"id":15011564,"url":"https://github.com/sonquer/mappee","last_synced_at":"2025-04-12T03:31:34.697Z","repository":{"id":221596035,"uuid":"754192687","full_name":"sonquer/mappee","owner":"sonquer","description":"Mappee - Fastest avaiable mapper for .NET (AutoMapper / TinyMapper / Mapster / Mapperly alternative)","archived":false,"fork":false,"pushed_at":"2024-08-09T08:37:18.000Z","size":299,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T23:24:36.410Z","etag":null,"topics":["csharp","csharp-lib","dotnet","dotnet-framework","dotnet-standard","mappee","mapper","mapping","mappings","nuget","object-to-object"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonquer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-07T15:24:52.000Z","updated_at":"2025-03-17T05:54:14.000Z","dependencies_parsed_at":"2024-02-08T23:15:18.601Z","dependency_job_id":"76245c31-8ea4-4784-9ea1-7d04af2626ff","html_url":"https://github.com/sonquer/mappee","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"4f11b4fe0865dd8775bc2cc77873ff4a84536e42"},"previous_names":["sonquer/mappee"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonquer%2Fmappee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonquer%2Fmappee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonquer%2Fmappee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonquer%2Fmappee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonquer","download_url":"https://codeload.github.com/sonquer/mappee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248512693,"owners_count":21116661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","csharp-lib","dotnet","dotnet-framework","dotnet-standard","mappee","mapper","mapping","mappings","nuget","object-to-object"],"created_at":"2024-09-24T19:41:15.717Z","updated_at":"2025-04-12T03:31:34.241Z","avatar_url":"https://github.com/sonquer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿Mappee - Fastest avaiable mapper for .NET\n======================================================\n[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?colorA=192330\u0026colorB=c70039\u0026style=for-the-badge)](https://github.com/sonquer/mappee/blob/main/LICENSE)\n[![First Timers](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?colorA=192330\u0026style=for-the-badge)](http://www.firsttimersonly.com/)\n[![CodeFactor](https://img.shields.io/codefactor/grade/github/sonquer/mappee?colorA=192330\u0026style=for-the-badge)](https://www.codefactor.io/repository/github/sonquer/mappee)\n[![Nuget](https://img.shields.io/nuget/v/mappee.svg?colorA=192330\u0026style=for-the-badge)](https://www.nuget.org/packages/Mappee/)\n\n\nMappee is a high performance object-to-object mapper for .NET. It is a simple and easy to use library that can be used to map objects of different types. It is designed to be fast and efficient, and it is the fastest available mapper for .NET.\nThe main idea is to map objects using precompiled code, which makes it much faster than other mappers that use reflection.\nGenerated code is cached, so it is only generated once for each type pair, and then reused for all subsequent mappings.\n\n## Features\n- Fast and efficient\n- Simple and easy to use\n\n## Getting Started\n\n### Using static methods\n```csharp\nMapper.Bind\u003cTestObject, TestObjectDto\u003e()\n    .IgnoreMember\u003cTestObject, TestObjectDto\u003e(e =\u003e e.Name);\n    .BeforeMap\u003cTestObject, TestObjectDto\u003e((source, _) =\u003e\n    {\n        source.Nickname = $\"{source.FirstName}{source.LastName}\".ToLower();\n    })\n    .AfterMap\u003cTestObject, TestObjectDto\u003e((_, destination) =\u003e\n    {\n        destination.Char = destination.FirstName.First();\n    })\n    .Bind\u003cTestObjectModification, TestObjectModificationDto\u003e()\n    .Bind\u003cTestObjectField, TestObjectFieldDto\u003e()\n    .Bind\u003cTestObjectLink, TestObjectLinkDto\u003e()\n    .Compile();\n\nvar testObject = new TestObject();\n\nvar testObjectDto = Mapper.Map\u003cTestObjectDto\u003e(testObject);\n```\n\n### Using dependency injection\n```csharp\nvar servicesCollection = new ServiceCollection();\nservicesCollection.AddMappee(profile =\u003e\n{\n    profile.Bind\u003cTestObject, TestObjectDto\u003e()\n        .IgnoreMember\u003cTestObject, TestObjectDto\u003e(e =\u003e e.Name)\n        .BeforeMap\u003cTestObject, TestObjectDto\u003e((source, _) =\u003e\n        {\n            source.Nickname = $\"{source.FirstName}{source.LastName}\".ToLower();\n        })\n        .AfterMap\u003cTestObject, TestObjectDto\u003e((_, destination) =\u003e\n        {\n            destination.Char = destination.FirstName.First();\n        });\n\n    //invoke compile method is not necessary, it will be called automatically\n});\n\n//[...]\n\nvar serviceProvider = servicesCollection.BuildServiceProvider();\nvar scope = serviceProvider.CreateScope();\n\nvar mapper = scope.ServiceProvider.GetRequiredService\u003cIMapper\u003e();\n\nvar testObject = new TestObject();\nvar testObjectDto = mapper.Map\u003cTestObject, TestObjectDto\u003e(testObject);\n```\n\n## Mappee vs other mappers (performance comparison)\n\n### Benchmarks\n\n#### 2500 items in 3 different collections and 2500 nested objects (like linked list)\n\n![Performance Comparison 2500](https://raw.githubusercontent.com/sonquer/mappee/main/assets/images/2500-barplot.png)\n\n```\nBenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3155/23H2/2023Update/SunValley3)\n12th Gen Intel Core i7-12700K, 1 CPU, 20 logical and 12 physical cores\n.NET SDK 8.0.101\n  [Host]   : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2\n  .NET 8.0 : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2\n\nJob=.NET 8.0  Runtime=.NET 8.0  \n```\n| Method      | Items | Mean       | Error    | StdDev   | Ratio | Rank | Gen0     | Gen1     | Gen2    | Allocated | Alloc Ratio |\n|------------ |------ |-----------:|---------:|---------:|------:|-----:|---------:|---------:|--------:|----------:|------------:|\n| AutoMapper  | 2500  | 1,697.0 μs | 33.92 μs | 58.50 μs |  1.00 |    1 | 144.5313 | 142.5781 | 35.1563 |    1.5 MB |        1.00 |\n| TinyMapper  | 2500  |   426.8 μs |  1.94 μs |  1.82 μs |  1.00 |    1 |  99.1211 |  49.3164 |       - |   1.24 MB |        1.00 |\n| Mappee      | 2500  |   268.0 μs |  2.85 μs |  2.67 μs |  1.00 |    1 | 140.6250 |  93.2617 |       - |   1.75 MB |        1.00 |\n| Handwritten | 2500  |   233.5 μs |  4.08 μs |  3.62 μs |  1.00 |    1 | 122.0703 |  66.4063 |       - |   1.52 MB |        1.00 |\n\n---\n\n##### 1,5,20 items in 3 different collections and 1,5,20 nested objects (like linked list)\n\n![Performance Comparison 1,5,20](https://raw.githubusercontent.com/sonquer/mappee/main/assets/images/5-10-20-barplot.png)\n\n```\nBenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3155/23H2/2023Update/SunValley3)\n12th Gen Intel Core i7-12700K, 1 CPU, 20 logical and 12 physical cores\n.NET SDK 8.0.101\n  [Host]   : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2\n  .NET 8.0 : .NET 8.0.1 (8.0.123.58001), X64 RyuJIT AVX2\n\nJob=.NET 8.0  Runtime=.NET 8.0  \n```\n| Method      | Items | Mean       | Error    | StdDev   | Ratio | Rank | Gen0   | Gen1   | Allocated | Alloc Ratio |\n|------------ |------ |-----------:|---------:|---------:|------:|-----:|-------:|-------:|----------:|------------:|\n| AutoMapper  | 5     |   928.6 ns | 12.45 ns | 11.64 ns |  1.00 |    1 | 0.2775 | 0.0029 |   3.55 KB |        1.00 |\n| TinyMapper  | 5     |   930.4 ns |  9.43 ns |  8.82 ns |  1.00 |    1 | 0.2356 | 0.0019 |   3.01 KB |        1.00 |\n| Mappee      | 5     |   457.6 ns |  9.17 ns | 10.56 ns |  1.00 |    1 | 0.3252 | 0.0029 |   4.16 KB |        1.00 |\n| Handwritten | 5     |   368.8 ns |  1.90 ns |  1.58 ns |  1.00 |    1 | 0.2813 | 0.0024 |   3.59 KB |        1.00 |\n| AutoMapper  | 10    | 1,663.7 ns | 14.35 ns | 13.42 ns |  1.00 |    1 | 0.5302 | 0.0095 |   6.79 KB |        1.00 |\n| TinyMapper  | 10    | 1,708.8 ns | 18.58 ns | 17.38 ns |  1.00 |    1 | 0.4387 | 0.0057 |    5.6 KB |        1.00 |\n| Mappee      | 10    |   832.1 ns | 13.57 ns | 12.70 ns |  1.00 |    1 | 0.6113 | 0.0095 |    7.8 KB |        1.00 |\n| Handwritten | 10    |   683.4 ns |  5.36 ns |  4.75 ns |  1.00 |    1 | 0.5302 | 0.0076 |   6.77 KB |        1.00 |\n| AutoMapper  | 20    | 3,082.1 ns | 13.87 ns | 12.30 ns |  1.00 |    1 | 1.0376 | 0.0343 |  13.26 KB |        1.00 |\n| TinyMapper  | 20    | 3,334.9 ns | 65.42 ns | 77.87 ns |  1.00 |    1 | 0.8392 | 0.0229 |  10.72 KB |        1.00 |\n| Mappee      | 20    | 1,575.2 ns | 31.47 ns | 52.58 ns |  1.00 |    1 | 1.1768 | 0.0343 |  15.03 KB |        1.00 |\n| Handwritten | 20    | 1,313.9 ns | 15.95 ns | 14.14 ns |  1.00 |    1 | 1.0223 | 0.0286 |  13.06 KB |        1.00 |\n\n## Supported platforms\n- .NET 8.0\n- .NET 7.0\n- .NET 6.0\n- .NET Standard 2.1\n- .NET Standard 2.0\n- .NET Framework 4.8.1","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonquer%2Fmappee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonquer%2Fmappee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonquer%2Fmappee/lists"}