示例#1
0
        public static void Main(string[] args)
        {
            Test();

            // TODO
            var hashArrayMap = new ThreadsafeTypeHashArrayMap <object>();

            foreach (var type in Classes.Types)
            {
                if (type == typeof(Class12) || type == typeof(Class13))
                {
                    Debug.WriteLine("--");
                }

                Debug.Assert(hashArrayMap.TryGetValue(type, out _) == false);
                hashArrayMap.AddIfNotExist(type, new object());

                //Debug.WriteLine("--");
                //hashArrayMap.Dump();

                foreach (var type2 in Classes.Types)
                {
                    if (!hashArrayMap.TryGetValue(type2, out _))
                    {
                        Debug.WriteLine("--");
                        hashArrayMap.Dump();
                        Debug.WriteLine(type2.Name);
                    }

                    if (type == type2)
                    {
                        break;
                    }
                }

                //Debug.WriteLine("--");
                //hashArrayMap.Dump();
                Debug.WriteLine(hashArrayMap.Count + " " + hashArrayMap.Depth);
            }

            hashArrayMap.Dump();

            foreach (var type in Classes.Types)
            {
                if (!hashArrayMap.TryGetValue(type, out _))
                {
                    Debug.Assert(hashArrayMap.TryGetValue(type, out _));
                }
            }

            BenchmarkSwitcher.FromAssembly(typeof(Program).GetTypeInfo().Assembly).Run(args);
        }