-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update home and remove menu #337
Conversation
This will isolate upcoming changes on the menu items. Signed-off-by: Rafael Reggiani Manzo <[email protected]>
This will make possible to remove the left side box which now has no purpose. Signed-off-by: Heitor Reis <[email protected]>
Its user related features have been moved to the header and tutorials are now under mezuro.github.io. The remaining Kalibro informations were just placeholders and are now better covered on mezuro.github.io as well. Signed-off-by: Heitor Reis <[email protected]>
The 'Hello' just felt wrong in the top menu (design stuff). Signed-off-by: Heitor Reis <[email protected]>
It will enable better isolation when turning it into a Bootstrap container-fluid just like the header and body. Signed-off-by: Heitor Reis <[email protected]>
It now has to click first on the dorpdown.
This improves the behaviour on small screen devices.
This is a information that will get published at the homepage.
This is a information that will get published at the homepage.
The acceptance test has been refactored accordingly and got more extended to untested features.
👍 Nice work! |
Great job! 😄 |
@@ -1,3 +1,7 @@ | |||
class Repository < KalibroClient::Entities::Processor::Repository | |||
include KalibroRecord | |||
|
|||
def self.latest(count=1) | |||
all.sort { |one, another| another.id <=> one.id }.first(count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fetch every single repository any time it's called. The sort should be changed to something that ActiveRecord can handle to avoid that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not activerecord, but KalibroClient... The all
will retrieve an array once per call and the sort will produce no other calls as it is implemented by array.
Do you have a better implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I get for writing when I'm sleepy. I misread it completely, sorry.
But I remembered just now that we can use RepositoryAttributes to up repositories while actually using ActiveRecord.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then call KalibroClient? Involving RepositoriesAttributes (which are not called currently) does not add more complexity? And more complexity on understanding what the code does? The cache is not supposed to make such queries affordable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then call KalibroClient? Involving RepositoriesAttributes (which are not called currently) does not add more complexity? And more complexity on understanding what the code does? The cache is not supposed to make such queries affordable?
The added complexity is just .map(&:repository)
. It surely beats fetching all repositories over the network to manually sort them. Even if we cache it, we're turning a query that should take miliseconds in one that can possibly take seconds while using up a ridiculous amount of database I/O for no reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I wrote was meant to address all of the questions, which ones in particular do you mean? I don't think the cache justifies writing code that is two or three orders of magnitude less optimal than what is possible (and without that much effort).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a third opinion would be nice @mezuro/core
I just want to stress again: code readability is more important than performance, if you can address the perfomance issues by other techniques such as caching, just have a look through all the other projects. Any change should be subject of a retrospective rather than issue comments.
There will be no changes regarding this on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you wish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can measure the time it takes on both cases. If the difference is really of two or three orders of magnitude, I think we should do it even if readability gets worse.
The reason for that is we do not want that our pages take more than a few hundreds of milliseconds to load. Specially our home page, even on a few cases (when cache needs to be updated). There's been a lot of research concluding that users will not return to your site if the pages take too long to load (usually that means at most 1 second).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be way too much effort just for this. I'm fine leaving it as
is, even though I think it's not nearly the best code we could write
considering the balance between readability and efficiency. But I think
it's important to understand well how the cache will work before using it
as a replacement for even thinking about performance. As usual, "no
silver bullet" is relevant here.
Also, we're introducing the recent things listings as an UX improvement.
How can we know if it will be useful if we don't even know how often it
will be updated?
Em qui, 14 de abr de 2016 12:33, Diego de Araújo Martinez Camarinha <
[email protected]> escreveu:
In app/models/repository.rb
#337 (comment):@@ -1,3 +1,7 @@
class Repository < KalibroClient::Entities::Processor::Repository
include KalibroRecord
+
- def self.latest(count=1)
- all.sort { |one, another| another.id <=> one.id }.first(count)
Maybe we can measure the time it takes on both cases. If the difference is
really of two or three orders of magnitude, I think we should do it even if
readability gets worse.The reason for that is we do not want that our pages take more than a few
hundreds of milliseconds to load. Specially our home page, even on a few
cases (when cache needs to be updated). There's been a lot of research
concluding that users will not return to your site if the pages take too
long to load (usually that means at most 1 second).—
You are receiving this because you are on a team that was mentioned.Reply to this email directly or view it on GitHub
https://github.com/mezuro/prezento/pull/337/files/610763c4f6a22b9db9bcf044a0fa990a50ded422#r59739014
I forgot to mention, but good job, my comments are just nitpicks :) |
@@ -1,5 +1,7 @@ | |||
class HomeController < ApplicationController | |||
def index | |||
@latest_projects = Project.latest(5) | |||
@latest_repositories = Repository.latest(5) | |||
@latest_configurations = KalibroConfiguration.latest(5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed it - doesn't this defeat the cache completely? Since it's not inside a cache block it will always be executed before the view is rendered, and always fetch everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch (#339) as this seems as a bug introduced back in 2013 and just found now.
As we are using multiple cache fragments for one action, we need to specify action_suffixes so rails create different keys for each fragment. Signed-off-by: Rafael Reggiani Manzo <[email protected]>
Information got update regarding PHP and copyright year.
The footer became a grid in order to better work on smaller screens.