chuongmep / RevitAddInManager

Revit AddinManager update .NET assemblies without restart Revit for developer.
MIT License
275 stars 50 forks source link

Viewmodel objects are not cached #11

Closed Nice3point closed 2 years ago

Nice3point commented 2 years ago

https://github.com/chuongmep/RevitAddInManager/blob/8faa9fff26524c74eb5aadeb4e6bf3ae115c69cd/AddInManager/ViewModel/AddInManagerViewModel.cs#L105

Caching variant:

public RelayCommand ExecuteAddinCommand => _executeAddinCommand ??= new RelayCommand(ExecuteAddinCommandClick);

this will reduce memory consumption

chuongmep commented 2 years ago

@Nice3point you have any document suggesst about this ? I want to read more documents to understand more about this issue

Nice3point commented 2 years ago

no, it's just that every time you access a property, a new object is created for which memory is allocated, instead it's better to reuse the previous one

Nice3point commented 2 years ago

I want to read more documents

maybe this book https://t.me/programmist_of/210

chuongmep commented 2 years ago

Problem resoleved