How to achieve high-performance REST API on Azure with .NET?

后端 未结 7 1753
Happy的楠姐
Happy的楠姐 2021-02-07 15:24

We have a .NET Web Role hosted on Windows Azure that only serves a REST API with only a hand few web methods.

API is u

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 15:48

    Is your XML being serialized via reflection (ie. using attributes and so forth)? If so, then protobuf-net stands to be much, much faster.

    In fact, though, even if your XML serialization is customized using explicit getter and setter Func<>s, you can still see some significant gain with protobuf-net. In our case, depending on the size and content of the objects being serialized, we saw 5-15% speed increases in serialization times.

    Using protobuf-net will also provide a bump to available bandwidth, though that will depend on your content to a large extent.

    Our system sounds pretty different from yours, but FWIW we find that WCF itself has an almost imperceptibly low overhead compared to the rest of the flow. A profiler like dotTrace might help identify just where you can save once you've switched to protobufs.

提交回复
热议问题