Skip to content

implemented soft reference in memory cache for thumbnails - #944

Closed
Spacefish wants to merge 3 commits into
owncloud:masterfrom
Spacefish:develop
Closed

Spacefish wants to merge 3 commits into
owncloud:masterfrom
Spacefish:develop

Conversation

@Spacefish

Copy link
Copy Markdown

this is pr #943 but against develop instead of master. I also some functionality to make sure that the cache is consistent, when using put, remove, clear on the class.

@nedimhx

nedimhx commented Apr 16, 2015

Copy link
Copy Markdown

When I open folder where are pics every time it load me first 2 thumbnails and for other 5-6 need about 30 sec to wait until they are loaded, but when I "pull to refresh" every 1-2 sec thumbnails are loading faster.

Is it possible to compres thumbnails to reduce quality which would speed up thumbnails previews ?

@tobiasKaminsky

Copy link
Copy Markdown
Contributor

@nedimhx This has absolutely nothing to do with this pull request.
The thumbnails have currently the png format, which is not ideal for images.
I hope that /core will change this soon.

Regarding your first problem: please open a new issue and describe your problem with the template.

@Spacefish

Copy link
Copy Markdown
Author

I have seen this problem as well. The picture box is not repainted after the image is set. But this has really nothing to do with my pull request. The problem already existed before.

@Spacefish

Copy link
Copy Markdown
Author

Any updates on this? Will this be merged?

@masensio

masensio commented May 6, 2015

Copy link
Copy Markdown

Hi @Spacefish,

Thanks for your contribution.

We are fighting with the thumbnails problem.
But before merging your code we need you sign and send the contributor agreement at http://owncloud.org/about/contributor-agreement/ to @karlitschek .

Also we need to validate this PR before merging it.

Thanks in advance

@Spacefish

Copy link
Copy Markdown
Author

@masensio thanks for your answer, i have already signed the contributor agreement, i have commit rights for most of the repositories here, but android is not one of them.

@masensio

masensio commented May 7, 2015

Copy link
Copy Markdown

@Spacefish, thanks for your answer. Sorry I've looked for your name in Android-devs team and I haven't found it.
After your answer, I've seen your name in core-devs team. 😄

@Spacefish

Copy link
Copy Markdown
Author

Any updates on this? The commit is still compatible with the latest source in develop.. Can we merge it? I have signed the developers agreement, but i have no rights in the android repository here :(

@tobiasKaminsky

Copy link
Copy Markdown
Contributor

There is a small typo in the task: thumbnail is missing a n ;)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ThumbnailLoaderTask instead of ThumbailLoaderTask ;)

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.

Refactoring the original block in a reusable item is really needed, great point.

At first I didn't understand the new flow, but in a second thought, seems that makes sense.

Anyway, is not there an easier way to write it? Maybe merging both ThumbnailLoaderTask and ThumbnailGenerationTask in a single AsyncTask? Just wondering, didn't think it in depth.

@masensio

masensio commented Sep 9, 2015

Copy link
Copy Markdown

@Spacefish could you update this PR with the last version of develop?

As soon as this branch is updated, this PR will be ready to be tested.

@davivel

davivel commented Sep 10, 2015

Copy link
Copy Markdown
Contributor

Sorry, I need more info.

What's the advantage of using SoftReference in this case?

Thanks in advance.

@rperezb rperezb added this to the backlog milestone Oct 15, 2015
@ghost ghost mentioned this pull request Mar 18, 2016
@davivel

davivel commented Apr 14, 2016

Copy link
Copy Markdown
Contributor

Reviewing better this time.

So, the point is not the SoftReference as much as there is a new cache level in memory, besides the disk cache. Makes sense.

I'll add a couple of comments.


private static final String TAG = DiskLruImageCache.class.getSimpleName();

private Map<String, SoftReference<Bitmap>> mBitmapCache = Collections.synchronizedMap(new HashMap<String, SoftReference<Bitmap>>());

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.

Please, wrap lines at 120 characters for better readability in Github

@davivel

davivel commented Apr 14, 2016

Copy link
Copy Markdown
Contributor

@Spacefish , I made some comments.

Could you also rebase your branch on owncloud:master and then make a new PR onto it? We changed the PR workflow since the time you created this PR. I'm really sorry, I know it may be disturbing, specially since you already changed the target branch before.

@davivel davivel removed the 1 - To do label Jul 14, 2016
@michaelstingl michaelstingl removed this from the backlog milestone Jun 26, 2019
@michaelstingl michaelstingl added this to the 2.12.0 milestone Jun 26, 2019
@michaelstingl michaelstingl added the p3-medium Normal priority label Jun 26, 2019
@jesmrec jesmrec modified the milestones: 2.12.0, 2.13.0 Jul 30, 2019
@jesmrec jesmrec modified the milestones: 2.13.0, 2.14.0 Aug 27, 2019
@jesmrec jesmrec modified the milestones: 2.14.0, 2.15 Nov 25, 2019
@davigonz
davigonz changed the base branch from develop to master December 2, 2019 09:47
@jesmrec jesmrec modified the milestones: 2.15, backlog Mar 13, 2020
@abelgardep abelgardep closed this Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-medium Normal priority Technical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants