Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file listing output to vernier view #112

Merged
merged 10 commits into from
Dec 14, 2024
Merged

Add file listing output to vernier view #112

merged 10 commits into from
Dec 14, 2024

Conversation

jhawthorn
Copy link
Owner

@jhawthorn jhawthorn commented Dec 5, 2024

================================================================================
examples/gvl_sleep.rb
--------------------------------------------------------------------------------
 TOTAL |  SELF  | LINE SOURCE
       |        |    1  # Different (bad) ways to sleep
       |        |    2  
  0.0% |   0.0% |    3  require 'bundler/inline'
       |        |    4  
  1.1% |   0.0% |    5  gemfile do
  0.1% |   0.0% |    6    source 'https://rubygems.org'
       |        |    7  
       |        |    8    gem "gvltest"
       |        |    9  end
       |        |   10  
       |        |   11  def cfunc_sleep_gvl
 24.8% |   0.0% |   12    GVLTest.sleep_holding_gvl(1)
       |        |   13  end
       |        |   14  
       |        |   15  def cfunc_sleep_idle
 24.7% |   0.0% |   16    GVLTest.sleep_without_gvl(1)
       |        |   17  end
       |        |   18  
       |        |   19  def ruby_sleep_gvl
       |        |   20    target = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) + 1000
  0.2% |   0.0% |   21    while Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) < target
       |        |   22      i = 0
 11.4% |  11.4% |   23      while i < 1000
 13.0% |  13.0% |   24        i += 1
       |        |   25      end
       |        |   26    end
       |        |   27  end
       |        |   28  
       |        |   29  def sleep_idle
 24.7% |   0.0% |   30    sleep 1
       |        |   31  end
       |        |   32  
       |        |   33  def run(name)
       |        |   34    STDOUT.print "#{name}..."
       |        |   35    STDOUT.flush
       |        |   36  
       |        |   37    before = Process.clock_gettime(Process::CLOCK_MONOTONIC)
 98.8% |   0.0% |   38    send(name)
       |        |   39    after = Process.clock_gettime(Process::CLOCK_MONOTONIC)
       |        |   40  
       |        |   41    STDOUT.puts " %.2fs" % (after - before)
       |        |   42  end
       |        |   43  
 24.8% |   0.0% |   44  run(:cfunc_sleep_gvl)
 24.7% |   0.0% |   45  run(:cfunc_sleep_idle)
 24.6% |   0.0% |   46  run(:ruby_sleep_gvl)
 24.7% |   0.0% |   47  run(:sleep_idle)
================================================================================

@jhawthorn jhawthorn changed the title WIP: lineprof style output lineprof style output Dec 14, 2024
@jhawthorn jhawthorn marked this pull request as ready for review December 14, 2024 04:58
@jhawthorn jhawthorn changed the title lineprof style output Add file listing output to vernier view Dec 14, 2024
@jhawthorn jhawthorn merged commit d85adc5 into main Dec 14, 2024
11 checks passed
@jhawthorn jhawthorn deleted the lineprof branch December 14, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant