コード例 #1
0
ファイル: JsonWriterPerf.cs プロジェクト: wcontayon/corefxlab
        //[Benchmark]
        public void WriterSystemTextJsonBasicUtf8UnescapedSkip()
        {
            _arrayFormatterWrapper.Clear();

            var state = new JsonWriterState(options: new JsonWriterOptions {
                Indented = Formatted, SkipValidation = SkipValidation
            });

            var json = new Utf8JsonWriter2(_arrayFormatterWrapper, state);

            json.WriteStartObject();
            for (int i = 0; i < 100; i++)
            {
                json.WriteStringSkipEscape(First, John);
            }
            json.WriteEndObject();
            json.Flush();
        }