Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional /perf directory for any example proposal #1541

Open
samccone opened this issue Dec 2, 2015 · 20 comments
Open

optional /perf directory for any example proposal #1541

samccone opened this issue Dec 2, 2015 · 20 comments

Comments

@samccone
Copy link
Member

samccone commented Dec 2, 2015

There is a demand on many fronts to enable "production" versions of todomvc apps.

Any app should be able to add an additional /perf directory

examples/backbone/perf

The folder should contain an index.html file to serve their app in a way that is inline with best practices for said tool/framework.

Requirements for perf

  • No files will be linted in /perf
  • The root examples folder should have a way to build the source to go to /perf (this is the idea case.. however some examples will need a different codebase... if that is the case.. the new src can be placed into the /perf folder for the example)
  • Any changes to the app will require the changer to recompile the perf build (we will need to enforce this)
  • CI tests will be run on both /index.html and perf/index.html
  • learn.json needs a new perf-enabled field per framework
  • If an example if perf optimized by default (this is a outlier case) we will place an index.html file inside of perf/ that redirects to the root example

@tastejs/todomvc if everyone is OK with this I know there are several people willing to do a pass on a few implementations

@addyosmani
Copy link
Member

👍 from me based on comment from #1490 (comment)

@sindresorhus
Copy link
Member

👍

@passy
Copy link
Member

passy commented Dec 3, 2015

SGTM. What about perf-related changes to the logic, as with angular-perf? Do we continue to keep those separate or is that something you want to cover with this proposal as well?

@samccone
Copy link
Member Author

samccone commented Dec 3, 2015

I would like to kill angular-perf and roll it into normal angular

@passy
Copy link
Member

passy commented Dec 3, 2015

@samccone So having perf/ versions of the app that aren't directly created from the non-perf/ are okay then?

@samccone
Copy link
Member Author

samccone commented Dec 3, 2015

hmm good question, i was thinking there would be 1 codebase just compiled differently for perf...

but perhaps we should allow two codebases because i could think of situations where this would be required

@passy
Copy link
Member

passy commented Dec 3, 2015

In theeooory, we could have a perf.patch that's applied as part of the build, but I'm not sure if that's gonna make things actually easier for anyone.

@samccone
Copy link
Member Author

samccone commented Dec 3, 2015

imho... lets just let some people do the perf version and we can see the demands per each request

thoughts?

@passy
Copy link
Member

passy commented Dec 3, 2015

@samccone 👍 Let's figure out the details along the way.

@samccone
Copy link
Member Author

samccone commented Dec 3, 2015

💃

@addyosmani
Copy link
Member

but perhaps we should allow two codebases because i could think of situations where this would be required

I can see some framework authors requiring source specific changes for a perf-optimised version of their app. Would like to keep it flexible so \perf can either be same source (ideally, pretty close) with build-time optimisations or completely different source as long as it's still latest versions + follows spec.

@passy
Copy link
Member

passy commented Dec 9, 2015

\perf

You spend too much time on Windows, @addyosmani! 🎪

@sindresorhus
Copy link
Member

Lol

@samccone
Copy link
Member Author

samccone commented Dec 9, 2015

@addyosmani
Copy link
Member

😭 🍫

@sindresorhus
Copy link
Member

image

@dmitriz
Copy link
Contributor

dmitriz commented Jan 7, 2016

As mentioned, the current angularjs-perf implementation is different from angularjs. Specifically - it avoids router.

The difference in performance even caused me some frustrations leading to writing this rebellious answer on StackOverflow.


Now there are two different performance stages:

initial page load and route change.

Many testers coming from outside and writing articles only test the former. However, it is the latter that the user has to deal with every single time after the app is started. As more people come here with testing mind, it may be helpful to

  • include a guide or at least a memo as to how to test the project "correctly".

This seems to highlight a major problem here - how differently people see this project with very different purposes:

  • Code comparison: I need to decide X vs Y: Which code is shorter/ easier to read?
  • Learn best practices: I'm already using X, now I want to learn industry top standards.
  • Performance: I'm writing an article and want to compare the library sizes and run performance tests.

The problem with "best practices", they may be the best in some cases but not in others. The Todo App here is relatively small, so some of the best practices look bloated and unnecessary.

So when you code with the idea to show people best practices, you end up with unnecessarily complex and bloated code that can mislead a newcomer into a wrong judgement about the framework.

On the other hand, if you optimise what the framework gives, to get things done fast and short, that may show the framework more appealing to newcomers but may not necessarily be good example to learn best practices from. See New AngularJS HTML Only Implementation for an extreme example :)


  • So perhaps several implementations with different goals in mind are justified? All in separate sub-folders?
  • And perhaps avoiding calling it "official Angular implementation" but rather keep in its own folder with clearly defined goal? That way people from outside are forced to understand the difference before jumping to quick conclusions and influencing others.

@ColinEberhardt
Copy link
Member

So perhaps several implementations with different goals in mind are justified? All in separate sub-folders?

I think this highlights a problem with the whole concept of adding 'perf' implementations. Does the lack of a 'perf' implementation for a particular framework mean that the canonical implementation is already performance optimised? How 'deep' should the optimisations be?

Personally I think it is better to have a single implementation for each framework and instead if someone wants to performance optimise, they write it up as a blog post which we link to in the side menu.

@samccone
Copy link
Member Author

samccone commented Jan 7, 2016

if someone wants to performance optimise, they write it up as a blog post which we link to in the side menu

People kinda already do this... however no one doing these perf checks ever looks or finds them to test against.. In my mind standardizing the way you get to the perf implementation via /perf makes it SUPER simple for people doing this kind of testing to blindly jump to the "production ready" version

Does the lack of a 'perf' implementation for a particular framework mean that the canonical implementation is already performance optimized

^ See my last point on the initial issue

How 'deep' should the optimisations be?

This is kinda up to the person doing it, I am fine with pretty much anything so long as

  1. it is still the framework :)
  2. it still passes the integration tests

@dmitriz
Copy link
Contributor

dmitriz commented Jan 16, 2016

Totally agree with the importance of SUPER simple.

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

No branches or pull requests

6 participants