File tree Expand file tree Collapse file tree
benchmarks/ModelContextProtocol.Benchmarks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,4 +80,8 @@ docs/api
8080
8181# Rider
8282.idea /
83- .idea_modules /
83+ .idea_modules /
84+
85+ # Benchmarkdotnet
86+
87+ benchmarks /ModelContextProtocol.Benchmarks /BenchmarkDotNet.Artifacts /
Original file line number Diff line number Diff line change 1- using BenchmarkDotNet . Attributes ;
2- using ModelContextProtocol ;
3- using ModelContextProtocol . Protocol ;
41using System . Text . Json ;
52using System . Text . Json . Nodes ;
3+ using BenchmarkDotNet . Attributes ;
4+ using ModelContextProtocol . Protocol ;
5+
6+ namespace ModelContextProtocol . Benchmarks ;
67
7- public class JsonRpcMessageDeserializationBenchmarks
8+ [ MemoryDiagnoser ]
9+ public class JsonRpcMessageSerializationBenchmarks
810{
911 private byte [ ] _requestJson = null ! ;
1012 private byte [ ] _notificationJson = null ! ;
1113 private byte [ ] _responseJson = null ! ;
1214 private byte [ ] _errorJson = null ! ;
15+
1316 private JsonSerializerOptions _options = null ! ;
1417
1518 [ GlobalSetup ]
@@ -66,4 +69,4 @@ public JsonRpcMessage DeserializeResponse() =>
6669 [ Benchmark ]
6770 public JsonRpcMessage DeserializeError ( ) =>
6871 JsonSerializer . Deserialize < JsonRpcMessage > ( _errorJson , _options ) ! ;
69- }
72+ }
You can’t perform that action at this time.
0 commit comments