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

FormFeature allocates when unused #677

Closed
benaadams opened this issue Jul 22, 2016 · 11 comments
Closed

FormFeature allocates when unused #677

benaadams opened this issue Jul 22, 2016 · 11 comments
Assignees
Labels

Comments

@benaadams
Copy link
Contributor

benaadams commented Jul 22, 2016

form-feature-allocation

Resolved by: #675

@muratg
Copy link

muratg commented Jul 25, 2016

Investigation

@davidfowl davidfowl added the Perf label Jul 26, 2016
@muratg muratg assigned pakrym and unassigned Tratcher Aug 17, 2016
@pakrym
Copy link
Contributor

pakrym commented Aug 17, 2016

We don't see difference in performance even when removing FormFeature and CookieFeature allocations completely (72d30a5).

@davidfowl
Copy link
Member

You mean throughput. We should be looking at memory as well which this does improve right?

@pakrym
Copy link
Contributor

pakrym commented Aug 18, 2016

@davidfowl it does, a bit, question is is 88 bytes worth it? And most real world applications use both cookies and forms.

@davidfowl
Copy link
Member

Every byte counts. If it's easy and non-breaking lets do it. If it complicates things too much then naw.

@Tratcher
Copy link
Member

So far the solutions have been pretty complicated.

@benaadams
Copy link
Contributor Author

benaadams commented Aug 18, 2016

most real world applications use both cookies and forms.

But not most requests > 50% of webpages (8M sample) have a form and they will be served by a GET request without a form data; as well as all the assets on page (images, fonts, script etc)

A lot of requests and sites are unauthenticated don't have cookies (asset servers) and/or don't care about the cookies (3rd party analytic cookie). There's also vogue not to use cookies but to use local storage and tokens for auth and webapi often doesn't use cookies.

(Edit: is response cookies which are used even less, if already set)

So having the features created for every unauthed GET request seems unnecessarily.

question is is 88 bytes worth it?

It is when you start densely packing sites on a server with more restricted RAM so the GC becomes more aggressive. You can create the processes in Jobs to simulate this.

@Yves57
Copy link
Contributor

Yves57 commented Aug 19, 2016

Just a question for curiosity: why Factories are not a solution (at least for the less used features)?
I imagine something like public void Set<TFeature>(Func<TFeature> factory) in IFeatureCollection, that would allow create the feature only the first time it is requested...

@pakrym
Copy link
Contributor

pakrym commented Aug 19, 2016

@Yves57 that's exactly what I've tried: #691

@benaadams
Copy link
Contributor Author

@Yves57 its carrying the initalization state for the feature that's problematic

@muratg
Copy link

muratg commented Sep 2, 2016

This doesn't seem to be bringing a lot of perf benefits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants