- ruby: 31,817 (69.84%)
- x86-mswin32: 13,740 (30.16%)
- ruby: 8,547 (53.46%)
- x86-mswin32: 4,616 (28.87%)
- java: 2,826 (17.67%)
#! /usr/bin/env ruby | |
# related to https://groups.google.com/g/nokogiri-talk/c/XoKIzgbcBpU/m/9o3tbD6WCQAJ | |
require "nokogiri" | |
html = <<~EOF | |
<html> | |
<body> | |
<div>123 Fake St.<br>City, State 65432</div> |
ok.xml | |
fail.xml | |
run-me.o | |
run-me |
#! /usr/bin/env ruby | |
require 'nokogiri' | |
input = <<EOF | |
<title> The journey </title> | |
</head> | |
<body> | |
<h1> The <index class = "estimate"> Trip </index> </h1> | |
<p> Our scavenger hunt consists of several stages, starting with the <index class = "treasure"> crossing </index> & mdash; how do we actually get to those islands. The nice thing about an intellectual quest is that we can be in all kinds of places at the same time. If we ever want to revisit a previous episode, all we have to do is click there, and even though we haven't finished a particular stage yet, we can already look ahead to the next. We can also keep in touch with fellow travelers who are in completely different places in the world of thought. |
#! /usr/bin/env ruby | |
require "nokogiri" | |
xml = <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<kml xmlns="http://www.opengis.net/kml/2.2"> | |
<Document> | |
<name>Document.kml</name> | |
<Placemark> |
foo | |
foo.o | |
*.prof |
FROM ruby:2-alpine3.10 | |
RUN apk add build-base imagemagick6-dev bash | |
WORKDIR /app | |
CFLAGS=$(shell pkg-config libxml-2.0 --cflags) | |
LDFLAGS=$(shell pkg-config libxml-2.0 --libs) | |
foo: foo.o | |
$(CC) -o foo foo.o $(LDFLAGS) | |
foo.o: foo.c | |
$(CC) $(CFLAGS) -c -o foo.o foo.c |
# parsing a document 6731 bytes long | |
Warming up -------------------------------------- | |
nokogiri 488.000 i/100ms | |
rexml 21.000 i/100ms | |
Calculating ------------------------------------- | |
nokogiri 6.150k (±23.4%) i/s - 28.792k in 5.067345s | |
rexml 208.195 (± 5.3%) i/s - 1.050k in 5.056578s | |
Comparison: | |
nokogiri: 6150.3 i/s |
$ sudo apt-get remove libxml2 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
<snip> | |
The following packages will be REMOVED: | |
adobe-flashplugin apturl avahi-daemon avahi-utils banshee baobab bind9-host | |
bluez-gstreamer brasero brasero-cdrkit caribou cinnamon cinnamon-bluetooth | |
cinnamon-control-center cinnamon-screensaver cinnamon-session | |
cinnamon-settings-daemon cmake colord default-jre dnsutils dropbox emacs24 |