Displaying a pre-fetched object comprising a first associated with a desired content and a second element associated with time-sensitive information associated with the desired content
View Patent ↗In one embodiment, a computing device identifies a portion of a display object to pre-generate. The device may monitor a thread to identify the next upcoming window of idle time (i.e., the next opportunity when the thread will be idle for a minimum period of time). The device may add one or more selected pre-generation tasks to a message queue for execution by the thread during the window. The device may execute the one or more selected pre-generation tasks in the message queue by pre-generating at least one selected element of a display object with content for a portion of the content layout, and then return the display object.
1. A method performed by a computing device, comprising:
storing a display object in an application-tailored recycler, wherein the display object comprises a first pre-generated element and a second pre-generated element, wherein the first pre-generated element comprises content and the second pre-generated element comprises time-sensitive information associated with a current state of user views or comments on the content;
receiving a request for a portion of a content layout of a screen for which the display object was pre-generated;
determining, in response to the request for the portion of the content layout of the screen, that the display object is suitable for being re-used based on an application-specific recycling policy; and
in response to determining that the display object is suitable for being re-used based on the application-specific recycling policy:
retrieving the first pre-generated element and the second pre-generated element from the application-tailored recycler;
updating the second pre-generated element which is time sensitive based on an amount of time associated with receiving the request and the time when the second pre-generated element was pre-generated; and
returning the display object to be displayed in the portion of the content layout of the screen, the returned display object comprising the first pre-generated element and the updated second pre-generated element.
2. The method of claim 1 , further comprising:
updating other elements of the display object as needed for the portion of the content layout of the screen.
3. The method of claim 1 , wherein prior to the receiving of the request for the portion of the content layout of the screen, the portion of the content layout is outside of a displayable region of the screen.
4. The method of claim 1 , wherein the first pre-generated element and the second pre-generated element are selected for pre-generation based on dimensions of the screen, an aspect ratio of the screen, a type of the content to be rendered, application-specific factors, user-configured settings, or user preferences.
5. The method of claim 1 , further comprising:
identifying a portion of the display object to pre-generate;
monitoring a thread to identify a next window of idle time, the next window of idle time comprising the next opportunity when the thread will be idle for a minimum period of time;
adding one or more selected pre-generation tasks to a message queue for execution by the thread during the next window of idle time; and
executing, during the next window of idle time, the one or more selected pre-generation tasks in the message queue by pre-generating at least one selected element of the display object with content for the portion of the content layout, wherein the at least one selected element of the display object comprises the first pre-generated element and the second pre-generated element.
6. The method of claim 1 , further comprising:
identifying the display object as being suitable for being recycled for containing a different content.
7. The method of claim 6 , further comprising:
overwriting existing content in the display object with the different content.
8. One or more computer-readable non-transitory storage media embodying software that is operable when executed by a computing device to:
store a display object in an application-tailored recycler, wherein the display object comprises a first pre-generated element and a second pre-generated element, wherein the first pre-generated element comprises content and the second pre-generated element comprises time-sensitive information associated with a current state of user views or comments on the content;
receive a request for a portion of a content layout of a screen for which the display object was pre-generated;
determine, in response to the request for the portion of the content layout of the screen, that the display object is suitable for being re-used based on an application-specific recycling policy; and
in response to determining that the display object is suitable for being re-used based on the application-specific recycling policy:
retrieve the first pre-generated element and the second pre-generated element from the application-tailored recycler;
update the second pre-generated element which is time sensitive based on an amount of time associated with receiving the request and the time when the second pre-generated element was pre-generated; and
return the display object to be displayed in the portion of the content layout of the screen, the returned display object comprising the first pre-generated element and the updated second pre-generated element.
9. The media of claim 8 , wherein the software is further operable when executed by the computing device to:
update other elements of the display object as needed for the portion of the content layout of the screen.
10. The media of claim 8 , wherein the first pre-generated element and the second pre-generated element are selected for pre-generation based on dimensions of the screen, an aspect ratio of the screen, a type of the content to be rendered, application-specific factors, user-configured settings, or user preferences.
11. A computing device comprising:
one or more processors; and
a memory coupled to the processors comprising instructions executable by the processors, the processors being operable when executing the instructions to:
store a display object in an application-tailored recycler, wherein the display object comprises a first pre-generated element and a second pre-generated element, wherein the first pre-generated element comprises content and the second pre-generated element comprises time-sensitive information associated with a current state of user views or comments on the content;
receive a request for a portion of a content layout of a screen for which the display object was pre-generated;
determine, in response to the request for the portion of the content layout of the screen, that the display object is suitable for being re-used based on an application-specific recycling policy; and
in response to determining that the display object is suitable for being re-used based on the application-specific recycling policy:
retrieve the first pre-generated element and the second pre-generated element from the application-tailored recycler;
update the second pre-generated element which is time sensitive based on an amount of time associated with receiving the request and the time when the second pre-generated element was pre-generated; and
return the display object to be displayed in the portion of the content layout of the screen, the returned display object comprising the first pre-generated element and the updated second pre-generated element.
12. The device of claim 11 , wherein the processors are further operable when executing the instructions to:
update other elements of the display object as needed for the portion of the content layout of the screen.
13. The device of claim 11 , wherein the first pre-generated element and the second pre-generated element are selected for pre-generation based on dimensions of the screen, an aspect ratio of the screen, a type of the content to be rendered, application-specific factors, user-configured settings, or user preferences.