Improved async/await support Edit #6

Merged
merged 2 commits into from Aug 27, 2013

Conversation

Projects
None yet
3 participants
@semihokur
Contributor

semihokur commented Aug 22, 2013

I am Semih Okur, a PhD student in the CS department at the University of Illinois. I'm currently doing research on asynchronous programming in phone applications. I developed a tool that automatically improves async/await usages by doing transformations.

The tool found some opportunities in your application. First, it added "ConfigureAwait(false)" to some await statements in order to decrease overhead of capturing the context because those methods do not require context (like updating UI).

Second, it added corresponding async calls of methods in JsonConvert class under "async" declared methods. For instance, it replaces "JsonConvert.DeserializeObject" with "JsonConvert.DeserializeObjectAsync".

Are you interested in merging this pull request? If not, please let me know why, and I'll try and improve the pull request with your comments in mind.

Thanks,
Semih

penrillian-chrisa added a commit that referenced this pull request Aug 27, 2013

Merge pull request #6 from semihokur/master
Improved async/await support Edit

@penrillian-chrisa penrillian-chrisa merged commit 2b75b6f into Penrillian:master Aug 27, 2013

- return JsonConvert.DeserializeObject<KinveyHandshakeResponse>(json);
+ return await JsonConvert.DeserializeObjectAsync<KinveyHandshakeResponse>(json).ConfigureAwait(false);

This comment has been minimized.

@tyrotoxin

tyrotoxin Feb 6, 2017

This is harmful for performance, synchronous version is preferable.

@tyrotoxin

tyrotoxin Feb 6, 2017

This is harmful for performance, synchronous version is preferable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment