{"id":17037982,"url":"https://github.com/kzu/funq","last_synced_at":"2025-04-12T13:51:58.656Z","repository":{"id":194409136,"uuid":"690760399","full_name":"kzu/funq","owner":"kzu","description":"Funq: a fast DI container you can understand","archived":false,"fork":false,"pushed_at":"2025-02-09T18:45:43.000Z","size":578,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T13:49:20.345Z","etag":null,"topics":[],"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/kzu.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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":"2023-09-12T20:24:27.000Z","updated_at":"2025-03-04T20:59:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"78ce7172-36ea-4638-b506-88236e7e05da","html_url":"https://github.com/kzu/funq","commit_stats":null,"previous_names":["kzu/funq"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzu%2Ffunq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzu%2Ffunq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzu%2Ffunq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzu%2Ffunq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kzu","download_url":"https://codeload.github.com/kzu/funq/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575914,"owners_count":21127299,"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":[],"created_at":"2024-10-14T08:55:38.265Z","updated_at":"2025-04-12T13:51:58.627Z","avatar_url":"https://github.com/kzu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![](https://github.com/kzu/funq/raw/main/assets/img/32x32.png) Funq\n\nA fast DI container you can understand\n\n## Overview\n\nI created this DI container originally for use in Microsoft patterns \u0026 practices \nframework for developing mobile apps targeting the .NET Compact Framework, which \nhad to run on very constrained devices (back then). No usage of System.Reflection \nwas pretty much a given requirement.\n\nAlong the way, I created a [series of videos](https://www.youtube.com/playlist?list=PLpBzqAJhzCLfPHtdcPEy1jj3W16MAeX1M) \nwhere I showcasehow to use TDD to implement the whole thing from scratch.\n\n## Performance\n\n```\nBenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3593/23H2/2023Update/SunValley3)\nIntel Core i9-10900T CPU 1.90GHz, 1 CPU, 20 logical and 10 physical cores\n  [Host]   : .NET Framework 4.8.1 (4.8.9241.0), X64 RyuJIT VectorSize=256\n  .NET 6.0 : .NET 6.0.27 (6.0.2724.6912), X64 RyuJIT AVX2\n  .NET 8.0 : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2\n```\n\n### Speed\n\n| Method            | Runtime  | Mean            | Error          | StdDev         | Median          | Ratio     | RatioSD  |\n|------------------ |--------- |----------------:|---------------:|---------------:|----------------:|----------:|---------:|\n| 'No DI'           | .NET 6.0 |        85.90 ns |       1.755 ns |       4.204 ns |        85.48 ns |      1.00 |     0.00 |\n| Funq              | .NET 6.0 |     1,279.53 ns |      22.287 ns |      20.848 ns |     1,275.61 ns |     14.51 |     0.71 |\n| ServiceCollection | .NET 6.0 |    19,293.83 ns |     639.905 ns |   1,876.731 ns |    19,363.75 ns |    228.75 |    22.79 |\n| Unity             | .NET 6.0 |    11,052.90 ns |     219.512 ns |     205.332 ns |    11,036.42 ns |    125.38 |     7.45 |\n| Autofac           | .NET 6.0 |    52,322.62 ns |   1,044.219 ns |   2,714.063 ns |    51,397.70 ns |    611.19 |    40.38 |\n| StructureMap      | .NET 6.0 | 4,106,653.85 ns | 109,422.178 ns | 313,952.741 ns | 4,050,650.00 ns | 47,554.83 | 3,709.43 |\n| Ninject           | .NET 6.0 |   621,417.49 ns |  19,670.749 ns |  57,690.901 ns |   606,653.52 ns |  7,144.12 |   582.38 |\n| Windsor           | .NET 6.0 |   165,673.09 ns |   2,802.828 ns |   2,484.634 ns |   165,504.05 ns |  1,873.34 |   103.36 |\n|                   |          |                 |                |                |                 |           |          |\n| 'No DI'           | .NET 8.0 |        63.21 ns |       1.249 ns |       1.624 ns |        63.16 ns |      1.00 |     0.00 |\n| Funq              | .NET 8.0 |       843.21 ns |      16.439 ns |      16.145 ns |       839.61 ns |     13.29 |     0.46 |\n| ServiceCollection | .NET 8.0 |     7,972.33 ns |     163.442 ns |     474.174 ns |     7,877.49 ns |    121.48 |     6.46 |\n| Unity             | .NET 8.0 |     8,793.95 ns |     173.747 ns |     206.833 ns |     8,814.48 ns |    139.12 |     5.15 |\n| Autofac           | .NET 8.0 |    40,158.30 ns |     793.924 ns |   1,004.059 ns |    40,017.48 ns |    635.76 |    23.40 |\n| StructureMap      | .NET 8.0 | 3,007,362.81 ns |  51,683.220 ns |  48,344.516 ns | 3,022,072.27 ns | 47,453.44 | 1,330.72 |\n| Ninject           | .NET 8.0 |   570,046.30 ns |  15,811.656 ns |  45,111.545 ns |   565,521.73 ns |  8,383.15 |   638.32 |\n| Windsor           | .NET 8.0 |   140,258.83 ns |   2,799.971 ns |   7,988.474 ns |   137,446.48 ns |  2,183.18 |   114.48 |\n\n\n### Allocations\n\n| Method            | Runtime  | Gen0    | Gen1    | Allocated | Alloc Ratio |\n|------------------ |--------- |--------:|--------:|----------:|------------:|\n| 'No DI'           | .NET 6.0 |  0.0397 |       - |     416 B |        1.00 |\n| Funq              | .NET 6.0 |  0.2155 |       - |    2256 B |        5.42 |\n| ServiceCollection | .NET 6.0 |  1.3733 |  0.6714 |   14432 B |       34.69 |\n| Unity             | .NET 6.0 |  1.7853 |  0.0610 |   18696 B |       44.94 |\n| Autofac           | .NET 6.0 |  3.2959 |  1.6479 |   34859 B |       83.80 |\n| StructureMap      | .NET 6.0 | 23.4375 |  7.8125 |  294826 B |      708.72 |\n| Ninject           | .NET 6.0 |  7.8125 |  2.9297 |   88347 B |      212.37 |\n| Windsor           | .NET 6.0 | 11.9629 |  0.7324 |  125665 B |      302.08 |\n|                   |          |         |         |           |             |\n| 'No DI'           | .NET 8.0 |  0.0397 |       - |     416 B |        1.00 |\n| Funq              | .NET 8.0 |  0.2155 |  0.0010 |    2256 B |        5.42 |\n| ServiceCollection | .NET 8.0 |  1.1597 |  1.0986 |   12335 B |       29.65 |\n| Unity             | .NET 8.0 |  1.7853 |  0.0610 |   18696 B |       44.94 |\n| Autofac           | .NET 8.0 |  2.9297 |  2.6855 |   32745 B |       78.71 |\n| StructureMap      | .NET 8.0 | 23.4375 | 19.5313 |  281557 B |      676.82 |\n| Ninject           | .NET 8.0 |  8.7891 |  3.9063 |   93223 B |      224.09 |\n| Windsor           | .NET 8.0 | 11.7188 |  0.9766 |  125664 B |      302.08 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkzu%2Ffunq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkzu%2Ffunq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkzu%2Ffunq/lists"}