mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 19:30:47 -07:00
profiling script
This commit is contained in:
@@ -26,3 +26,7 @@ group :test do
|
|||||||
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'main'
|
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'main'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
gem "vernier", "~> 1.0"
|
||||||
|
|
||||||
|
gem "debug", "~> 1.9"
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ GEM
|
|||||||
specs:
|
specs:
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
benchmark-ips (2.13.0)
|
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)
|
json (2.7.2)
|
||||||
language_server-protocol (3.17.0.3)
|
language_server-protocol (3.17.0.3)
|
||||||
memory_profiler (1.0.1)
|
memory_profiler (1.0.1)
|
||||||
@@ -24,10 +31,16 @@ GEM
|
|||||||
parser (3.3.0.5)
|
parser (3.3.0.5)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
|
psych (5.1.2)
|
||||||
|
stringio
|
||||||
racc (1.7.3)
|
racc (1.7.3)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.2.1)
|
rake (13.2.1)
|
||||||
|
rdoc (6.7.0)
|
||||||
|
psych (>= 4.0.0)
|
||||||
regexp_parser (2.9.0)
|
regexp_parser (2.9.0)
|
||||||
|
reline (0.5.8)
|
||||||
|
io-console (~> 0.5)
|
||||||
rexml (3.2.6)
|
rexml (3.2.6)
|
||||||
rubocop (1.61.0)
|
rubocop (1.61.0)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
@@ -49,15 +62,18 @@ GEM
|
|||||||
rubocop (~> 1.44)
|
rubocop (~> 1.44)
|
||||||
ruby-progressbar (1.13.0)
|
ruby-progressbar (1.13.0)
|
||||||
stackprof (0.2.26)
|
stackprof (0.2.26)
|
||||||
|
stringio (3.1.0)
|
||||||
terminal-table (3.0.2)
|
terminal-table (3.0.2)
|
||||||
unicode-display_width (>= 1.1.1, < 3)
|
unicode-display_width (>= 1.1.1, < 3)
|
||||||
unicode-display_width (2.5.0)
|
unicode-display_width (2.5.0)
|
||||||
|
vernier (1.0.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
benchmark-ips
|
benchmark-ips
|
||||||
|
debug (~> 1.9)
|
||||||
liquid!
|
liquid!
|
||||||
liquid-c!
|
liquid-c!
|
||||||
memory_profiler
|
memory_profiler
|
||||||
@@ -68,6 +84,7 @@ DEPENDENCIES
|
|||||||
rubocop-shopify (~> 2.12.0)
|
rubocop-shopify (~> 2.12.0)
|
||||||
stackprof
|
stackprof
|
||||||
terminal-table
|
terminal-table
|
||||||
|
vernier (~> 1.0)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.5.7
|
2.5.7
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ optparse = OptionParser.new do |opts|
|
|||||||
opts.on("--db [DB]", "use the provided db file instead of the default") do |db|
|
opts.on("--db [DB]", "use the provided db file instead of the default") do |db|
|
||||||
options[:db] = db
|
options[:db] = db
|
||||||
end
|
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
|
options[:n_runs] = n.to_i
|
||||||
end
|
end
|
||||||
opts.on("--skip-samply-run", "skip running samply") do
|
opts.on("--skip-samply-run", "skip running samply") do
|
||||||
@@ -55,8 +55,6 @@ if options[:samply_run] && !options[:vernier]
|
|||||||
"record",
|
"record",
|
||||||
"--output",
|
"--output",
|
||||||
samply_output,
|
samply_output,
|
||||||
"bundle",
|
|
||||||
"exec",
|
|
||||||
"ruby",
|
"ruby",
|
||||||
"--yjit",
|
"--yjit",
|
||||||
"--yjit-perf",
|
"--yjit-perf",
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ module Liquid
|
|||||||
self.cache_classes = true
|
self.cache_classes = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require "debug"
|
||||||
require "liquid/version"
|
require "liquid/version"
|
||||||
require 'liquid/parse_tree_visitor'
|
require 'liquid/parse_tree_visitor'
|
||||||
require 'liquid/lexer'
|
require 'liquid/lexer'
|
||||||
|
|||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user