--
You received this message because you are subscribed to the Google Groups "scheduler-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scheduler-de...@chromium.org.
To post to this group, send email to schedu...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CAHLUNMw_rhzNw1_zGFV1HcCio4Wekkvvvg41zUziK8iA_yjxCw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CAPuLczvxx5p20NSMhVtEcjMSKjUXMsp92LY6YHFQaYvPhQZRkQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to graphics-dev...@chromium.org.
I like the idea of decoding in chunks.
Do our decoding libraries allow this, though?
To unsubscribe from this group and stop receiving emails from it, send an email to graphics-dev...@chromium.org<mailto:graphics-dev+uns...@chromium.org>.
To unsubscribe from this group and stop receiving emails from it, send an email to graphics-dev...@chromium.org<mailto:graphics-dev...@chromium.org>.
The OS also has to change from user space to kernel space which can be expensive but since it is so important, hardware vendors squeeze as much optimize out of it as possible.
I like the idea of decoding in chunks.
Do our decoding libraries allow this, though?
Do they expect the whole, completed input?
We'd also need to consider the possibility that we've started a decode, but we won't ever come back to it. This can happen if you just fling by an image, we partially decode it, but we keep flinging and not visit that image again.I think there should be something in place to also just cancel the decode. After all, if the image gets far enough away from visible, finishing the decode is also likely wasted work.
On Wed, Oct 14, 2015 at 2:02 PM, Vladimir Levin <vmp...@chromium.org> wrote:We'd also need to consider the possibility that we've started a decode, but we won't ever come back to it. This can happen if you just fling by an image, we partially decode it, but we keep flinging and not visit that image again.I think there should be something in place to also just cancel the decode. After all, if the image gets far enough away from visible, finishing the decode is also likely wasted work.If we just split up the decode into multiple dependent tasks as I suggesting then all decode tasks that have not yet started running will be cancelled using the same mechanism as how full image decode tasks are cancelled today when not needed. ie. tasks not in the currently scheduled task graph will be cancelled.
On Wed, Oct 14, 2015 at 12:18 PM, David Reveman <rev...@google.com> wrote:On Wed, Oct 14, 2015 at 2:02 PM, Vladimir Levin <vmp...@chromium.org> wrote:We'd also need to consider the possibility that we've started a decode, but we won't ever come back to it. This can happen if you just fling by an image, we partially decode it, but we keep flinging and not visit that image again.I think there should be something in place to also just cancel the decode. After all, if the image gets far enough away from visible, finishing the decode is also likely wasted work.If we just split up the decode into multiple dependent tasks as I suggesting then all decode tasks that have not yet started running will be cancelled using the same mechanism as how full image decode tasks are cancelled today when not needed. ie. tasks not in the currently scheduled task graph will be cancelled.If we split up one image decode over several tasks, then presumably each task would have some sort of a handle or a way of letting know the decoding system that it is resuming a previous decode instead of starting a new one. Basically, some state will be kept in the decoder waiting for the next thing to tell it to continue. All I meant above is that if the tasks are canceled, then there needs to be a process of informing the decoder to purge its state. Either that or to somehow ensure that the next time we try to decode this image (if it becomes a priority again), then it should resume from wherever it left off.
Don't we only use discardable memory if all the data has already been received? (We recently discussed this here [1] and that was the conclusion we came to.) A partially decoded image will use the memory stored in the decoder (in the ImageFrame's SkBitmap's SkMallocPixelRef, allocated by malloc). (Maybe I'm too concerned with the current flow here - you *could* decode a partial image to discardable memory, but we do not today. I'm guessing the motivation is that you do not want to partially decode to discardable memory, then throw away that memory due to memory pressure, then try to resume the decode but actually have to start over.) ImageDecoder does have a way for you to tell it to clear that memory though (which will also happen when the ImageDecoder is deleted).
I did some work to run performance benchmarks for jpeg decoding as compared memcpy. I'm seeing that even for the largest images, the jpeg decodes appear to be about 5x slower on z620 and at least 10x slower on Nexus 6.
If we're under memory pressure, then I think it's best to allow the discardable memory system to purge partial decodes and just start over.
On Fri, Oct 16, 2015, 4:57 AM Daniel Bratell <bra...@opera.com> wrote:
On Thu, 15 Oct 2015 20:51:51 +0200, 'David Reveman' via Graphics-dev <graphi...@chromium.org> wrote:
If we're under memory pressure, then I think it's best to allow the discardable memory system to purge partial decodes and just start over.
I think you have to be very careful with that. I'm leaning on Presto experience here where this could effectively kill a web application on a slow device. Most likely partially decoded images that are needed in every frame should be the very last thing to discard.
The plan is that the compositor would keep some set of images pinned that are in or close to the current viewport. A failure to resume a decode that we started earlier would only happen if the priority of that image was relatively low sometime between the initial decode and the resume.
David