using System.IO;
using System.Reflection;
using System.Runtime.Loader;
+using System.Globalization;
namespace Tizen.Runtime
{
public class Preloader
{
const string preloadPath = "/usr/share/dotnet.tizen/preload/";
+
+ // If current culture's casing for ASCII is the same as invariant, it can take a fast path
+ // than calling out to the OS for culture-aware casing.
+ // However, in certain languages, the following function may be significantly slowed down.
+ // To avoid that kind situation, call it in advance on the candidate process.
+ private static void CheckAsciiCasing()
+ {
+ _ = CultureInfo.CurrentCulture.CompareInfo.Compare("abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", CompareOptions.IgnoreCase);
+ }
+
public static void Preload()
{
+ CheckAsciiCasing();
+
string[] paths = Directory.GetFiles(preloadPath, "*.preload");
Array.Sort(paths);
foreach (string path in paths)