Skip to content

Instantly share code, notes, and snippets.

@tpendragon
Last active February 29, 2016 16:41
Show Gist options
  • Save tpendragon/cf6d228f55d8ab0d0dd3 to your computer and use it in GitHub Desktop.
Save tpendragon/cf6d228f55d8ab0d0dd3 to your computer and use it in GitHub Desktop.
# Same 6021 Triples
# JSON-LD (I don't have a TTL parser...)
iex(34)> Benchwarmer.benchmark(fn -> Client.get(%ExFedora.Client{url: "http://localhost:8984/rest"}, "4e/38/da/ba/4e38daba-a6b9-4ffb-a138-52041782f2cb") end)
*** #Function<20.54118792/0 in :erl_eval.expr/5> ***
4.3 sec 1 iterations 4351705.0 μs/op
[%Benchwarmer.Results{args: [], duration: 4351705,
function: #Function<20.54118792/0 in :erl_eval.expr/5>, n: 1, prev_n: 1}]
# 4.3 seconds
# Size
iex(38)> RDF.Graph.size(elem(Client.get(client, "4e/38/da/ba/4e38daba-a6b9-4ffb-a138-52041782f2cb"),1).statements)
6021
# 6021 triples in Fedora.
# TTL
irb(main):035:0> Benchmark.measure { RDF::Graph.load("http://localhost:8984/rest/4e/38/da/ba/4e38daba-a6b9-4ffb-a138-52041782f2cb") }
=> #<Benchmark::Tms:0x007fc45b5e2118 @label="", @real=8.995391436001228, @cstime=0.0, @cutime=0.0, @stime=0.0, @utime=6.149999999999999, @total=6.149999999999999>
# 9 seconds
# N-Triples
irb(main):038:0* Benchmark.measure { RDF::Graph.load("http://localhost:8984/rest/4e/38/da/ba/4e38daba-a6b9-4ffb-a138-52041782f2cb", headers: {"Accept" => "application/n-triples"}) }
=> #<Benchmark::Tms:0x007fc45d534d18 @label="", @real=8.955861381997238, @cstime=0.0, @cutime=0.0, @stime=0.010000000000000009, @utime=6.150000000000006, @total=6.1600000000000055>
# JSON-LD
irb(main):036:0> Benchmark.measure { RDF::Graph.load("http://localhost:8984/rest/4e/38/da/ba/4e38daba-a6b9-4ffb-a138-52041782f2cb", headers: {"Accept" => "application/ld+json"}) }
=> #<Benchmark::Tms:0x007fc45adf0b58 @label="", @real=33.457678561993816, @cstime=0.0, @cutime=0.0, @stime=0.03999999999999998, @utime=29.0, @total=29.04>
# 33.4 seconds. This seems nuts, there has to be something else going on here that I just don't know about.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment