Пример #1
0
        public CharSequenceEqualsBenchmarks()
        {
            _strings   = Enumerable.Range(0, StrCount).Select(i => StringGenerator.GenString(StrLength - 4) + "abcd").ToArray();
            _2bStrings = _strings.Select(s => CharSequence.FromValue(s)).ToArray();
            _strings3  = _strings.Select(s => s.Substring(0, StrLength - 4) + "1234").ToArray();

            _strings2   = _strings.Select(s => new string(s)).ToArray();
            _2bStrings2 = _strings2.Select(s => CharSequence.FromValue(s)).ToArray();
            _2bStrings3 = _strings3.Select(s => CharSequence.FromValue(s)).ToArray();
        }
        public CharSequenceDictionaryBenchmarks()
        {
            _strings   = Enumerable.Range(0, StrCount).Select(i => StringGenerator.GenString(StrLength)).ToArray();
            _2bStrings = _strings.Select(s => CharSequence.FromValue(s)).ToArray();
            foreach (string s in _strings)
            {
                _strDict[s] = 1;
            }

            foreach (CharSequence s in _2bStrings)
            {
                _2bDict[s] = 1;
            }

            _strings2   = _strings.Select(s => new string(s)).ToArray();
            _2bStrings2 = _strings2.Select(s => CharSequence.FromValue(s)).ToArray();
        }
 public CharSequenceHashCodeBenchmarks()
 {
     _strings   = Enumerable.Range(0, StrCount).Select(i => StringGenerator.GenString(StrLength)).ToArray();
     _2bStrings = _strings.Select(s => CharSequence.FromValue(s)).ToArray();
 }