profiling script

This commit is contained in:
Marco Concetto Rudilosso
2024-06-10 14:28:53 +02:00
parent f86da4a8d7
commit 9230471e73
5 changed files with 57 additions and 3 deletions
+4
View File
@@ -26,3 +26,7 @@ group :test do
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'main'
end
end
gem "vernier", "~> 1.0"
gem "debug", "~> 1.9"
+17
View File
@@ -16,6 +16,13 @@ GEM
specs:
ast (2.4.2)
benchmark-ips (2.13.0)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
io-console (0.7.2)
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
language_server-protocol (3.17.0.3)
memory_profiler (1.0.1)
@@ -24,10 +31,16 @@ GEM
parser (3.3.0.5)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
racc (1.7.3)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.8)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.61.0)
json (~> 2.3)
@@ -49,15 +62,18 @@ GEM
rubocop (~> 1.44)
ruby-progressbar (1.13.0)
stackprof (0.2.26)
stringio (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
vernier (1.0.1)
PLATFORMS
ruby
DEPENDENCIES
benchmark-ips
debug (~> 1.9)
liquid!
liquid-c!
memory_profiler
@@ -68,6 +84,7 @@ DEPENDENCIES
rubocop-shopify (~> 2.12.0)
stackprof
terminal-table
vernier (~> 1.0)
BUNDLED WITH
2.5.7
+1 -3
View File
@@ -29,7 +29,7 @@ optparse = OptionParser.new do |opts|
opts.on("--db [DB]", "use the provided db file instead of the default") do |db|
options[:db] = db
end
opts.on("--n-runs [N]", "number of runs") do |n|
opts.on("-n [N]", "number of runs") do |n|
options[:n_runs] = n.to_i
end
opts.on("--skip-samply-run", "skip running samply") do
@@ -55,8 +55,6 @@ if options[:samply_run] && !options[:vernier]
"record",
"--output",
samply_output,
"bundle",
"exec",
"ruby",
"--yjit",
"--yjit-perf",
+1
View File
@@ -49,6 +49,7 @@ module Liquid
self.cache_classes = true
end
require "debug"
require "liquid/version"
require 'liquid/parse_tree_visitor'
require 'liquid/lexer'
+34
View File
@@ -0,0 +1,34 @@
<div id="product-left">
{% for image in product.images %}<div id="product-image">
<a href="{{ image | product_img_url: 'large' }}" rel="lightbox[images]" title="{{ product.title | escape }}"><img src="{{ image | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /></a>
</div>
{% endfor %}
</div>
<div id="product-right">
<h1>{{ product.title }}</h1>
{{ product.description }}
{% if product.available %}
<form action="/cart/add" method="post">
<div id="product-variants">
<div id="price-field"></div>
<select id="product-select" name='id'>
{% for variant in product.variants %}
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
{% endfor %}
</select>
</div>
<input type="image" src="purchase.png" name="add" value="Purchase" id="purchase" />
</form>
{% else %}
<p class="bold-red">This product is temporarily unavailable</p>
{% endif %}
<div id="product-details">
<strong>Continue Shopping</strong><br />
Browse more {{ product.type }} or additional {{ product.vendor }} products.
</div>
</div>