This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ armature git:(master) ✗ crystal run --release bench/code_component.cr | |
<div class="users"><h2>Fox Mulder message</h2><p id="user-Fox Mulder"><span class="title">they:</span><span class="message">nested hello Fox Mulder</span></p></div><div class="users"><h2>Fox Mulder message</h2><p id="user-Fox Mulder"><span class="title">they:</span><span class="message">nested hello Fox Mulder</span></p></div><div class="users"><h2>Fox Mulder message</h2><p id="user-Fox Mulder"><span class="title">they:</span><span class="message">nested hello Fox Mulder</span></p></div> | |
name 929.18k ( 1.08µs) (± 0.87%) 96.0B/op fastest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ armature git:(master) ✗ crystal run --release bench_code_component.cr | |
name 815.75k ( 1.23µs) (± 5.66%) 336B/op fastest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ Code crystal run --release bench_tuple_vs_array_for_pattern_matching.cr | |
true | |
array 27.17k ( 36.80µs) (± 1.58%) 156kB/op 96.02× slower | |
tuple 2.61M (383.32ns) (± 0.85%) 0.0B/op fastest | |
[true] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "post-example" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
rocket = { version = "*", features = ["json"] } | |
uuid = { version = "0.8", features = ["v4", "serde"] } | |
chrono = "0.4" | |
redis = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
%w(lib shared).each do |dir| | |
$LOAD_PATH.unshift(__dir__) unless $LOAD_PATH.include?(__dir__) | |
end | |
Gem::Specification.new do |spec| | |
spec.name = "rack-request_stats" | |
spec.version = "0.1.0" | |
spec.authors = ["Jamie Gaskins"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "active_support/executor" | |
require "active_record" | |
require "pg" | |
ActiveRecord::Base.establish_connection( | |
uri: "postgres:///", | |
adapter: :postgresql, | |
pool: 5, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v bench_redis.rb | |
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23] | |
KEY : bench-redis | |
VALUE SIZE: 102400 | |
ITERATIONS: 10000 | |
GET | |
Rehearsal ------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 AS redisjson | |
RUN apt-get update | |
RUN apt-get upgrade -y git | |
RUN apt-get install -y curl gcc | |
RUN apt-get install -y libclang-dev | |
WORKDIR / | |
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o install-rust.sh && sh ./install-rust.sh -y | |
RUN git clone https://github.com/RedisJSON/RedisJSON.git --branch v2.4.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Install nginx ingress controller | |
# NOTE: This uses DigitalOcean. If you use another Kubernetes provider, | |
# substitute the appropriate command from here: https://kubernetes.github.io/ingress-nginx/deploy/#cloud-deployments | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.5.1/deploy/static/provider/do/deploy.yaml | |
# FOR DIGITALOCEAN DEPLOYMENTS: | |
export LB_HOSTNAME=example.com # Make this the DNS name that will point to your LB | |
export LB_NAME=my-lb # Give this a useful name to identify it on the DigitalOcean control panel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Fill out these two | |
export LB_HOSTNAME=example.com | |
export LB_NAME=my-lb | |
echo '{"metadata":{"annotations":{"service.beta.kubernetes.io/do-loadbalancer-hostname":"$LB_HOSTNAME","service.beta.kubernetes.io/do-loadbalancer-name":"$LB_NAME"}}}' | | |
envsubst | | |
awk "{ print \"'\" \$1 \"'\" }" | | |
xargs kubectl patch svc -n ingress-nginx ingress-nginx-controller -p |
NewerOlder