Skip to content

Fix #2406 - Load media file in the background#2515

Merged
tonyr59h merged 1 commit intowordpress-mobile:developfrom
fadils:issue/2406-improve-media-loading
Apr 9, 2015
Merged

Fix #2406 - Load media file in the background#2515
tonyr59h merged 1 commit intowordpress-mobile:developfrom
fadils:issue/2406-improve-media-loading

Conversation

@fadils
Copy link
Copy Markdown
Contributor

@fadils fadils commented Apr 9, 2015

This PR improves how multiple media selection is handled and loaded to the Editor.
Previously, after selecting multiple media, there will be a slight lag experienced as it has been shown by @tonyr59h in #2406.
This PR puts the the media loading task in the background, thus, removing the lag.

@fadils
Copy link
Copy Markdown
Contributor Author

fadils commented Apr 9, 2015

@tonyr59h as I'm still learning about the Editor (along with many things), I notice that there are still several cases in onActivityResult. Would it be appropriate to get them all in the background? Any other task besides this one that should be put in the background?

@tonyr59h tonyr59h self-assigned this Apr 9, 2015
@tonyr59h
Copy link
Copy Markdown
Contributor

tonyr59h commented Apr 9, 2015

Any other task besides this one that should be put in the background?

I don't think there are any other cases that work so heavily so improvements wouldn't be noticeable. This is the only case that adds more than one thing to the editor at a time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the work is still being done on the main thread. It does seem to load faster and profiling showed a slight improvement of ~7% (decrease in time spent on the main thread) in the one comparison I ran. There is still a noticeable delay if an absurd amount of images are selected but very few people will run into that problem.

tonyr59h added a commit that referenced this pull request Apr 9, 2015
@tonyr59h tonyr59h merged commit b0e90e8 into wordpress-mobile:develop Apr 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants