{"id":22938416,"url":"https://github.com/jacraig/fastactivator","last_synced_at":"2025-08-12T18:33:20.989Z","repository":{"id":65413628,"uuid":"255915279","full_name":"JaCraig/FastActivator","owner":"JaCraig","description":"It's Activator.CreateInstance... But faster.","archived":false,"fork":false,"pushed_at":"2024-10-29T09:57:10.000Z","size":24993,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T11:55:50.331Z","etag":null,"topics":["activator","createinstance","reflection"],"latest_commit_sha":null,"homepage":"https://jacraig.github.io/FastActivator/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaCraig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-15T12:50:25.000Z","updated_at":"2024-10-29T09:55:28.000Z","dependencies_parsed_at":"2023-09-23T04:03:46.192Z","dependency_job_id":"b22f74e8-4d7b-4c29-ad79-b6dbbc23cee8","html_url":"https://github.com/JaCraig/FastActivator","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FFastActivator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FFastActivator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FFastActivator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FFastActivator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaCraig","download_url":"https://codeload.github.com/JaCraig/FastActivator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229700213,"owners_count":18109936,"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":["activator","createinstance","reflection"],"created_at":"2024-12-14T12:17:52.887Z","updated_at":"2024-12-14T12:17:53.379Z","avatar_url":"https://github.com/JaCraig.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastActivator\n\n[![.NET Publish](https://github.com/JaCraig/FastActivator/actions/workflows/dotnet-publish.yml/badge.svg)](https://github.com/JaCraig/FastActivator/actions/workflows/dotnet-publish.yml) [![Coverage Status](https://coveralls.io/repos/github/JaCraig/FastActivator/badge.svg?branch=master)](https://coveralls.io/github/JaCraig/FastActivator?branch=master)\n\nFastActivator is a C# library that provides a faster alternative to the `System.Activator` class for creating instances of classes.\n\n## Purpose\n\nThe purpose of FastActivator is to replace the usage of `System.Activator` with a more efficient implementation, resulting in improved performance when creating instances of classes.\n\n## Speed Comparisons\n\n| Method                      | Mean      | Error    | StdDev   | Rank | Gen0   | Allocated |\n|---------------------------- |----------:|---------:|---------:|-----:|-------:|----------:|\n| ActivatorCreateInstance     | 182.80 ns | 1.272 ns | 1.127 ns |    2 | 0.0401 |     336 B |\n| FastActivatorCreateInstance |  28.27 ns | 0.422 ns | 0.352 ns |    1 | 0.0115 |      96 B |\n\nIn many instances it's about 2x to 10x faster depending on the method used.\n\n## Usage\n\nTo use FastActivator, follow these steps:\n\n1. Add a reference to the FastActivator library in your project.\n    ```ps\n    dotnet add package Fast.Activator\n    ```\n\n2. Import the required namespaces:\n   ```csharp\n   using Fast.Activator;\n   ```\n\n3. To create an instance of a class using FastActivator, use one of the following methods:\n\n   - `CreateInstance\u003cTClass\u003e(params object[] args)`: Creates an instance of the specified class `TClass` with the provided arguments, if any.\n     ```csharp\n     var instance = FastActivator.CreateInstance\u003cMyClass\u003e(arg1, arg2);\n     ```\n\n   - `CreateInstance\u003cTClass\u003e()`: Creates an instance of the specified class `TClass` without any arguments.\n     ```csharp\n     var instance = FastActivator.CreateInstance\u003cMyClass\u003e();\n     ```\n\n   - `CreateInstance(Type type, params object[] args)`: Creates an instance of the specified `Type` with the provided arguments, if any.\n     ```csharp\n     var instance = FastActivator.CreateInstance(typeof(MyClass), arg1, arg2);\n     ```\n\n   - `CreateInstance(Type type)`: Creates an instance of the specified `Type` without any arguments.\n     ```csharp\n     var instance = FastActivator.CreateInstance(typeof(MyClass));\n     ```\n\n   Note: If the object cannot be created, the methods will return `null`.\n\n## Contributing\n\nContributions to FastActivator are welcome! If you would like to contribute, please follow these guidelines:\n\n- Fork the repository and create a new branch for your feature or bug fix.\n\n- Make your changes and ensure that the tests pass.\n\n- Submit a pull request describing your changes and the problem they solve.\n\n- Ensure that your code adheres to the project's coding conventions and style guidelines.\n\n## License\n\nFastActivator is released under the [Apache 2.0 License](https://github.com/JaCraig/FastActivator/blob/master/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Ffastactivator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacraig%2Ffastactivator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Ffastactivator/lists"}