Sha256: a757b863f335bfb3b6bba1ecc5616d8128b755fb45334d3c00169a9216e4d0ac

Contents?: true

Size: 674 Bytes

Versions: 17

Compression:

Stored size: 674 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "stackprof"
  gem "prettier_print"
end

$:.unshift(File.expand_path("../lib", __dir__))
require "syntax_tree"

StackProf.run(mode: :cpu, out: "tmp/profile.dump", raw: true) do
  Dir[File.join(RbConfig::CONFIG["libdir"], "**/*.rb")].each do |filepath|
    SyntaxTree.format(SyntaxTree.read(filepath))
  end
end

File.open("tmp/flamegraph.html", "w") do |file|
  report = Marshal.load(IO.binread("tmp/profile.dump"))
  StackProf::Report.new(report).print_text
  StackProf::Report.new(report).print_d3_flamegraph(file)
end

`open tmp/flamegraph.html`

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
syntax_tree-6.2.0 bin/profile
syntax_tree-6.1.1 bin/profile
syntax_tree-6.1.0 bin/profile
syntax_tree-6.0.2 bin/profile
syntax_tree-6.0.1 bin/profile
syntax_tree-6.0.0 bin/profile
syntax_tree-5.3.0 bin/profile
syntax_tree-5.2.0 bin/profile
syntax_tree-5.1.0 bin/profile
syntax_tree-5.0.1 bin/profile
syntax_tree-5.0.0 bin/profile
syntax_tree-4.3.0 bin/profile
syntax_tree-4.2.0 bin/profile
syntax_tree-4.1.0 bin/profile
syntax_tree-4.0.2 bin/profile
syntax_tree-4.0.1 bin/profile
syntax_tree-4.0.0 bin/profile