//[Benchmark] public void WriteArray() { _arrayFormatterWrapper.Clear(); var state = new JsonWriterState(options: new JsonWriterOptions { Indented = Formatted, SkipValidation = SkipValidation }); var json = new Utf8JsonWriter2(_arrayFormatterWrapper, state); json.WriteStartObject(); json.WriteNumberArray(Message, _longs, suppressEscaping: true); json.WriteEndObject(); json.Flush(); }
//[Benchmark] public void WriterSystemTextJsonArrayValues() { _arrayFormatterWrapper.Clear(); var state = new JsonWriterState(options: new JsonWriterOptions { Indented = Formatted, SkipValidation = SkipValidation }); var json = new Utf8JsonWriter2(_arrayFormatterWrapper, state); json.WriteStartObject(); json.WriteNumberArray(Encoding.UTF8.GetBytes("numbers"), dataArray, suppressEscaping: true); json.WriteEndObject(); json.Flush(); }