bumptech / bumptech/glide

Feature: start RequestManager sooner than onStart(). To reduce latency

Open
#930 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

The RequestManager is paused until the onStart() lifecycle event is triggered. It might be better to start the RequestManager sooner in the lifecycle (in addition to onStart) for example by creating the request manager in the started state.
I do not know what the reasoning is to postpone the start of the request manager, there is probably a good reason :)

The reason for this request is the following observation.
I have an app that:
1. preloads images from the Application.onStart()
2. loads the images into the ImageView from Fragment.onActivityCreated()

From the logs I can tell that the loading into the ImageView results in a MEMORY_CACHE hit in under 1ms.
However the RequestListener.onResourceReady() is not called until the RequestManager is started.

The result is an additional latency of about 80-100ms (depends on device and layout)

When I force the requestManager to start immediately after I load the url into() the ImageView the latency disappears.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.