-
-
Notifications
You must be signed in to change notification settings - Fork 449
Stop calling getLastPageNumber() when not necessary #852
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
Conversation
Very nice optimization! |
I've got feedback that it may break some category listing. At this moment I don't see the reason, I will try to research. |
@midlan did you find anything out? |
@Flyingmana I didn't, my Magento instance is pretty modified and I am not what broken the category listing. Can someone try it on yours Magento? |
Just played bit with ... no real usage, but if |
I've been running this since April 23 on a project with tons of custom code and had no issues. MySQL doesn't support negative limits: "LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants". So, I don't see any reason anyone would ever use a negative |
FYI |
@sreichel |
I have tested the change and it works here. The only place in the core where negative displacement is used is: This change could break 3rd party code, if the code depends on the side effect - assumes that collection is loaded after calling getCurPage(). Or do you see a different possibility @sreichel ? btw, in Magento2 the
|
This it is. I also tested with vanilla install and it did work, but it could break 3rd-party code ... |
…in Varien_Data_Collection::getCurPage()
…in Varien_Data_Collection::getCurPage()
Community, what do you think?
When the
$this->_curPage
is1
the$this->getLastPageNumber()
is called. In eav collection it is slow operation, because$this->getSize()
is called inside.