Use transfer buffer for small transfer cache entries
OOP-R in RasterImplementation currently allocates the entire free space
available in the transfer buffer so that it doesn't have to measure
first then serialize and can just optimistically serialize into that
space. This means that other transfer buffer consumers can't use it,
and are instead forced to use mapped memory. This turns out to not
be very efficient for large numbers of small allocations.
To sidestep this problem, small transfer cache entries are serialized
into the heap when encountered. Then when raster is complete, it
shrinks the transfer buffer down to the correct size and these small
transfer cache entries are added after it. Then the commands for these
entries are submitted first before raster.
For example, for three transfer cache tasks (A B C) and one raster (R)
the transfer buffer and ring buffer will look like this:
transfer buffer ring buffer: R A B C
command buffer: A B C R
This patch also loosens the restriction on gpu::RingBuffer that there
can be only one in use block at any time. This leads to potential
exhaustion issues because the ring buffer won't reallocate while there
are in use blocks. To avoid this, this optimization is only used when
there is room in the ring buffer without waiting.
An alternative to this patch would have been to have yet another
transfer buffer only for the transfer cache or to rewrite oopr
serialization, but both of those are more invasive solutions.
On OSX, on the rendering.desktop telemetry benchmark, on the story
web_animation_value_type_path, this results in the following results:
gpu-r:
raster cpu time: 2.011ms
gpu cpu time: 12.891ms
total time: 14.902ms
oop-r:
raster cpu time: 7.314ms <- the bug
gpu cpu time: 3.804ms
total time: 11.118ms
oop-r + this patch:
raster cpu time: 0.812ms
gpu cpu time: 3.901ms
total time: 4.713ms
Bug: 804380, 877168
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I586cbca2acb13b8de7d3490c5eb5d6b415f6eda5
Reviewed-on: https://chromium-review.googlesource.com/c/1262955
Commit-Queue: enne <enne@chromium.org>
Reviewed-by:
Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597654}
Showing
Please register or sign in to comment