Skip to content

Commit f7b0952

Browse files
committed
Add nicholas' benchmark.
1 parent d1a55df commit f7b0952

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ group :development, :test do
2020
gem 'simplecov', require: false, platform: :mri
2121
gem 'coveralls', require: false, platform: :mri
2222
gem 'psych', platforms: [:mri, :rbx]
23+
gem 'benchmark-ips'
2324
end
2425

2526
group :debug do
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
require "bundler/setup"
3+
require 'json/ld'
4+
require 'benchmark/ips'
5+
6+
source = JSON.parse %({
7+
"@context": "http://schema.org/",
8+
"@type": "SoftwareApplication",
9+
"name": "EtherSia",
10+
"description": "IPv6 library for the ENC28J60 Ethernet controller",
11+
"url": "https://github.com/njh/EtherSia",
12+
"author": {
13+
"@type": "Person",
14+
"name": "Nicholas Humfrey <njh@aelius.com>"
15+
},
16+
"applicationCategory": "Communication",
17+
"operatingSystem": "Arduino",
18+
"downloadUrl": "http://downloads.arduino.cc/libraries/njh/EtherSia-1.0.0.zip",
19+
"softwareVersion": "1.0.0",
20+
"fileSize": 77
21+
})
22+
23+
24+
Benchmark.ips do |x|
25+
x.config(time: 10, warmup: 1)
26+
x.report('toRdf') {JSON::LD::API.toRdf(source)}
27+
end

0 commit comments

Comments
 (0)