[haiku-bugs] Re: [Haiku] #1074: Identify and fix performance bottlenecks in our app_server

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Fri, 03 Jul 2020 18:14:56 -0000

#1074: Identify and fix performance bottlenecks in our app_server
---------------------------------+----------------------
  Reporter:  axeld               |      Owner:  jua
      Type:  enhancement         |     Status:  assigned
  Priority:  normal              |  Milestone:  R1
 Component:  Servers/app_server  |    Version:
Resolution:                      |   Keywords:
Blocked By:                      |   Blocking:
  Platform:  All                 |
---------------------------------+----------------------
Comment (by X512):

 Replying to [comment:27 waddlesplash]:

Can you use {{{profile -f}}} to get the full call stacks? This should
 then show what is calling system_time so often, as well as other things
 that a profile without -f often misses.

 {{{
 profiling results for thread "w:1250:TestApp" (1253):
   tick interval:  1000 us
   total ticks:    43459 (43459000 us)
   unknown ticks:  0 (0 us,   0.00%)
   dropped ticks:  0 (0 us,   0.00%)
   samples/tick:   10.4

         hits     unknown    image
 ------------------------------------------------------------------------------
         8832           0        1 kernel_x86_64
        43459           0     3078 /boot/system/servers/app_server
        16303           0     3080 /boot/system/lib/libbe.so
         2350           0     3100 /boot/system/lib/libstdc++.so.6.0.25
        43459           0     3101 /boot/system/lib/libroot.so
        60161           0       51 commpage

         hits       in us    in %   image  function
 ------------------------------------------------------------------------------
        43459    43459000  100.00    3078
 MessageLooper::_message_thread(void*)
        43459    43459000  100.00    3101  thread_entry
        43244    43244000   99.51    3078  ServerWindow::_MessageLooper()
        35525    35525000   81.74    3078
 ServerWindow::_DispatchMessage(int, BPrivate::LinkReceiver&)
        19138    19138000   44.04    3078
 Window::BeginUpdate(BPrivate::PortLink&)
        13539    13539000   31.15    3078
 ServerWindow::_DispatchViewMessage(int, BPrivate::LinkReceiver&)
        11922    11922000   27.43    3078
 ServerWindow::_DispatchViewDrawingMessage(int, BPrivate::LinkReceiver&)
        11447    11447000   26.34    3101  system_time
        10172    10172000   23.41    3078  BRect
 Painter::_StrokePath<agg::path_base<agg::vertex_block_storage<double, 8u,
 256u> > >(agg::path_base<agg::vertex_block_storage<double, 8u, 256u> >&,
 cap_mode) const
         8949     8949000   20.59    3078  BRect
 
Painter::_RasterizePath<agg::conv_stroke<agg::path_base<agg::vertex_block_storage<double,
 8u, 256u> >, agg::null_markers>
(agg::conv_stroke<agg::path_base<agg::vertex_block_storage<double, 8u,
 256u> >, agg::null_markers>&) const
         8825     8825000   20.31       1  x86_64_syscall_entry
         6373     6373000   14.66    3080
 BPrivate::LinkReceiver::GetNextMessage(int&, long)
         5800     5800000   13.35    3078
 agg::conv_adaptor_vcgen<agg::path_base<agg::vertex_block_storage<double,
 8u, 256u> >, agg::vcgen_stroke, agg::null_markers>::vertex(double*,
 double*)
         5779     5779000   13.30    3078  DrawingEngine::StrokeLine(BPoint
 const&, BPoint const&)
         5638     5638000   12.97    3078  Painter::StrokeLine(BPoint,
 BPoint)
         5077     5077000   11.68    3078  DrawingEngine::StrokeRect(BRect)
         4931     4931000   11.35    3078  Painter::StrokeRect(BRect
 const&) const
         4197     4197000    9.66    3080
 BPrivate::LinkReceiver::ReadFromPort(long)
         4140     4140000    9.53    3101  _kern_port_buffer_size_etc
         3724     3724000    8.57       1  _user_port_buffer_size_etc
         3712     3712000    8.54       1  _get_port_message_info_etc
         3395     3395000    7.81    3080
 agg::vcgen_stroke::vertex(double*, double*)
         2740     2740000    6.30    3101  malloc
         2523     2523000    5.81       1
 ConditionVariableEntry::Wait(unsigned int, long)
         2191     2191000    5.04    3101  _kern_write_port_etc
         2171     2171000    5.00    3100  operator new(unsigned long)
         2089     2089000    4.81    3101
 BPrivate::threadHeap::malloc(unsigned long)
         2087     2087000    4.80    3101  _kern_read_port_etc
         1997     1997000    4.60       1  _user_write_port_etc
         1931     1931000    4.44       1  writev_port_etc
         1867     1867000    4.30    3101  free
         1829     1829000    4.21       1  _user_read_port_etc
         1792     1792000    4.12       1  read_port_etc
         1771     1771000    4.08       1  ConditionVariable::_Notify(bool,
 int)
         1703     1703000    3.92    3080
 agg::vcgen_stroke::add_vertex(double, double, unsigned int)
         1623     1623000    3.73    3078  Window::_SendUpdateMessage()
         1584     1584000    3.64    3080
 agg::vertex_sequence<agg::vertex_dist, 6u>::add(agg::vertex_dist const&)
         1390     1390000    3.20    3080  BRegion::IntersectWith(BRegion
 const*)
         1318     1318000    3.03       1  _mutex_unlock
         1309     1309000    3.01    3078  void
 
agg::rasterizer_sl_clip<agg::ras_conv_int>::line_to<agg::rasterizer_cells_aa<agg::cell_aa>
(agg::rasterizer_cells_aa<agg::cell_aa>&, int, int)
         1294     1294000    2.98    3078
 ServerWindow::SendMessageToClient(BMessage const*, int) const
         1219     1219000    2.80    3101
 BPrivate::hoardHeap::findAvailableSuperblock(int, BPrivate::block*&,
 BPrivate::processHeap*)
         1193     1193000    2.75    3080
 agg::math_stroke<agg::pod_bvector<agg::point_base<double>, 6u>
::calc_miter(agg::pod_bvector<agg::point_base<double>, 6u>&,
 agg::vertex_dist const&, agg::vertex_dist const&, agg::vertex_dist const&,
 double, double, double, double, agg::line_join_e, double)
         1177     1177000    2.71    3078
 agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip<agg::ras_conv_int>
::add_vertex(double, double, unsigned int)
         1131     1131000    2.60    3101
 BPrivate::processHeap::free(void*)
          995      995000    2.29    3080
 BPrivate::LinkReceiver::HasMessages() const
          965      965000    2.22       1  get_locked_port(int)
          962      962000    2.21    3078  void
 
agg::render_scanlines<agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip<agg::ras_conv_int>
, agg::scanline_p8,
 agg::renderer_scanline_aa_solid<agg::renderer_region<PixelFormat> >
(agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip<agg::ras_conv_int>
&, agg::scanline_p8&,
 agg::renderer_scanline_aa_solid<agg::renderer_region<PixelFormat> >&)
          947      947000    2.18    3078
 agg::rasterizer_cells_aa<agg::cell_aa>::line(int, int, int, int)
          942      942000    2.17    3101  _kern_port_count
          918      918000    2.11    3080
 agg::math_stroke<agg::pod_bvector<agg::point_base<double>, 6u>
::calc_cap(agg::pod_bvector<agg::point_base<double>, 6u>&,
 agg::vertex_dist const&, agg::vertex_dist const&, double)
          895      895000    2.06    3101  __mutex_lock
          828      828000    1.91    3080
 agg::pod_bvector<agg::point_base<double>, 6u>::allocate_block(unsigned
 int)
          755      755000    1.74       1  _mutex_lock
          755      755000    1.74    3080  BRegion::_SetSize(int)
          749      749000    1.72    3101  __mutex_unlock
          714      714000    1.64    3078  Window::EndUpdate()
          640      640000    1.47    3078  Window::InvalidateView(View*,
 BRegion&)
          535      535000    1.23    3101
 BPrivate::hoardHeap::freeBlock(BPrivate::block*&, BPrivate::superblock*&,
 int, BPrivate::processHeap*)
          501      501000    1.15    3080
 agg::math_stroke<agg::pod_bvector<agg::point_base<double>, 6u>
::calc_join(agg::pod_bvector<agg::point_base<double>, 6u>&,
 agg::vertex_dist const&, agg::vertex_dist const&, agg::vertex_dist const&,
 double, double)
          496      496000    1.14    3080
 BRegion::_AdoptRegionData(BRegion&)
          462      462000    1.06    3078  Window::VisibleContentRegion()
          452      452000    1.04    3078
 ServerWindow::_UpdateCurrentDrawingRegion()
          435      435000    1.00    3078
 HWInterface::InvalidateRegion(BRegion&)
 ...
 }}}
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/1074#comment:28>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: