night-moon-studio / Leo

A library based on NCC Natasha to quickly and easily read/write instance's fields or properties.
https://natasha.dotnetcore.xyz
MIT License
81 stars 18 forks source link

Optimize the performance for DictBase #10 #13

Closed alexinea closed 3 years ago

alexinea commented 3 years ago

10

NMSAzulX commented 3 years ago

1、GetReadOnlyStaticMetadataScript 等逻辑重新遍历了字典,可以放到初始化函数内构建。 2、可以使用 private readonly static 进行构建,使用 "str".ReadonlyScript() = "xx"; 3、CallMangement 目前暂无使用; 4、List 如果没有特殊情况可以使用 HashSet 代替,以便 Continas 操作;

alexinea commented 3 years ago

We can analyze the performance improvement of RuntimeProxyType cache in CallerManagement. What needs attention here is the consumption of concurrent dictionary in retrieval.

alexinea commented 3 years ago

It seems that the closed PR cannot be traced to subsequent cimmit records. Is is a pity.

alexinea commented 3 years ago

It seems that the closed PR cannot be traced to subsequent cimmit records. Is is a pity.

I found that the closed PR can still be traced to subsequent cimmits records. I'll reopen this PR...

alexinea commented 3 years ago

About the 3rd point. What is the purpose of CallMangement? If the RuntimeProxyType is cached in it, will the performance consumption of TryGetRuntimeType be greater than rebuilding a new RuntimeProxyType?