rlottie: reduce polling count for task scheduler to 2.
authorsubhransu mohanty <sub.mohanty@samsung.com>
Wed, 30 Oct 2019 09:47:00 +0000 (18:47 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 11 Nov 2019 20:58:15 +0000 (05:58 +0900)
when the queue is empty the thread tries to steal from other queue
and it was doing it 32 times .. changed it to 2 as it was spinning for
long time before going to  sleep. As we always give the tasks in batches
we can reduce the spin time.

src/lottie/lottieanimation.cpp
src/vector/vraster.cpp

index ce40d4a..2b1938c 100644 (file)
@@ -149,7 +149,7 @@ class RenderTaskScheduler {
         while (true) {
             bool             success = false;
             SharedRenderTask task;
-            for (unsigned n = 0; n != _count * 32; ++n) {
+            for (unsigned n = 0; n != _count * 2; ++n) {
                 if (_q[(i + n) % _count].try_pop(task)) {
                     success = true;
                     break;
index fb340db..22fc331 100644 (file)
@@ -437,7 +437,7 @@ class RleTaskScheduler {
         while (true) {
             bool success = false;
 
-            for (unsigned n = 0; n != _count * 32; ++n) {
+            for (unsigned n = 0; n != _count * 2; ++n) {
                 if (_q[(i + n) % _count].try_pop(task)) {
                     success = true;
                     break;