Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on October 3, 2018 at 08:43 AM

New Paste 1 (Text)

# class_vs_struct.cr
require "benchmark"
require "json"

TEXT = %({"muffin": false, "test": "Random string!", "user_id" : 1234})

Benchmark.ips do |x|
  x.report("json parse") {
    json = JSON.parse(TEXT).as_h
    if json["muffin"]?
    end
  }
  x.report("from json") {
    json = Hash(String, Bool | String | Int32).from_json(TEXT)
    if json["muffin"]?
    end
  }
end