{"id":17172161,"url":"https://github.com/apmem/reflectionutilities","last_synced_at":"2025-04-13T16:30:45.598Z","repository":{"id":141411975,"uuid":"2942144","full_name":"ApmeM/ReflectionUtilities","owner":"ApmeM","description":"Increse speed of your project by cache reflection operations (which is originally slow)","archived":false,"fork":false,"pushed_at":"2024-11-02T08:01:50.000Z","size":55,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T07:35:49.778Z","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/ApmeM.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}},"created_at":"2011-12-08T18:34:07.000Z","updated_at":"2024-11-02T08:01:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4e1a35d-1841-48e2-8727-6027e4c52b21","html_url":"https://github.com/ApmeM/ReflectionUtilities","commit_stats":null,"previous_names":["apmem/reflectionutilities"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApmeM%2FReflectionUtilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApmeM%2FReflectionUtilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApmeM%2FReflectionUtilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApmeM%2FReflectionUtilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApmeM","download_url":"https://codeload.github.com/ApmeM/ReflectionUtilities/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248743664,"owners_count":21154716,"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-14T23:36:17.389Z","updated_at":"2025-04-13T16:30:45.250Z","avatar_url":"https://github.com/ApmeM.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reflection Cache\n\n## Introduction\n\nReflection in C# is very expensive operation especially when you use it often enough (For example creating your own ORM or pluginable system)\n\nThis small library help you to boost project speed using reflection cache. In this case system will use reflection only once, and then it will take data from memory.\n\nPerformance test result :\n\n|             Method |       Mean |   Error |  StdDev |  Gen 0 | Allocated |\n|------------------- |-----------:|--------:|--------:|-------:|----------:|\n| UseReflectionCache |   395.5 ns | 3.47 ns | 3.07 ns | 0.0572 |     240 B |\n|  RegularReflection | 2,353.9 ns | 7.69 ns | 7.19 ns | 0.1068 |     456 B |\n\n\n## Installation and usage\n\nJust add this sources to your solution (or include compiled dll)\n\nTo get list of special attributes you need to follow these semple steps:\n\n    // 1. Get reflection class from cache (or if it is not in cache - reflect it and add to cache)\n    var reflection = ReflectionCache.GetReflection(typeof(ExampleObject));\n    // 2. Get list of attributes from cache\n    var attributes = reflection.Attributes;\n    // 3. Get attibutes by type\n    var attributesByType = attributes[typeof(SomeType)];\n\nOther available functions:\n\nCache:\n\n1. static ReflectionClass GetReflection(Type t)\n\nClass:\n\n1. ReflectionAttributeList Attributes\n2. Type BaseType\n3. string FullName\n4. ReflectionMethodList Methods\n5. string Name\n6. ReflectionPropertyList Properties\n7. bool IsAssignableFrom(Type type)\n\nMethod:\n\n1. string FullName\n2. string Name\n3. string WithClassName\n4. ParameterInfo[] Parameters\n5. ReflectionAttributeList Attributes\n6. Type ReturnType\n7. object Invoke(object obj, params object[] param)\n\nProperty:\n\n1. ReflectionAttributeList Attributes\n2. string FullName\n3. string Name\n4. Type PropertyType\n5. string WithClassName\n6. object GetValue(object from)\n7. void SetValue(object to, object what)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapmem%2Freflectionutilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapmem%2Freflectionutilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapmem%2Freflectionutilities/lists"}