Sha256: 30292267e515d8c4cadca494da9003c9f2b023346a6907c2ba0fed11b78b0f2a
Contents?: true
Size: 611 Bytes
Versions: 23
Compression:
Stored size: 611 Bytes
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require "bundler/inline" gemfile do source "https://rubygems.org" gem "stackprof" end $:.unshift(File.expand_path("../lib", __dir__)) require "syntax_tree" GC.disable StackProf.run(mode: :cpu, out: "tmp/profile.dump", raw: true) do filepath = File.expand_path("../lib/syntax_tree/node.rb", __dir__) SyntaxTree.format(File.read(filepath)) end GC.enable File.open("tmp/flamegraph.html", "w") do |file| report = Marshal.load(IO.binread("tmp/profile.dump")) StackProf::Report.new(report).print_d3_flamegraph(file) end `open tmp/flamegraph.html`
Version data entries
23 entries across 23 versions & 1 rubygems