简体   繁体   中英

Avoiding Serialization/Deserialization In Azure Service Fabric?

I have an Actor service which has a method that looks something like this

Task<IEnumerable<MyClass>> GetList();

I also have a web api as part of the ASF application that looks something like this

[HttpGet("list")]
public async Task<IEnumerable<MyClass>> GetList()

This basically gets the list from the actor and then returns it. The performance isn't really good enough and I think this is down to the fact that the Actor service is serializing the list, sending it to the api which is deserializing it when it receives it before serializing it again to return it.

Is there a better way? Can some of the serialization and deserialization be avoided?

Couple of questions: 1. Does your code in the webapi retrieve everything before returning? Can you post the gist of that code? 2. Have you considered streaming the results?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM