Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Optimizations #87

Merged
merged 1 commit into from
Dec 14, 2016
Merged

Optimizations #87

merged 1 commit into from
Dec 14, 2016

Conversation

JunTaoLuo
Copy link
Contributor

@JunTaoLuo JunTaoLuo commented Dec 12, 2016

While I was looking at the allocation saving on #70 I noticed a few quick optimizations.

Before: 346747.2 RPS, 1205.3 bytes/req (net451), 848.6 bytes/req (netcore)
After: 434507.1 RPS, 1158.9 bytes/req (net451), 802.8 bytes/req (netcore)

@BrennanConroy @Tratcher

@JunTaoLuo JunTaoLuo changed the title Optimizations (WIP) Optimizations Dec 12, 2016

public Stream Body { get; set; }

public string BodyLengthString { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not cache this directly in Headers like you do with Date?

@JunTaoLuo
Copy link
Contributor Author

🆙📅 @BrennanConroy @Tratcher

- Calculate age using operations on long
- Compute content length of resposne on store
- Format age using the new HeaderUtility
- Lazily create HeaderDictionary
- Use for instead of foreach to reduce allocations from enumerators
@JunTaoLuo JunTaoLuo merged commit 8e85255 into dev Dec 14, 2016
@JunTaoLuo JunTaoLuo deleted the johluo/long branch December 14, 2016 19:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants