Commit a07a307
committed
Use repeating task to update change count service property
On startup SCR will blast change count updates for each
component it satisfies and activates etc.
This resulted in a very large number of task being submitted
to the scheduled executor. Prior to using an executor a Timer
was used. In both cases the tasks would wait a default of 5
seconds before updating the change count service property.
Every task submitted would be a no-op except the very last one
which had the "final" change count value. This behavior is
to avoid flooding the system with service modified events.
The issue is that now we are flooding the scheduled executor
with a significant number of task that most all do nothing.
Since moving to an executor we noticed a non-trivial bump in
our CPU usage when the default 5 seconds passes to run all
the queued tasks.
It turns out that on the JVM we are using the Timer is actually
more efficient than the scheduled executor for popping off
all the tasks and running them when the delay timeout is hit.
The overall design here is sub-optimal regardless. Flooding
a queue with all but one task that do nothing is not efficient.
This change moves to using a simple repeating task that just
updates the change count service property, if needed, every
delay period (defaults to every 5 seconds).1 parent 4d68c01 commit a07a307
1 file changed
Lines changed: 30 additions & 30 deletions
Lines changed: 30 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
710 | | - | |
711 | 709 | | |
712 | 710 | | |
713 | 711 | | |
| |||
718 | 716 | | |
719 | 717 | | |
720 | 718 | | |
721 | | - | |
| 719 | + | |
| 720 | + | |
722 | 721 | | |
723 | 722 | | |
724 | | - | |
725 | | - | |
726 | | - | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
| 729 | + | |
729 | 730 | | |
730 | | - | |
731 | | - | |
732 | | - | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
733 | 738 | | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
753 | 747 | | |
754 | | - | |
| 748 | + | |
755 | 749 | | |
756 | 750 | | |
757 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
758 | 758 | | |
759 | 759 | | |
0 commit comments