[Tizen.Log] Optimize garbage collection (#5156)
author조영재 <y0.cho@samsung.com>
Thu, 27 Apr 2023 04:27:17 +0000 (13:27 +0900)
committerGitHub <noreply@github.com>
Thu, 27 Apr 2023 04:27:17 +0000 (13:27 +0900)
commit571034798255bb38fc8b1a67002a27dd0f0b0077
treeaa6ffdf9f796fd6efeb8a18ca5923a75efe7f72e
parentcdec369c4789e067d2bf0f93948be0d20ee6945b
[Tizen.Log] Optimize garbage collection (#5156)

* [Tizen.Log] Optimize garbage collection

The CLR automatically converts string into byte array when it invokes
native function. In this process, the CLR allocates byte array on heap,
which will be a garbage, for every single string. If applications are
printing dlog too bursty, those garbage would pile up, consuming too much
memory. To reduce those garbage, manually allocates byte array on stack
and convert string into that byte array.

Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
* [Tizen.Log] Remove Substring function (#2)

To cut filename from whole filepath, Print function uses Substring function.
Also, filename string is newly created.
To avoid newly create memory which can be garbage collecting target,
Substring function is removed.

Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Co-authored-by: Yunhee <yuni.seo@samsung.com>
---------

Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Co-authored-by: yuni.seo <129935814+yuni-seo@users.noreply.github.com>
Co-authored-by: Yunhee <yuni.seo@samsung.com>
src/Tizen.Log/Interop/Interop.Dlog.cs
src/Tizen.Log/Tizen.Log.csproj
src/Tizen.Log/Tizen/Log.cs