<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>214866</bug_id>
          
          <creation_ts>2020-07-28 01:53:11 -0700</creation_ts>
          <short_desc>Profiler resolution is too low</short_desc>
          <delta_ts>2021-03-13 23:57:44 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>Safari 13</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Radek Pietruszewski">radexpl</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1675550</commentid>
    <comment_count>0</comment_count>
    <who name="Radek Pietruszewski">radexpl</who>
    <bug_when>2020-07-28 01:53:11 -0700</bug_when>
    <thetext>Hi. It appears that the Safari/webkit web inspector profiler samples stack traces approximately every 1ms. This is slow, and not suitable for many profiling tasks, since I&apos;m only going to get a handful of samples when trying to hit 60fps, or react to an event in 50ms. By comparison, it appears that Chrome&apos;s Timeline profiler samples stacks every 100us.

Is there a technical reason why WebKit&apos;s profiler can&apos;t go up to 10kHz? If there&apos;s a tradeoff (slow processing, significantly degraded performance), can this be made configurable?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1675858</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-07-28 16:59:24 -0700</bug_when>
    <thetext>&lt;rdar://problem/66245375&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1675875</commentid>
    <comment_count>2</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-07-28 18:23:52 -0700</bug_when>
    <thetext>(In reply to radexpl from comment #0)
&gt; Hi. It appears that the Safari/webkit web inspector profiler samples stack
&gt; traces approximately every 1ms. This is slow, and not suitable for many
&gt; profiling tasks, since I&apos;m only going to get a handful of samples when
&gt; trying to hit 60fps, or react to an event in 50ms. By comparison, it appears
&gt; that Chrome&apos;s Timeline profiler samples stacks every 100us.
&gt; 
&gt; Is there a technical reason why WebKit&apos;s profiler can&apos;t go up to 10kHz? If
&gt; there&apos;s a tradeoff (slow processing, significantly degraded performance),
&gt; can this be made configurable?

Last time I measured this it did negatively impact performance of the script being run, and we were trying to find a balance where we didn&apos;t introduce so much perturbation that the samples you got were unrepresentative.

I also remember it being difficult to be woken up reliably in 100us.

However, this was a long time ago. We should check again the impact of increasing the resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1739209</commentid>
    <comment_count>3</comment_count>
    <who name="Radek Pietruszewski">radexpl</who>
    <bug_when>2021-03-13 23:57:44 -0800</bug_when>
    <thetext>Hi Saam! I wanted to bump this thread and ask again whether it&apos;s possible to increase WebKit&apos;s profiler resolution -- or at least make it a configurable option.

I&apos;ve just upgraded my Mac to an M1 machine, which exacerbates the issue even more -- the faster a dev machine is, the fewer samples for analysis I get.

BTW: I&apos;m not very familiar with the ins and outs of sampling profiling, but I do wonder if instead of being a hardcoded timer, the profiler sampler rate shouldn&apos;t be calculated/estimated off of CPU&apos;s speed - so that a program would get roughly the same number of samples regardless of how fast a machine is.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>