mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2024-04-21 12:31:36 +00:00
Compare commits
40
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
040cf98281 | ||
|
|
12a8512778 | ||
|
|
10e92b83fb | ||
|
|
875035bc14 | ||
|
|
1e5417b3db | ||
|
|
330b1c8132 | ||
|
|
41a4211e59 | ||
|
|
087eeef3f2 | ||
|
|
d9e4d610c0 | ||
|
|
a3fdc62e31 | ||
|
|
cf82003f7e | ||
|
|
308a3c0fda | ||
|
|
e7f5b65573 | ||
|
|
d571e76106 | ||
|
|
21918f0808 | ||
|
|
8e708aac7d | ||
|
|
6bab89f9f6 | ||
|
|
6938944908 | ||
|
|
28cf4a77e1 | ||
|
|
2c6687f6d3 | ||
|
|
bc0c11b086 | ||
|
|
c44713447d | ||
|
|
48358040e1 | ||
|
|
5329018c6a | ||
|
|
8c07896774 | ||
|
|
a6cc89ff58 | ||
|
|
076667ebf2 | ||
|
|
48de68c2b7 | ||
|
|
e273eed13e | ||
|
|
d247f5b79a | ||
|
|
aa0519aedd | ||
|
|
f065786d41 | ||
|
|
e8c0a63721 | ||
|
|
263b827b20 | ||
|
|
2d2b626f0d | ||
|
|
8a4ef5dbdd | ||
|
|
948b88c36f | ||
|
|
27b24066a6 | ||
|
|
485b1f5575 | ||
|
|
0d8bcaa448 |
@@ -2,3 +2,6 @@
|
||||
.DS_Store
|
||||
*.swp
|
||||
#*.*#
|
||||
tags
|
||||
goquery.test
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
language: go
|
||||
|
||||
go:
|
||||
- 1.1
|
||||
- 1.2
|
||||
- tip
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2012, Martin Angers & Contributors
|
||||
Copyright (c) 2012-2014, Martin Angers & Contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# goquery - a little like that j-thing, only in Go
|
||||
|
||||
GoQuery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on the experimental html package and the CSS Selector library [cascadia][]. Since the experimental html parser returns tokens (nodes), and not a full-featured DOM object, jQuery's manipulation and modification functions have been left off (no point in modifying data in the parsed tree of the HTML, it has no effect).
|
||||
[](http://travis-ci.org/PuerkitoBio/goquery)
|
||||
|
||||
[](http://godoc.org/github.com/PuerkitoBio/goquery)
|
||||
|
||||
GoQuery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns tokens (nodes), and not a full-featured DOM object, jQuery's manipulation and modification functions have been left off (no point in modifying data in the parsed tree of the HTML, it has no effect).
|
||||
|
||||
Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML.
|
||||
|
||||
Supported functions are query-oriented features (`hasClass()`, `attr()` and the likes), as well as traversing functions that make sense given what we have to work with. This makes GoQuery a great library for scraping web pages.
|
||||
|
||||
@@ -8,6 +14,8 @@ Syntax-wise, it is as close as possible to jQuery, with the same function names
|
||||
|
||||
## Installation
|
||||
|
||||
Please note that because of the net/html dependency, goquery requires Go1.1+.
|
||||
|
||||
$ go get github.com/PuerkitoBio/goquery
|
||||
|
||||
(optional) To run unit tests:
|
||||
@@ -15,13 +23,18 @@ Syntax-wise, it is as close as possible to jQuery, with the same function names
|
||||
$ cd $GOPATH/src/github.com/PuerkitoBio/goquery
|
||||
$ go test
|
||||
|
||||
(optional) To run benchmarks:
|
||||
(optional) To run benchmarks (warning: it runs for a few minutes):
|
||||
|
||||
$ cd $GOPATH/src/github.com/PuerkitoBio/goquery
|
||||
$ go test -bench=".*"
|
||||
|
||||
## Changelog
|
||||
|
||||
**Note that goquery's API is now stable, and will not break.**
|
||||
|
||||
* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader.
|
||||
* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response.
|
||||
* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility.
|
||||
* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out).
|
||||
* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method.
|
||||
* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases).
|
||||
@@ -45,49 +58,35 @@ Please note that Cascadia's selectors do NOT necessarily match all supported sel
|
||||
|
||||
## Examples
|
||||
|
||||
Taken from example_test.go:
|
||||
See some tips and tricks in the [wiki][].
|
||||
|
||||
Taken (and adapted as if executed from outside the goquery package) from example_test.go:
|
||||
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
// In real use, this import would be required (not in this example, since it
|
||||
// is part of the goquery package)
|
||||
//"github.com/PuerkitoBio/goquery"
|
||||
"strconv"
|
||||
"log"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
)
|
||||
|
||||
// This example scrapes the 10 reviews shown on the home page of MetalReview.com,
|
||||
// the best metal review site on the web :) (and no, I'm not affiliated to them!)
|
||||
func ExampleScrape_MetalReview() {
|
||||
// Load the HTML document (in real use, the type would be *goquery.Document)
|
||||
var doc *Document
|
||||
var e error
|
||||
|
||||
if doc, e = NewDocument("http://metalreview.com"); e != nil {
|
||||
panic(e.Error())
|
||||
func ExampleScrape() {
|
||||
doc, err := goquery.NewDocument("http://metalsucks.net")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Find the review items (the type of the Selection would be *goquery.Selection)
|
||||
doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
var band, title string
|
||||
var score float64
|
||||
|
||||
// For each item found, get the band, title and score, and print it
|
||||
band = s.Find("strong").Text()
|
||||
title = s.Find("em").Text()
|
||||
if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil {
|
||||
// Not a valid float, ignore score
|
||||
fmt.Printf("Review %d: %s - %s.\n", i, band, title)
|
||||
} else {
|
||||
// Print all, including score
|
||||
fmt.Printf("Review %d: %s - %s (%2.1f).\n", i, band, title, score)
|
||||
}
|
||||
doc.Find(".reviews-wrap article .review-rhs").Each(func(i int, s *goquery.Selection) {
|
||||
band := s.Find("h3").Text()
|
||||
title := s.Find("i").Text()
|
||||
fmt.Printf("Review %d: %s - %s\n", i, band, title)
|
||||
})
|
||||
// To see the output of the Example while running the test suite (go test), simply
|
||||
// remove the leading "x" before Output on the next line. This will cause the
|
||||
// example to fail (all the "real" tests should pass).
|
||||
}
|
||||
|
||||
// xOutput: voluntarily fail the Example output.
|
||||
func main() {
|
||||
ExampleScrape()
|
||||
}
|
||||
```
|
||||
|
||||
@@ -104,3 +103,5 @@ The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia'
|
||||
[doc]: http://godoc.org/github.com/PuerkitoBio/goquery
|
||||
[index]: http://api.jquery.com/index/
|
||||
[gonet]: http://code.google.com/p/go/source/detail?r=f7f5159120f51ba0070774d3c5907969b5fe7858&repo=net
|
||||
[html]: http://godoc.org/code.google.com/p/go.net/html
|
||||
[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks
|
||||
|
||||
@@ -1,85 +1,92 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/html"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// First() reduces the set of matched elements to the first in the set.
|
||||
// It returns a new Selection object.
|
||||
func (this *Selection) First() *Selection {
|
||||
return this.Eq(0)
|
||||
// First reduces the set of matched elements to the first in the set.
|
||||
// It returns a new Selection object, and an empty Selection object if the
|
||||
// the selection is empty.
|
||||
func (s *Selection) First() *Selection {
|
||||
return s.Eq(0)
|
||||
}
|
||||
|
||||
// Last() reduces the set of matched elements to the last in the set.
|
||||
// It returns a new Selection object.
|
||||
func (this *Selection) Last() *Selection {
|
||||
return this.Eq(-1)
|
||||
// Last reduces the set of matched elements to the last in the set.
|
||||
// It returns a new Selection object, and an empty Selection object if
|
||||
// the selection is empty.
|
||||
func (s *Selection) Last() *Selection {
|
||||
return s.Eq(-1)
|
||||
}
|
||||
|
||||
// Eq() reduces the set of matched elements to the one at the specified index.
|
||||
// Eq reduces the set of matched elements to the one at the specified index.
|
||||
// If a negative index is given, it counts backwards starting at the end of the
|
||||
// set. It returns a new Selection object, and an empty Selection object if the
|
||||
// index is invalid.
|
||||
func (this *Selection) Eq(index int) *Selection {
|
||||
func (s *Selection) Eq(index int) *Selection {
|
||||
if index < 0 {
|
||||
index += len(this.Nodes)
|
||||
index += len(s.Nodes)
|
||||
}
|
||||
return this.Slice(index, index+1)
|
||||
|
||||
if index >= len(s.Nodes) || index < 0 {
|
||||
return newEmptySelection(s.document)
|
||||
}
|
||||
|
||||
return s.Slice(index, index+1)
|
||||
}
|
||||
|
||||
// Slice() reduces the set of matched elements to a subset specified by a range
|
||||
// Slice reduces the set of matched elements to a subset specified by a range
|
||||
// of indices.
|
||||
func (this *Selection) Slice(start int, end int) *Selection {
|
||||
func (s *Selection) Slice(start int, end int) *Selection {
|
||||
if start < 0 {
|
||||
start += len(this.Nodes)
|
||||
start += len(s.Nodes)
|
||||
}
|
||||
if end < 0 {
|
||||
end += len(this.Nodes)
|
||||
end += len(s.Nodes)
|
||||
}
|
||||
return pushStack(this, this.Nodes[start:end])
|
||||
return pushStack(s, s.Nodes[start:end])
|
||||
}
|
||||
|
||||
// Get() retrieves the underlying node at the specified index.
|
||||
// Get() without parameter is not implemented, since the node array is available
|
||||
// Get retrieves the underlying node at the specified index.
|
||||
// Get without parameter is not implemented, since the node array is available
|
||||
// on the Selection object.
|
||||
func (this *Selection) Get(index int) *html.Node {
|
||||
func (s *Selection) Get(index int) *html.Node {
|
||||
if index < 0 {
|
||||
index += len(this.Nodes) // Negative index gets from the end
|
||||
index += len(s.Nodes) // Negative index gets from the end
|
||||
}
|
||||
return this.Nodes[index]
|
||||
return s.Nodes[index]
|
||||
}
|
||||
|
||||
// Index() returns the position of the first element within the Selection object
|
||||
// Index returns the position of the first element within the Selection object
|
||||
// relative to its sibling elements.
|
||||
func (this *Selection) Index() int {
|
||||
if len(this.Nodes) > 0 {
|
||||
return newSingleSelection(this.Nodes[0], this.document).PrevAll().Length()
|
||||
func (s *Selection) Index() int {
|
||||
if len(s.Nodes) > 0 {
|
||||
return newSingleSelection(s.Nodes[0], s.document).PrevAll().Length()
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
// IndexSelector() returns the position of the first element within the
|
||||
// IndexSelector returns the position of the first element within the
|
||||
// Selection object relative to the elements matched by the selector, or -1 if
|
||||
// not found.
|
||||
func (this *Selection) IndexSelector(selector string) int {
|
||||
if len(this.Nodes) > 0 {
|
||||
sel := this.document.Find(selector)
|
||||
return indexInSlice(sel.Nodes, this.Nodes[0])
|
||||
func (s *Selection) IndexSelector(selector string) int {
|
||||
if len(s.Nodes) > 0 {
|
||||
sel := s.document.Find(selector)
|
||||
return indexInSlice(sel.Nodes, s.Nodes[0])
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
// IndexOfNode() returns the position of the specified node within the Selection
|
||||
// IndexOfNode returns the position of the specified node within the Selection
|
||||
// object, or -1 if not found.
|
||||
func (this *Selection) IndexOfNode(node *html.Node) int {
|
||||
return indexInSlice(this.Nodes, node)
|
||||
func (s *Selection) IndexOfNode(node *html.Node) int {
|
||||
return indexInSlice(s.Nodes, node)
|
||||
}
|
||||
|
||||
// IndexOfSelection() returns the position of the first node in the specified
|
||||
// IndexOfSelection returns the position of the first node in the specified
|
||||
// Selection object within this Selection object, or -1 if not found.
|
||||
func (this *Selection) IndexOfSelection(s *Selection) int {
|
||||
if s != nil && len(s.Nodes) > 0 {
|
||||
return indexInSlice(this.Nodes, s.Nodes[0])
|
||||
func (s *Selection) IndexOfSelection(sel *Selection) int {
|
||||
if sel != nil && len(sel.Nodes) > 0 {
|
||||
return indexInSlice(s.Nodes, sel.Nodes[0])
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
+22
-2
@@ -10,8 +10,8 @@ func TestFirst(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFirstEmpty(t *testing.T) {
|
||||
defer AssertPanic(t)
|
||||
Doc().Find(".pvk-zzcontentzz").First()
|
||||
sel := Doc().Find(".pvk-zzcontentzz").First()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestFirstRollback(t *testing.T) {
|
||||
@@ -31,6 +31,11 @@ func TestLast(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLastEmpty(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-zzcontentzz").Last()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestLastRollback(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Last().End()
|
||||
@@ -53,6 +58,21 @@ func TestEqNegative(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEqEmpty(t *testing.T) {
|
||||
sel := Doc().Find("something_random_that_does_not_exists").Eq(0)
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestEqInvalidPositive(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-content").Eq(3)
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestEqInvalidNegative(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-content").Eq(-4)
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestEqRollback(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Eq(1).End()
|
||||
|
||||
@@ -0,0 +1,405 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated by SVGo -->
|
||||
<svg width="1024" height="768"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g style="font-size:20px;font-family:sans-serif">
|
||||
<rect x="0" y="0" width="1024" height="768" style="fill:white"/>
|
||||
<text x="100" y="50" style="font-size:150%"></text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="118" width="0" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="607" y="133" style="text-anchor:end">+0.10%</text>
|
||||
</g>
|
||||
<text x="100" y="138" style="text-anchor:start">BenchmarkFirst</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="144" width="0" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="617" y="159" style="text-anchor:start">-0.10%</text>
|
||||
</g>
|
||||
<text x="100" y="164" style="text-anchor:start">BenchmarkLast</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="170" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="185" style="text-anchor:end">+2.86%</text>
|
||||
</g>
|
||||
<text x="100" y="190" style="text-anchor:start">BenchmarkEq</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="196" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="211" style="text-anchor:end">+2.67%</text>
|
||||
</g>
|
||||
<text x="100" y="216" style="text-anchor:start">BenchmarkSlice</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="222" width="32" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="649" y="237" style="text-anchor:start">-10.82%</text>
|
||||
</g>
|
||||
<text x="100" y="242" style="text-anchor:start">BenchmarkGet</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="248" width="132" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="749" y="263" style="text-anchor:start">-44.06%</text>
|
||||
</g>
|
||||
<text x="100" y="268" style="text-anchor:start">BenchmarkIndex</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="274" width="156" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="773" y="289" style="text-anchor:start">-52.26%</text>
|
||||
</g>
|
||||
<text x="100" y="294" style="text-anchor:start">BenchmarkIndexSelector</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="300" width="27" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="644" y="315" style="text-anchor:start">-9.32%</text>
|
||||
</g>
|
||||
<text x="100" y="320" style="text-anchor:start">BenchmarkIndexOfNode</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="326" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="341" style="text-anchor:start">-2.48%</text>
|
||||
</g>
|
||||
<text x="100" y="346" style="text-anchor:start">BenchmarkIndexOfSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="352" width="104" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="721" y="367" style="text-anchor:start">-34.96%</text>
|
||||
</g>
|
||||
<text x="100" y="372" style="text-anchor:start">BenchmarkMetalReviewExample</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="378" width="177" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="794" y="393" style="text-anchor:start">-59.16%</text>
|
||||
</g>
|
||||
<text x="100" y="398" style="text-anchor:start">BenchmarkAdd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="404" width="0" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="617" y="419" style="text-anchor:start">+0.00%</text>
|
||||
</g>
|
||||
<text x="100" y="424" style="text-anchor:start">BenchmarkAddSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="602" y="430" width="10" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="597" y="445" style="text-anchor:end">+3.47%</text>
|
||||
</g>
|
||||
<text x="100" y="450" style="text-anchor:start">BenchmarkAddNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="456" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="471" style="text-anchor:start">-2.51%</text>
|
||||
</g>
|
||||
<text x="100" y="476" style="text-anchor:start">BenchmarkAndSelf</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="482" width="41" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="658" y="497" style="text-anchor:start">-13.96%</text>
|
||||
</g>
|
||||
<text x="100" y="502" style="text-anchor:start">BenchmarkFilter</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="508" width="43" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="660" y="523" style="text-anchor:start">-14.53%</text>
|
||||
</g>
|
||||
<text x="100" y="528" style="text-anchor:start">BenchmarkNot</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="534" width="11" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="628" y="549" style="text-anchor:start">-3.81%</text>
|
||||
</g>
|
||||
<text x="100" y="554" style="text-anchor:start">BenchmarkFilterFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="560" width="8" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="625" y="575" style="text-anchor:start">-2.83%</text>
|
||||
</g>
|
||||
<text x="100" y="580" style="text-anchor:start">BenchmarkNotFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="586" width="13" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="630" y="601" style="text-anchor:start">-4.63%</text>
|
||||
</g>
|
||||
<text x="100" y="606" style="text-anchor:start">BenchmarkFilterNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="612" width="6" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="623" y="627" style="text-anchor:start">-2.32%</text>
|
||||
</g>
|
||||
<text x="100" y="632" style="text-anchor:start">BenchmarkNotNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="638" width="12" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="629" y="653" style="text-anchor:start">-4.23%</text>
|
||||
</g>
|
||||
<text x="100" y="658" style="text-anchor:start">BenchmarkFilterSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="664" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="679" style="text-anchor:start">-3.31%</text>
|
||||
</g>
|
||||
<text x="100" y="684" style="text-anchor:start">BenchmarkNotSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="690" width="101" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="718" y="705" style="text-anchor:start">-33.69%</text>
|
||||
</g>
|
||||
<text x="100" y="710" style="text-anchor:start">BenchmarkHas</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="716" width="13" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="630" y="731" style="text-anchor:start">-4.53%</text>
|
||||
</g>
|
||||
<text x="100" y="736" style="text-anchor:start">BenchmarkHasNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="742" width="15" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="632" y="757" style="text-anchor:start">-5.30%</text>
|
||||
</g>
|
||||
<text x="100" y="762" style="text-anchor:start">BenchmarkHasSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="578" y="768" width="34" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="573" y="783" style="text-anchor:end">+11.35%</text>
|
||||
</g>
|
||||
<text x="100" y="788" style="text-anchor:start">BenchmarkEnd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="794" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="809" style="text-anchor:start">-3.33%</text>
|
||||
</g>
|
||||
<text x="100" y="814" style="text-anchor:start">BenchmarkEach</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="820" width="27" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="644" y="835" style="text-anchor:start">-9.16%</text>
|
||||
</g>
|
||||
<text x="100" y="840" style="text-anchor:start">BenchmarkMap</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="846" width="57" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="674" y="861" style="text-anchor:start">-19.15%</text>
|
||||
</g>
|
||||
<text x="100" y="866" style="text-anchor:start">BenchmarkAttr</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="872" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="887" style="text-anchor:start">-3.24%</text>
|
||||
</g>
|
||||
<text x="100" y="892" style="text-anchor:start">BenchmarkText</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="898" width="183" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="800" y="913" style="text-anchor:start">-61.25%</text>
|
||||
</g>
|
||||
<text x="100" y="918" style="text-anchor:start">BenchmarkLength</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="924" width="35" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="652" y="939" style="text-anchor:start">-11.92%</text>
|
||||
</g>
|
||||
<text x="100" y="944" style="text-anchor:start">BenchmarkHtml</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="950" width="49" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="666" y="965" style="text-anchor:start">-16.46%</text>
|
||||
</g>
|
||||
<text x="100" y="970" style="text-anchor:start">BenchmarkIs</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="976" width="81" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="698" y="991" style="text-anchor:start">-27.31%</text>
|
||||
</g>
|
||||
<text x="100" y="996" style="text-anchor:start">BenchmarkIsPositional</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1002" width="40" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="657" y="1017" style="text-anchor:start">-13.49%</text>
|
||||
</g>
|
||||
<text x="100" y="1022" style="text-anchor:start">BenchmarkIsFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1028" width="5" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="622" y="1043" style="text-anchor:start">-1.71%</text>
|
||||
</g>
|
||||
<text x="100" y="1048" style="text-anchor:start">BenchmarkIsSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1054" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="1069" style="text-anchor:start">-3.03%</text>
|
||||
</g>
|
||||
<text x="100" y="1074" style="text-anchor:start">BenchmarkIsNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1080" width="60" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="677" y="1095" style="text-anchor:start">-20.30%</text>
|
||||
</g>
|
||||
<text x="100" y="1100" style="text-anchor:start">BenchmarkHasClass</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1106" width="33" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="650" y="1121" style="text-anchor:start">-11.29%</text>
|
||||
</g>
|
||||
<text x="100" y="1126" style="text-anchor:start">BenchmarkContains</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1132" width="152" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="769" y="1147" style="text-anchor:start">-50.88%</text>
|
||||
</g>
|
||||
<text x="100" y="1152" style="text-anchor:start">BenchmarkFind</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1158" width="135" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="752" y="1173" style="text-anchor:start">-45.28%</text>
|
||||
</g>
|
||||
<text x="100" y="1178" style="text-anchor:start">BenchmarkFindWithinSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="544" y="1184" width="68" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="539" y="1199" style="text-anchor:end">+22.95%</text>
|
||||
</g>
|
||||
<text x="100" y="1204" style="text-anchor:start">BenchmarkFindSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="544" y="1210" width="68" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="539" y="1225" style="text-anchor:end">+22.68%</text>
|
||||
</g>
|
||||
<text x="100" y="1230" style="text-anchor:start">BenchmarkFindNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1236" width="195" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="812" y="1251" style="text-anchor:start">-65.08%</text>
|
||||
</g>
|
||||
<text x="100" y="1256" style="text-anchor:start">BenchmarkContents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1262" width="179" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="796" y="1277" style="text-anchor:start">-59.77%</text>
|
||||
</g>
|
||||
<text x="100" y="1282" style="text-anchor:start">BenchmarkContentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1288" width="192" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="809" y="1303" style="text-anchor:start">-64.31%</text>
|
||||
</g>
|
||||
<text x="100" y="1308" style="text-anchor:start">BenchmarkChildren</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1314" width="118" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="735" y="1329" style="text-anchor:start">-39.56%</text>
|
||||
</g>
|
||||
<text x="100" y="1334" style="text-anchor:start">BenchmarkChildrenFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1340" width="19" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="636" y="1355" style="text-anchor:start">-6.61%</text>
|
||||
</g>
|
||||
<text x="100" y="1360" style="text-anchor:start">BenchmarkParent</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1366" width="32" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="649" y="1381" style="text-anchor:start">-10.92%</text>
|
||||
</g>
|
||||
<text x="100" y="1386" style="text-anchor:start">BenchmarkParentFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1392" width="5" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="622" y="1407" style="text-anchor:start">-1.72%</text>
|
||||
</g>
|
||||
<text x="100" y="1412" style="text-anchor:start">BenchmarkParents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1418" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="1433" style="text-anchor:start">-2.37%</text>
|
||||
</g>
|
||||
<text x="100" y="1438" style="text-anchor:start">BenchmarkParentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1444" width="142" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="759" y="1459" style="text-anchor:start">-47.60%</text>
|
||||
</g>
|
||||
<text x="100" y="1464" style="text-anchor:start">BenchmarkParentsUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1470" width="109" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="726" y="1485" style="text-anchor:start">-36.39%</text>
|
||||
</g>
|
||||
<text x="100" y="1490" style="text-anchor:start">BenchmarkParentsUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1496" width="107" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="724" y="1511" style="text-anchor:start">-35.99%</text>
|
||||
</g>
|
||||
<text x="100" y="1516" style="text-anchor:start">BenchmarkParentsUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1522" width="146" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="763" y="1537" style="text-anchor:start">-48.84%</text>
|
||||
</g>
|
||||
<text x="100" y="1542" style="text-anchor:start">BenchmarkParentsFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1548" width="98" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="715" y="1563" style="text-anchor:start">-32.75%</text>
|
||||
</g>
|
||||
<text x="100" y="1568" style="text-anchor:start">BenchmarkParentsFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1574" width="99" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="716" y="1589" style="text-anchor:start">-33.12%</text>
|
||||
</g>
|
||||
<text x="100" y="1594" style="text-anchor:start">BenchmarkParentsFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1600" width="89" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="706" y="1615" style="text-anchor:start">-29.78%</text>
|
||||
</g>
|
||||
<text x="100" y="1620" style="text-anchor:start">BenchmarkSiblings</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1626" width="92" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="709" y="1641" style="text-anchor:start">-30.89%</text>
|
||||
</g>
|
||||
<text x="100" y="1646" style="text-anchor:start">BenchmarkSiblingsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1652" width="204" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="821" y="1667" style="text-anchor:start">-68.19%</text>
|
||||
</g>
|
||||
<text x="100" y="1672" style="text-anchor:start">BenchmarkNext</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1678" width="199" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="816" y="1693" style="text-anchor:start">-66.59%</text>
|
||||
</g>
|
||||
<text x="100" y="1698" style="text-anchor:start">BenchmarkNextFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1704" width="93" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="710" y="1719" style="text-anchor:start">-31.08%</text>
|
||||
</g>
|
||||
<text x="100" y="1724" style="text-anchor:start">BenchmarkNextAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1730" width="90" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="707" y="1745" style="text-anchor:start">-30.03%</text>
|
||||
</g>
|
||||
<text x="100" y="1750" style="text-anchor:start">BenchmarkNextAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1756" width="204" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="821" y="1771" style="text-anchor:start">-68.32%</text>
|
||||
</g>
|
||||
<text x="100" y="1776" style="text-anchor:start">BenchmarkPrev</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1782" width="199" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="816" y="1797" style="text-anchor:start">-66.65%</text>
|
||||
</g>
|
||||
<text x="100" y="1802" style="text-anchor:start">BenchmarkPrevFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1808" width="129" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="746" y="1823" style="text-anchor:start">-43.33%</text>
|
||||
</g>
|
||||
<text x="100" y="1828" style="text-anchor:start">BenchmarkPrevAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1834" width="129" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="746" y="1849" style="text-anchor:start">-43.24%</text>
|
||||
</g>
|
||||
<text x="100" y="1854" style="text-anchor:start">BenchmarkPrevAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1860" width="162" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="779" y="1875" style="text-anchor:start">-54.27%</text>
|
||||
</g>
|
||||
<text x="100" y="1880" style="text-anchor:start">BenchmarkNextUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1886" width="113" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="730" y="1901" style="text-anchor:start">-37.90%</text>
|
||||
</g>
|
||||
<text x="100" y="1906" style="text-anchor:start">BenchmarkNextUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1912" width="129" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="746" y="1927" style="text-anchor:start">-43.21%</text>
|
||||
</g>
|
||||
<text x="100" y="1932" style="text-anchor:start">BenchmarkNextUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1938" width="147" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="764" y="1953" style="text-anchor:start">-49.33%</text>
|
||||
</g>
|
||||
<text x="100" y="1958" style="text-anchor:start">BenchmarkPrevUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1964" width="111" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="728" y="1979" style="text-anchor:start">-37.02%</text>
|
||||
</g>
|
||||
<text x="100" y="1984" style="text-anchor:start">BenchmarkPrevUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1990" width="133" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="750" y="2005" style="text-anchor:start">-44.59%</text>
|
||||
</g>
|
||||
<text x="100" y="2010" style="text-anchor:start">BenchmarkPrevUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2016" width="173" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="790" y="2031" style="text-anchor:start">-57.79%</text>
|
||||
</g>
|
||||
<text x="100" y="2036" style="text-anchor:start">BenchmarkNextFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2042" width="109" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="726" y="2057" style="text-anchor:start">-36.61%</text>
|
||||
</g>
|
||||
<text x="100" y="2062" style="text-anchor:start">BenchmarkNextFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2068" width="113" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="730" y="2083" style="text-anchor:start">-37.81%</text>
|
||||
</g>
|
||||
<text x="100" y="2088" style="text-anchor:start">BenchmarkNextFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2094" width="177" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="794" y="2109" style="text-anchor:start">-59.21%</text>
|
||||
</g>
|
||||
<text x="100" y="2114" style="text-anchor:start">BenchmarkPrevFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2120" width="108" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="725" y="2135" style="text-anchor:start">-36.20%</text>
|
||||
</g>
|
||||
<text x="100" y="2140" style="text-anchor:start">BenchmarkPrevFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2146" width="108" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="725" y="2161" style="text-anchor:start">-36.05%</text>
|
||||
</g>
|
||||
<text x="100" y="2166" style="text-anchor:start">BenchmarkPrevFilteredUntilNodes</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,420 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated by SVGo -->
|
||||
<svg width="1024" height="768"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g style="font-size:20px;font-family:sans-serif">
|
||||
<rect x="0" y="0" width="1024" height="768" style="fill:white"/>
|
||||
<text x="100" y="50" style="font-size:150%"></text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="606" y="118" width="6" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="601" y="133" style="text-anchor:end">+2.12%</text>
|
||||
</g>
|
||||
<text x="100" y="138" style="text-anchor:start">BenchmarkFirst</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="144" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="159" style="text-anchor:end">+1.06%</text>
|
||||
</g>
|
||||
<text x="100" y="164" style="text-anchor:start">BenchmarkLast</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="602" y="170" width="10" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="597" y="185" style="text-anchor:end">+3.63%</text>
|
||||
</g>
|
||||
<text x="100" y="190" style="text-anchor:start">BenchmarkEq</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="196" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="211" style="text-anchor:end">+2.67%</text>
|
||||
</g>
|
||||
<text x="100" y="216" style="text-anchor:start">BenchmarkSlice</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="222" width="72" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="689" y="237" style="text-anchor:start">-24.26%</text>
|
||||
</g>
|
||||
<text x="100" y="242" style="text-anchor:start">BenchmarkGet</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="248" width="125" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="742" y="263" style="text-anchor:start">-41.71%</text>
|
||||
</g>
|
||||
<text x="100" y="268" style="text-anchor:start">BenchmarkIndex</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="274" width="151" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="768" y="289" style="text-anchor:start">-50.42%</text>
|
||||
</g>
|
||||
<text x="100" y="294" style="text-anchor:start">BenchmarkIndexSelector</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="595" y="300" width="17" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="590" y="315" style="text-anchor:end">+5.94%</text>
|
||||
</g>
|
||||
<text x="100" y="320" style="text-anchor:start">BenchmarkIndexOfNode</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="588" y="326" width="24" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="583" y="341" style="text-anchor:end">+8.26%</text>
|
||||
</g>
|
||||
<text x="100" y="346" style="text-anchor:start">BenchmarkIndexOfSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="352" width="98" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="715" y="367" style="text-anchor:start">-32.94%</text>
|
||||
</g>
|
||||
<text x="100" y="372" style="text-anchor:start">BenchmarkMetalReviewExample</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="378" width="170" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="787" y="393" style="text-anchor:start">-56.84%</text>
|
||||
</g>
|
||||
<text x="100" y="398" style="text-anchor:start">BenchmarkAdd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="593" y="404" width="19" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="588" y="419" style="text-anchor:end">+6.63%</text>
|
||||
</g>
|
||||
<text x="100" y="424" style="text-anchor:start">BenchmarkAddSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="584" y="430" width="28" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="579" y="445" style="text-anchor:end">+9.42%</text>
|
||||
</g>
|
||||
<text x="100" y="450" style="text-anchor:start">BenchmarkAddNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="456" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="471" style="text-anchor:end">+2.93%</text>
|
||||
</g>
|
||||
<text x="100" y="476" style="text-anchor:start">BenchmarkAndSelf</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="482" width="41" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="658" y="497" style="text-anchor:start">-13.75%</text>
|
||||
</g>
|
||||
<text x="100" y="502" style="text-anchor:start">BenchmarkFilter</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="508" width="44" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="661" y="523" style="text-anchor:start">-14.90%</text>
|
||||
</g>
|
||||
<text x="100" y="528" style="text-anchor:start">BenchmarkNot</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="534" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="549" style="text-anchor:end">+1.07%</text>
|
||||
</g>
|
||||
<text x="100" y="554" style="text-anchor:start">BenchmarkFilterFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="598" y="560" width="14" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="593" y="575" style="text-anchor:end">+4.91%</text>
|
||||
</g>
|
||||
<text x="100" y="580" style="text-anchor:start">BenchmarkNotFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="586" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="601" style="text-anchor:end">+1.03%</text>
|
||||
</g>
|
||||
<text x="100" y="606" style="text-anchor:start">BenchmarkFilterNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="600" y="612" width="12" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="595" y="627" style="text-anchor:end">+4.22%</text>
|
||||
</g>
|
||||
<text x="100" y="632" style="text-anchor:start">BenchmarkNotNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="638" width="3" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="620" y="653" style="text-anchor:start">-1.00%</text>
|
||||
</g>
|
||||
<text x="100" y="658" style="text-anchor:start">BenchmarkFilterSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="600" y="664" width="12" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="595" y="679" style="text-anchor:end">+4.00%</text>
|
||||
</g>
|
||||
<text x="100" y="684" style="text-anchor:start">BenchmarkNotSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="690" width="96" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="713" y="705" style="text-anchor:start">-32.12%</text>
|
||||
</g>
|
||||
<text x="100" y="710" style="text-anchor:start">BenchmarkHas</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="608" y="716" width="4" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="603" y="731" style="text-anchor:end">+1.59%</text>
|
||||
</g>
|
||||
<text x="100" y="736" style="text-anchor:start">BenchmarkHasNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="608" y="742" width="4" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="603" y="757" style="text-anchor:end">+1.56%</text>
|
||||
</g>
|
||||
<text x="100" y="762" style="text-anchor:start">BenchmarkHasSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="566" y="768" width="46" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="561" y="783" style="text-anchor:end">+15.54%</text>
|
||||
</g>
|
||||
<text x="100" y="788" style="text-anchor:start">BenchmarkEnd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="607" y="794" width="5" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="602" y="809" style="text-anchor:end">+1.77%</text>
|
||||
</g>
|
||||
<text x="100" y="814" style="text-anchor:start">BenchmarkEach</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="820" width="10" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="627" y="835" style="text-anchor:start">-3.61%</text>
|
||||
</g>
|
||||
<text x="100" y="840" style="text-anchor:start">BenchmarkMap</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="846" width="49" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="666" y="861" style="text-anchor:start">-16.48%</text>
|
||||
</g>
|
||||
<text x="100" y="866" style="text-anchor:start">BenchmarkAttr</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="872" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="887" style="text-anchor:end">+1.33%</text>
|
||||
</g>
|
||||
<text x="100" y="892" style="text-anchor:start">BenchmarkText</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="898" width="177" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="794" y="913" style="text-anchor:start">-59.21%</text>
|
||||
</g>
|
||||
<text x="100" y="918" style="text-anchor:start">BenchmarkLength</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="924" width="27" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="644" y="939" style="text-anchor:start">-9.01%</text>
|
||||
</g>
|
||||
<text x="100" y="944" style="text-anchor:start">BenchmarkHtml</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="950" width="50" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="667" y="965" style="text-anchor:start">-16.73%</text>
|
||||
</g>
|
||||
<text x="100" y="970" style="text-anchor:start">BenchmarkIs</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="976" width="75" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="692" y="991" style="text-anchor:start">-25.08%</text>
|
||||
</g>
|
||||
<text x="100" y="996" style="text-anchor:start">BenchmarkIsPositional</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1002" width="34" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="651" y="1017" style="text-anchor:start">-11.55%</text>
|
||||
</g>
|
||||
<text x="100" y="1022" style="text-anchor:start">BenchmarkIsFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="1028" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="1043" style="text-anchor:end">+1.28%</text>
|
||||
</g>
|
||||
<text x="100" y="1048" style="text-anchor:start">BenchmarkIsSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="606" y="1054" width="6" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="601" y="1069" style="text-anchor:end">+2.10%</text>
|
||||
</g>
|
||||
<text x="100" y="1074" style="text-anchor:start">BenchmarkIsNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1080" width="47" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="664" y="1095" style="text-anchor:start">-15.99%</text>
|
||||
</g>
|
||||
<text x="100" y="1100" style="text-anchor:start">BenchmarkHasClass</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1106" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="1121" style="text-anchor:start">-2.65%</text>
|
||||
</g>
|
||||
<text x="100" y="1126" style="text-anchor:start">BenchmarkContains</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1132" width="145" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="762" y="1147" style="text-anchor:start">-48.54%</text>
|
||||
</g>
|
||||
<text x="100" y="1152" style="text-anchor:start">BenchmarkFind</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1158" width="128" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="745" y="1173" style="text-anchor:start">-42.71%</text>
|
||||
</g>
|
||||
<text x="100" y="1178" style="text-anchor:start">BenchmarkFindWithinSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="526" y="1184" width="86" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="521" y="1199" style="text-anchor:end">+28.77%</text>
|
||||
</g>
|
||||
<text x="100" y="1204" style="text-anchor:start">BenchmarkFindSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="527" y="1210" width="85" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="522" y="1225" style="text-anchor:end">+28.47%</text>
|
||||
</g>
|
||||
<text x="100" y="1230" style="text-anchor:start">BenchmarkFindNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1236" width="188" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="805" y="1251" style="text-anchor:start">-62.84%</text>
|
||||
</g>
|
||||
<text x="100" y="1256" style="text-anchor:start">BenchmarkContents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1262" width="174" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="791" y="1277" style="text-anchor:start">-58.06%</text>
|
||||
</g>
|
||||
<text x="100" y="1282" style="text-anchor:start">BenchmarkContentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1288" width="189" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="806" y="1303" style="text-anchor:start">-63.13%</text>
|
||||
</g>
|
||||
<text x="100" y="1308" style="text-anchor:start">BenchmarkChildren</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1314" width="114" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="731" y="1329" style="text-anchor:start">-38.24%</text>
|
||||
</g>
|
||||
<text x="100" y="1334" style="text-anchor:start">BenchmarkChildrenFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1340" width="10" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="627" y="1355" style="text-anchor:start">-3.66%</text>
|
||||
</g>
|
||||
<text x="100" y="1360" style="text-anchor:start">BenchmarkParent</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1366" width="18" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="635" y="1381" style="text-anchor:start">-6.06%</text>
|
||||
</g>
|
||||
<text x="100" y="1386" style="text-anchor:start">BenchmarkParentFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="602" y="1392" width="10" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="597" y="1407" style="text-anchor:end">+3.64%</text>
|
||||
</g>
|
||||
<text x="100" y="1412" style="text-anchor:start">BenchmarkParents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="608" y="1418" width="4" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="603" y="1433" style="text-anchor:end">+1.44%</text>
|
||||
</g>
|
||||
<text x="100" y="1438" style="text-anchor:start">BenchmarkParentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1444" width="133" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="750" y="1459" style="text-anchor:start">-44.35%</text>
|
||||
</g>
|
||||
<text x="100" y="1464" style="text-anchor:start">BenchmarkParentsUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1470" width="95" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="712" y="1485" style="text-anchor:start">-31.99%</text>
|
||||
</g>
|
||||
<text x="100" y="1490" style="text-anchor:start">BenchmarkParentsUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1496" width="97" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="714" y="1511" style="text-anchor:start">-32.62%</text>
|
||||
</g>
|
||||
<text x="100" y="1516" style="text-anchor:start">BenchmarkParentsUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1522" width="137" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="754" y="1537" style="text-anchor:start">-45.83%</text>
|
||||
</g>
|
||||
<text x="100" y="1542" style="text-anchor:start">BenchmarkParentsFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1548" width="90" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="707" y="1563" style="text-anchor:start">-30.05%</text>
|
||||
</g>
|
||||
<text x="100" y="1568" style="text-anchor:start">BenchmarkParentsFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1574" width="89" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="706" y="1589" style="text-anchor:start">-29.97%</text>
|
||||
</g>
|
||||
<text x="100" y="1594" style="text-anchor:start">BenchmarkParentsFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1600" width="77" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="694" y="1615" style="text-anchor:start">-25.96%</text>
|
||||
</g>
|
||||
<text x="100" y="1620" style="text-anchor:start">BenchmarkSiblings</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1626" width="80" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="697" y="1641" style="text-anchor:start">-26.67%</text>
|
||||
</g>
|
||||
<text x="100" y="1646" style="text-anchor:start">BenchmarkSiblingsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1652" width="199" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="816" y="1667" style="text-anchor:start">-66.40%</text>
|
||||
</g>
|
||||
<text x="100" y="1672" style="text-anchor:start">BenchmarkNext</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1678" width="193" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="810" y="1693" style="text-anchor:start">-64.46%</text>
|
||||
</g>
|
||||
<text x="100" y="1698" style="text-anchor:start">BenchmarkNextFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1704" width="79" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="696" y="1719" style="text-anchor:start">-26.50%</text>
|
||||
</g>
|
||||
<text x="100" y="1724" style="text-anchor:start">BenchmarkNextAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1730" width="78" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="695" y="1745" style="text-anchor:start">-26.27%</text>
|
||||
</g>
|
||||
<text x="100" y="1750" style="text-anchor:start">BenchmarkNextAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1756" width="200" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="817" y="1771" style="text-anchor:start">-66.84%</text>
|
||||
</g>
|
||||
<text x="100" y="1776" style="text-anchor:start">BenchmarkPrev</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1782" width="193" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="810" y="1797" style="text-anchor:start">-64.35%</text>
|
||||
</g>
|
||||
<text x="100" y="1802" style="text-anchor:start">BenchmarkPrevFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1808" width="120" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="737" y="1823" style="text-anchor:start">-40.05%</text>
|
||||
</g>
|
||||
<text x="100" y="1828" style="text-anchor:start">BenchmarkPrevAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1834" width="119" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="736" y="1849" style="text-anchor:start">-39.74%</text>
|
||||
</g>
|
||||
<text x="100" y="1854" style="text-anchor:start">BenchmarkPrevAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1860" width="155" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="772" y="1875" style="text-anchor:start">-51.73%</text>
|
||||
</g>
|
||||
<text x="100" y="1880" style="text-anchor:start">BenchmarkNextUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1886" width="100" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="717" y="1901" style="text-anchor:start">-33.42%</text>
|
||||
</g>
|
||||
<text x="100" y="1906" style="text-anchor:start">BenchmarkNextUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1912" width="121" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="738" y="1927" style="text-anchor:start">-40.42%</text>
|
||||
</g>
|
||||
<text x="100" y="1932" style="text-anchor:start">BenchmarkNextUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1938" width="140" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="757" y="1953" style="text-anchor:start">-46.87%</text>
|
||||
</g>
|
||||
<text x="100" y="1958" style="text-anchor:start">BenchmarkPrevUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1964" width="99" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="716" y="1979" style="text-anchor:start">-33.14%</text>
|
||||
</g>
|
||||
<text x="100" y="1984" style="text-anchor:start">BenchmarkPrevUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1990" width="123" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="740" y="2005" style="text-anchor:start">-41.19%</text>
|
||||
</g>
|
||||
<text x="100" y="2010" style="text-anchor:start">BenchmarkPrevUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2016" width="167" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="784" y="2031" style="text-anchor:start">-55.92%</text>
|
||||
</g>
|
||||
<text x="100" y="2036" style="text-anchor:start">BenchmarkNextFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2042" width="97" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="714" y="2057" style="text-anchor:start">-32.49%</text>
|
||||
</g>
|
||||
<text x="100" y="2062" style="text-anchor:start">BenchmarkNextFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2068" width="99" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="716" y="2083" style="text-anchor:start">-33.00%</text>
|
||||
</g>
|
||||
<text x="100" y="2088" style="text-anchor:start">BenchmarkNextFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2094" width="175" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="792" y="2109" style="text-anchor:start">-58.54%</text>
|
||||
</g>
|
||||
<text x="100" y="2114" style="text-anchor:start">BenchmarkPrevFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2120" width="101" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="718" y="2135" style="text-anchor:start">-33.80%</text>
|
||||
</g>
|
||||
<text x="100" y="2140" style="text-anchor:start">BenchmarkPrevFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2146" width="100" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="717" y="2161" style="text-anchor:start">-33.44%</text>
|
||||
</g>
|
||||
<text x="100" y="2166" style="text-anchor:start">BenchmarkPrevFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2172" width="74" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="691" y="2187" style="text-anchor:start">-24.82%</text>
|
||||
</g>
|
||||
<text x="100" y="2192" style="text-anchor:start">BenchmarkClosest</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2198" width="103" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="720" y="2213" style="text-anchor:start">-34.45%</text>
|
||||
</g>
|
||||
<text x="100" y="2218" style="text-anchor:start">BenchmarkClosestSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2224" width="105" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="722" y="2239" style="text-anchor:start">-35.30%</text>
|
||||
</g>
|
||||
<text x="100" y="2244" style="text-anchor:start">BenchmarkClosestNodes</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,470 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 96.3 ns/op
|
||||
BenchmarkLast 20000000 95.7 ns/op
|
||||
BenchmarkEq 20000000 97.1 ns/op
|
||||
BenchmarkSlice 20000000 92.3 ns/op
|
||||
BenchmarkGet 1000000000 2.06 ns/op
|
||||
BenchmarkIndex 1000000 1069 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 100000 26750 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.7 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 11.8 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 219078 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 100000 22345 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 209 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 209 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2568 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 26715 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 50000 30058 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 66346 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 72646 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 65493 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 79466 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 65494 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 79387 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 386571 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 230664 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 230705 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.61 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9520 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 15960 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkAttr 50000000 30.4 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 18718 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 606 ns/op
|
||||
BenchmarkIs 100000 29289 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 23834 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2436 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 67106 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 66042 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 565347 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.0 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 100000 27677 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 72162 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 460124 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 459390 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 500000 3395 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 5193 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 667 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3591 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 43168 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 45836 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 92348 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 95306 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 72782 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 157639 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 157510 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 16987 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 21174 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 21238 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 66536 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 71822 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 10745 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 12399 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 44640 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 49713 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 10743 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 12456 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 17600 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 19460 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 92630 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 61285 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 25859 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 230236 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 20000 77837 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 20784 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 46147 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 67164 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 66628 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 46697 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 68646 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 68745 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 4909 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 744 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 733 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 220.793s
|
||||
+476
@@ -0,0 +1,476 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 95.5 ns/op
|
||||
BenchmarkLast 20000000 94.9 ns/op
|
||||
BenchmarkEq 20000000 95.7 ns/op
|
||||
BenchmarkSlice 20000000 91.7 ns/op
|
||||
BenchmarkGet 1000000000 2.05 ns/op
|
||||
BenchmarkIndex 1000000 1079 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 100000 26972 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.8 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 11.7 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 213800 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 100000 21811 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 205 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 202 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2467 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 25643 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 100000 29566 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 66894 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 72183 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 65516 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 78880 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 65232 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 78813 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 388834 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 228552 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 228365 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.62 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9548 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 15900 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkEachWithBreak 1000000 1650 ns/op
|
||||
--- BENCH: BenchmarkEachWithBreak
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
BenchmarkAttr 50000000 30.5 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 18873 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 616 ns/op
|
||||
BenchmarkIs 100000 29499 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 23733 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2404 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 65376 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 65322 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 558933 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.1 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 100000 27841 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 72096 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 457349 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 459324 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 500000 3435 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 5241 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 667 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3639 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 44867 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 46476 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 92559 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 96142 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 73931 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 159820 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 158811 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 17203 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 21358 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 21338 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 66463 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 72503 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 10881 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 12588 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 45075 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 50455 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 10933 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 12579 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 17751 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 19702 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 93586 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 61155 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 25805 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 232225 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 20000 78316 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 20657 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 46567 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 67227 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 66995 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 47361 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 68802 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 68928 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 4922 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 738 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 737 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 224.003s
|
||||
@@ -0,0 +1,478 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 88.4 ns/op
|
||||
BenchmarkLast 20000000 88.2 ns/op
|
||||
BenchmarkEq 20000000 87.4 ns/op
|
||||
BenchmarkSlice 20000000 84.9 ns/op
|
||||
BenchmarkGet 2000000000 1.99 ns/op
|
||||
BenchmarkIndex 2000000 906 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 100000 22276 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 200000000 9.72 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 10.4 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 199277 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 100000 18277 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 200 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 189 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2569 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 25195 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 100000 29003 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 60690 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 66008 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 59723 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 50000 72698 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 59598 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 50000 72526 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 367076 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 219710 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 219105 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.58 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 8615 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 200000 14271 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkEachWithBreak 1000000 1497 ns/op
|
||||
--- BENCH: BenchmarkEachWithBreak
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
BenchmarkAttr 50000000 30.9 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 200000 13729 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 537 ns/op
|
||||
BenchmarkIs 100000 28904 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 23556 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2195 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 60100 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 59962 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 388679 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.0 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 100000 22779 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 62033 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 446918 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 441753 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 1000000 2807 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 4477 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 548 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3304 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 38248 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 40677 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 83043 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 85391 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 65118 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 144028 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 146713 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 15113 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 18881 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 18926 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 63221 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 69028 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 9133 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 10601 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 43089 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 47867 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 9104 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 10579 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 15185 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 17108 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 81087 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 55831 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 23130 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 204673 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 50000 70965 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 18591 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 42004 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 61953 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 62124 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 42861 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 62451 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 62631 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 4684 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 622 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 617 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 218.724s
|
||||
@@ -0,0 +1,477 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 88.3 ns/op
|
||||
BenchmarkLast 20000000 88.9 ns/op
|
||||
BenchmarkEq 20000000 86.7 ns/op
|
||||
BenchmarkSlice 20000000 84.1 ns/op
|
||||
BenchmarkGet 2000000000 1.99 ns/op
|
||||
BenchmarkIndex 2000000 907 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 200000 13052 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.5 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 11.6 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 189556 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 200000 13714 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 200 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 186 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2532 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 25199 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 100000 29162 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 60733 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 66124 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 59489 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 50000 73623 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 60053 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 50000 73477 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 364859 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 226980 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 220471 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.64 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 8811 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 15365 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkEachWithBreak 1000000 1559 ns/op
|
||||
--- BENCH: BenchmarkEachWithBreak
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
BenchmarkAttr 50000000 31.7 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 200000 13901 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 541 ns/op
|
||||
BenchmarkIs 100000 29435 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 22938 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2185 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 60607 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 61599 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 395436 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.0 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 200000 13788 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 54253 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 438879 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 437225 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 1000000 2844 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 4528 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 552 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3345 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 39482 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 42113 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 84136 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 86041 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 65844 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 146903 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 146638 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 16413 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 20366 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 18800 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 63443 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 69250 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 9193 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 10767 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 42829 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 48174 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 9114 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 11114 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 16387 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 18322 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 83828 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 58822 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 23173 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 219407 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 20000 76033 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 19417 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 44648 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 62751 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 62035 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 43331 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 64767 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 67808 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 4870 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 656 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 663 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 218.007s
|
||||
@@ -0,0 +1,477 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 91.0 ns/op
|
||||
BenchmarkLast 20000000 90.5 ns/op
|
||||
BenchmarkEq 20000000 90.2 ns/op
|
||||
BenchmarkSlice 20000000 88.0 ns/op
|
||||
BenchmarkGet 1000000000 2.04 ns/op
|
||||
BenchmarkIndex 2000000 935 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 100000 23613 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.2 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 11.0 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 213843 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 100000 18671 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 204 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 195 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2611 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 27571 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 50000 32006 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 61388 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 66702 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 59699 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 50000 73248 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 59242 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 50000 73211 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 395087 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 215849 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 215612 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.59 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 8588 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 200000 14444 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkEachWithBreak 1000000 1490 ns/op
|
||||
--- BENCH: BenchmarkEachWithBreak
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
BenchmarkAttr 50000000 30.9 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 200000 14017 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 577 ns/op
|
||||
BenchmarkIs 50000 31936 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 23372 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2170 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 59814 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 59629 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 384894 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.4 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 100000 23545 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 63775 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 441958 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 437717 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 1000000 2799 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 4489 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 546 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3472 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 39067 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 41450 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 84864 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 87823 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 65986 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 149798 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 148144 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 15579 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 19094 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 19037 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 63891 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 70424 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 9350 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 10929 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 43398 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 48519 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 9181 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 10811 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 15589 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 17341 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 80663 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 56496 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 23729 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 208267 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 50000 72119 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 18549 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 42339 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 61916 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 62139 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 43409 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 63768 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 63543 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 5110 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 629 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 627 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 215.785s
|
||||
@@ -40,3 +40,23 @@ func BenchmarkMap(b *testing.B) {
|
||||
}
|
||||
b.Logf("Map=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkEachWithBreak(b *testing.B) {
|
||||
var tmp, n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("td")
|
||||
f := func(i int, s *Selection) bool {
|
||||
tmp++
|
||||
return tmp < 10
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
tmp = 0
|
||||
sel.EachWithBreak(f)
|
||||
if n == 0 {
|
||||
n = tmp
|
||||
}
|
||||
}
|
||||
b.Logf("Each=%d", n)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2012, Martin Angers & Contributors
|
||||
// Copyright (c) 2012-2014, Martin Angers & Contributors
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -23,24 +23,33 @@
|
||||
|
||||
/*
|
||||
Package goquery implements features similar to jQuery, including the chainable
|
||||
syntax, to manipulate and query an HTML document (the modification functions of jQuery are not included).
|
||||
syntax, to manipulate and query an HTML document.
|
||||
|
||||
It depends on Go's experimental html package, which must be installed so that it
|
||||
can be imported as "code.google.com/p/go.net/html". See this tutorial on how to install it
|
||||
accordingly: http://code.google.com/p/go-wiki/wiki/InstallingExp
|
||||
GoQuery brings a syntax and a set of features similar to jQuery to the Go language.
|
||||
It is based on Go's net/html package and the CSS Selector library cascadia. Since
|
||||
the net/html parser returns tokens (nodes), and not a full-featured DOM object,
|
||||
jQuery's manipulation and modification functions have been left off (no point in
|
||||
modifying data in the parsed tree of the HTML, it has no effect).
|
||||
|
||||
It uses Cascadia as CSS selector (similar to Sizzle for jQuery). This dependency
|
||||
is automatically installed when using "go get ..." to install GoQuery.
|
||||
Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is
|
||||
the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML.
|
||||
|
||||
To provide a chainable interface, error management is strict, and goquery panics
|
||||
if an invalid Cascadia selector is used (this is consistent with the behavior of
|
||||
jQuery/Sizzle/document.querySelectorAll, where an error is thrown). This is
|
||||
necessary since multiple return values cannot be used to allow a chainable
|
||||
interface.
|
||||
Supported functions are query-oriented features (`hasClass()`, `attr()` and the likes),
|
||||
as well as traversing functions that make sense given what we have to work with.
|
||||
This makes GoQuery a great library for scraping web pages.
|
||||
|
||||
Syntax-wise, it is as close as possible to jQuery, with the same function names when
|
||||
possible, and that warm and fuzzy chainable interface. jQuery being the
|
||||
ultra-popular library that it is, I felt that writing a similar HTML-manipulating
|
||||
library was better to follow its API than to start anew (in the same spirit as
|
||||
Go's fmt package), even though some of its methods are less than intuitive (looking
|
||||
at you, index()...).
|
||||
|
||||
It is hosted on GitHub, along with additional documentation in the README.md
|
||||
file: https://github.com/puerkitobio/goquery
|
||||
|
||||
Please note that because of the net/html dependency, goquery requires Go1.1+.
|
||||
|
||||
The various methods are split into files based on the category of behavior:
|
||||
|
||||
* array.go : array-like positional manipulation of the selection.
|
||||
@@ -65,6 +74,7 @@ The various methods are split into files based on the category of behavior:
|
||||
|
||||
* iteration.go : methods to loop over the selection's nodes.
|
||||
- Each()
|
||||
- EachWithBreak()
|
||||
- Map()
|
||||
|
||||
* property.go : methods that inspect and get the node's properties values.
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
# Tips and tricks
|
||||
|
||||
## Handle Non-UTF8 html Pages
|
||||
|
||||
The `go.net/html` package used by `goquery` requires that the html document is UTF-8 encoded. When you know the encoding of the html page is not UTF-8, you can use the `iconv` package to convert it to UTF-8 (there are various implementation of the `iconv` API, see [godoc.org][iconv] for other options):
|
||||
|
||||
```
|
||||
$ go get -u github.com/djimenez/iconv-go
|
||||
```
|
||||
|
||||
and then:
|
||||
|
||||
```
|
||||
// Load the URL
|
||||
res, err := http.Get(url)
|
||||
if e != nil {
|
||||
// handle error
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
// Convert the designated charset HTML to utf-8 encoded HTML.
|
||||
// `charset` being one of the charsets known by the iconv package.
|
||||
utfBody, err := iconv.NewReader(res.Body, charset, "utf-8")
|
||||
if err != nil {
|
||||
// handler error
|
||||
}
|
||||
|
||||
// use utfBody using goquery
|
||||
doc, err := goquery.NewDocumentFromReader(utfBody)
|
||||
if err != nil {
|
||||
// handler error
|
||||
}
|
||||
// use doc...
|
||||
```
|
||||
|
||||
Thanks to github user @YuheiNakasaka.
|
||||
|
||||
Actually, the official go.text repository covers this use case too, see its [godoc page][text] for the details.
|
||||
|
||||
|
||||
## Handle Javascript-based Pages
|
||||
|
||||
`goquery` is great to handle normal html pages, but when most of the page is build dynamically using javascript, there's not much it can do. There are various options when faced with this problem:
|
||||
|
||||
* Use a headless browser such as [webloop][].
|
||||
* Use a Go javascript parser package, such as [otto][].
|
||||
|
||||
You can find a code example using `otto` [in this gist][exotto]. Thanks to github user @cryptix.
|
||||
|
||||
## For Loop
|
||||
|
||||
If all you need is a normal `for` loop over all nodes in the current selection, where `Map/Each`-style iteration is not necessary, you can use the following:
|
||||
|
||||
```
|
||||
sel := Doc().Find(".selector")
|
||||
for i := range sel.Nodes {
|
||||
single := sel.Eq(i)
|
||||
// use `single` as a selection of 1 node
|
||||
}
|
||||
```
|
||||
|
||||
Thanks to github user @jmoiron.
|
||||
|
||||
[webloop]: https://github.com/sourcegraph/webloop
|
||||
[otto]: https://github.com/robertkrimen/otto
|
||||
[exotto]: https://gist.github.com/cryptix/87127f76a94183747b53
|
||||
[iconv]: http://godoc.org/?q=iconv
|
||||
[text]: http://godoc.org/code.google.com/p/go.text/encoding
|
||||
+12
-23
@@ -2,38 +2,27 @@ package goquery
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
// In real use, this import would be required (not in this example, since it
|
||||
// is part of the goquery package)
|
||||
//"github.com/PuerkitoBio/goquery"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// This example scrapes the 10 reviews shown on the home page of MetalReview.com,
|
||||
// the best metal review site on the web :) (and no, I'm not affiliated to them!)
|
||||
func ExampleScrape_MetalReview() {
|
||||
// This example scrapes the reviews shown on the home page of metalsucks.net.
|
||||
func ExampleScrape_MetalSucks() {
|
||||
// Load the HTML document (in real use, the type would be *goquery.Document)
|
||||
var doc *Document
|
||||
var e error
|
||||
|
||||
if doc, e = NewDocument("http://metalreview.com"); e != nil {
|
||||
panic(e.Error())
|
||||
doc, err := NewDocument("http://metalsucks.net")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Find the review items (the type of the Selection would be *goquery.Selection)
|
||||
doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
var band, title string
|
||||
var score float64
|
||||
|
||||
// For each item found, get the band, title and score, and print it
|
||||
band = s.Find("strong").Text()
|
||||
title = s.Find("em").Text()
|
||||
if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil {
|
||||
// Not a valid float, ignore score
|
||||
fmt.Printf("Review %d: %s - %s.\n", i, band, title)
|
||||
} else {
|
||||
// Print all, including score
|
||||
fmt.Printf("Review %d: %s - %s (%2.1f).\n", i, band, title, score)
|
||||
}
|
||||
doc.Find(".reviews-wrap article .review-rhs").Each(func(i int, s *Selection) {
|
||||
// For each item found, get the band and title
|
||||
band := s.Find("h3").Text()
|
||||
title := s.Find("i").Text()
|
||||
fmt.Printf("Review %d: %s - %s\n", i, band, title)
|
||||
})
|
||||
// To see the output of the Example while running the test suite (go test), simply
|
||||
// remove the leading "x" before Output on the next line. This will cause the
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/html"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// Add() adds the selector string's matching nodes to those in the current
|
||||
// Add adds the selector string's matching nodes to those in the current
|
||||
// selection and returns a new Selection object.
|
||||
// The selector string is run in the context of the document of the current
|
||||
// Selection object.
|
||||
func (this *Selection) Add(selector string) *Selection {
|
||||
return this.AddNodes(findWithSelector([]*html.Node{this.document.rootNode}, selector)...)
|
||||
func (s *Selection) Add(selector string) *Selection {
|
||||
return s.AddNodes(findWithSelector([]*html.Node{s.document.rootNode}, selector)...)
|
||||
}
|
||||
|
||||
// AddSelection() adds the specified Selection object's nodes to those in the
|
||||
// AddSelection adds the specified Selection object's nodes to those in the
|
||||
// current selection and returns a new Selection object.
|
||||
func (this *Selection) AddSelection(sel *Selection) *Selection {
|
||||
func (s *Selection) AddSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.AddNodes()
|
||||
return s.AddNodes()
|
||||
}
|
||||
return this.AddNodes(sel.Nodes...)
|
||||
return s.AddNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// Union() is an alias for AddSelection().
|
||||
func (this *Selection) Union(sel *Selection) *Selection {
|
||||
return this.AddSelection(sel)
|
||||
// Union is an alias for AddSelection.
|
||||
func (s *Selection) Union(sel *Selection) *Selection {
|
||||
return s.AddSelection(sel)
|
||||
}
|
||||
|
||||
// AddNodes() adds the specified nodes to those in the
|
||||
// AddNodes adds the specified nodes to those in the
|
||||
// current selection and returns a new Selection object.
|
||||
func (this *Selection) AddNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, appendWithoutDuplicates(this.Nodes, nodes))
|
||||
func (s *Selection) AddNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, appendWithoutDuplicates(s.Nodes, nodes))
|
||||
}
|
||||
|
||||
// AndSelf() adds the previous set of elements on the stack to the current set.
|
||||
// AndSelf adds the previous set of elements on the stack to the current set.
|
||||
// It returns a new Selection object containing the current Selection combined
|
||||
// with the previous one.
|
||||
func (this *Selection) AndSelf() *Selection {
|
||||
return this.AddSelection(this.prevSel)
|
||||
func (s *Selection) AndSelf() *Selection {
|
||||
return s.AddSelection(s.prevSel)
|
||||
}
|
||||
|
||||
@@ -2,85 +2,84 @@ package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/cascadia"
|
||||
"code.google.com/p/go.net/html"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// Filter() reduces the set of matched elements to those that match the selector string.
|
||||
// Filter reduces the set of matched elements to those that match the selector string.
|
||||
// It returns a new Selection object for this subset of matching elements.
|
||||
func (this *Selection) Filter(selector string) *Selection {
|
||||
return pushStack(this, winnow(this, selector, true))
|
||||
func (s *Selection) Filter(selector string) *Selection {
|
||||
return pushStack(s, winnow(s, selector, true))
|
||||
}
|
||||
|
||||
// Not() removes elements from the Selection that match the selector string.
|
||||
// Not removes elements from the Selection that match the selector string.
|
||||
// It returns a new Selection object with the matching elements removed.
|
||||
func (this *Selection) Not(selector string) *Selection {
|
||||
return pushStack(this, winnow(this, selector, false))
|
||||
func (s *Selection) Not(selector string) *Selection {
|
||||
return pushStack(s, winnow(s, selector, false))
|
||||
}
|
||||
|
||||
// FilterFunction() reduces the set of matched elements to those that pass the function's test.
|
||||
// FilterFunction reduces the set of matched elements to those that pass the function's test.
|
||||
// It returns a new Selection object for this subset of elements.
|
||||
func (this *Selection) FilterFunction(f func(int, *Selection) bool) *Selection {
|
||||
return pushStack(this, winnowFunction(this, f, true))
|
||||
func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection {
|
||||
return pushStack(s, winnowFunction(s, f, true))
|
||||
}
|
||||
|
||||
// Not() removes elements from the Selection that pass the function's test.
|
||||
// NotFunction removes elements from the Selection that pass the function's test.
|
||||
// It returns a new Selection object with the matching elements removed.
|
||||
func (this *Selection) NotFunction(f func(int, *Selection) bool) *Selection {
|
||||
return pushStack(this, winnowFunction(this, f, false))
|
||||
func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection {
|
||||
return pushStack(s, winnowFunction(s, f, false))
|
||||
}
|
||||
|
||||
// FilterNodes() reduces the set of matched elements to those that match the specified nodes.
|
||||
// FilterNodes reduces the set of matched elements to those that match the specified nodes.
|
||||
// It returns a new Selection object for this subset of elements.
|
||||
func (this *Selection) FilterNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, winnowNodes(this, nodes, true))
|
||||
func (s *Selection) FilterNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, winnowNodes(s, nodes, true))
|
||||
}
|
||||
|
||||
// Not() removes elements from the Selection that match the specified nodes.
|
||||
// NotNodes removes elements from the Selection that match the specified nodes.
|
||||
// It returns a new Selection object with the matching elements removed.
|
||||
func (this *Selection) NotNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, winnowNodes(this, nodes, false))
|
||||
func (s *Selection) NotNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, winnowNodes(s, nodes, false))
|
||||
}
|
||||
|
||||
// FilterSelection() reduces the set of matched elements to those that match a
|
||||
// FilterSelection reduces the set of matched elements to those that match a
|
||||
// node in the specified Selection object.
|
||||
// It returns a new Selection object for this subset of elements.
|
||||
func (this *Selection) FilterSelection(s *Selection) *Selection {
|
||||
if s == nil {
|
||||
return pushStack(this, winnowNodes(this, nil, true))
|
||||
func (s *Selection) FilterSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return pushStack(s, winnowNodes(s, nil, true))
|
||||
}
|
||||
return pushStack(this, winnowNodes(this, s.Nodes, true))
|
||||
return pushStack(s, winnowNodes(s, sel.Nodes, true))
|
||||
}
|
||||
|
||||
// Not() removes elements from the Selection that match a node in the specified
|
||||
// Selection object.
|
||||
// It returns a new Selection object with the matching elements removed.
|
||||
func (this *Selection) NotSelection(s *Selection) *Selection {
|
||||
if s == nil {
|
||||
return pushStack(this, winnowNodes(this, nil, false))
|
||||
// NotSelection removes elements from the Selection that match a node in the specified
|
||||
// Selection object. It returns a new Selection object with the matching elements removed.
|
||||
func (s *Selection) NotSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return pushStack(s, winnowNodes(s, nil, false))
|
||||
}
|
||||
return pushStack(this, winnowNodes(this, s.Nodes, false))
|
||||
return pushStack(s, winnowNodes(s, sel.Nodes, false))
|
||||
}
|
||||
|
||||
// Intersection() is an alias for FilterSelection().
|
||||
func (this *Selection) Intersection(s *Selection) *Selection {
|
||||
return this.FilterSelection(s)
|
||||
// Intersection is an alias for FilterSelection.
|
||||
func (s *Selection) Intersection(sel *Selection) *Selection {
|
||||
return s.FilterSelection(sel)
|
||||
}
|
||||
|
||||
// Has() reduces the set of matched elements to those that have a descendant
|
||||
// Has reduces the set of matched elements to those that have a descendant
|
||||
// that matches the selector.
|
||||
// It returns a new Selection object with the matching elements.
|
||||
func (this *Selection) Has(selector string) *Selection {
|
||||
return this.HasSelection(this.document.Find(selector))
|
||||
func (s *Selection) Has(selector string) *Selection {
|
||||
return s.HasSelection(s.document.Find(selector))
|
||||
}
|
||||
|
||||
// HasNodes() reduces the set of matched elements to those that have a
|
||||
// HasNodes reduces the set of matched elements to those that have a
|
||||
// descendant that matches one of the nodes.
|
||||
// It returns a new Selection object with the matching elements.
|
||||
func (this *Selection) HasNodes(nodes ...*html.Node) *Selection {
|
||||
return this.FilterFunction(func(_ int, s *Selection) bool {
|
||||
func (s *Selection) HasNodes(nodes ...*html.Node) *Selection {
|
||||
return s.FilterFunction(func(_ int, sel *Selection) bool {
|
||||
// Add all nodes that contain one of the specified nodes
|
||||
for _, n := range nodes {
|
||||
if s.Contains(n) {
|
||||
if sel.Contains(n) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -88,23 +87,23 @@ func (this *Selection) HasNodes(nodes ...*html.Node) *Selection {
|
||||
})
|
||||
}
|
||||
|
||||
// HasSelection() reduces the set of matched elements to those that have a
|
||||
// HasSelection reduces the set of matched elements to those that have a
|
||||
// descendant that matches one of the nodes of the specified Selection object.
|
||||
// It returns a new Selection object with the matching elements.
|
||||
func (this *Selection) HasSelection(sel *Selection) *Selection {
|
||||
func (s *Selection) HasSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.HasNodes()
|
||||
return s.HasNodes()
|
||||
}
|
||||
return this.HasNodes(sel.Nodes...)
|
||||
return s.HasNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// End() ends the most recent filtering operation in the current chain and
|
||||
// End ends the most recent filtering operation in the current chain and
|
||||
// returns the set of matched elements to its previous state.
|
||||
func (this *Selection) End() *Selection {
|
||||
if this.prevSel != nil {
|
||||
return this.prevSel
|
||||
func (s *Selection) End() *Selection {
|
||||
if s.prevSel != nil {
|
||||
return s.prevSel
|
||||
}
|
||||
return newEmptySelection(this.document)
|
||||
return newEmptySelection(s.document)
|
||||
}
|
||||
|
||||
// Filter based on a selector string, and the indicator to keep (Filter) or
|
||||
@@ -115,13 +114,11 @@ func winnow(sel *Selection, selector string, keep bool) []*html.Node {
|
||||
// Optimize if keep is requested
|
||||
if keep {
|
||||
return cs.Filter(sel.Nodes)
|
||||
} else {
|
||||
// Use grep
|
||||
return grep(sel, func(i int, s *Selection) bool {
|
||||
return !cs.Match(s.Get(0))
|
||||
})
|
||||
}
|
||||
return nil
|
||||
// Use grep
|
||||
return grep(sel, func(i int, s *Selection) bool {
|
||||
return !cs.Match(s.Get(0))
|
||||
})
|
||||
}
|
||||
|
||||
// Filter based on an array of nodes, and the indicator to keep (Filter) or
|
||||
|
||||
+22
-9
@@ -1,19 +1,32 @@
|
||||
package goquery
|
||||
|
||||
// Each() iterates over a Selection object, executing a function for each
|
||||
// Each iterates over a Selection object, executing a function for each
|
||||
// matched element. It returns the current Selection object.
|
||||
func (this *Selection) Each(f func(int, *Selection)) *Selection {
|
||||
for i, n := range this.Nodes {
|
||||
f(i, newSingleSelection(n, this.document))
|
||||
func (s *Selection) Each(f func(int, *Selection)) *Selection {
|
||||
for i, n := range s.Nodes {
|
||||
f(i, newSingleSelection(n, s.document))
|
||||
}
|
||||
return this
|
||||
return s
|
||||
}
|
||||
|
||||
// Map() passes each element in the current matched set through a function,
|
||||
// EachWithBreak iterates over a Selection object, executing a function for each
|
||||
// matched element. It is identical to Each except that it is possible to break
|
||||
// out of the loop by returning false in the callback function. It returns the
|
||||
// current Selection object.
|
||||
func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection {
|
||||
for i, n := range s.Nodes {
|
||||
if !f(i, newSingleSelection(n, s.document)) {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Map passes each element in the current matched set through a function,
|
||||
// producing a slice of string holding the returned values.
|
||||
func (this *Selection) Map(f func(int, *Selection) string) (result []string) {
|
||||
for i, n := range this.Nodes {
|
||||
result = append(result, f(i, newSingleSelection(n, this.document)))
|
||||
func (s *Selection) Map(f func(int, *Selection) string) (result []string) {
|
||||
for i, n := range s.Nodes {
|
||||
result = append(result, f(i, newSingleSelection(n, s.document)))
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
+36
-1
@@ -1,8 +1,9 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/html"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
func TestEach(t *testing.T) {
|
||||
@@ -19,6 +20,21 @@ func TestEach(t *testing.T) {
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestEachWithBreak(t *testing.T) {
|
||||
var cnt int
|
||||
|
||||
sel := Doc().Find(".hero-unit .row-fluid").EachWithBreak(func(i int, n *Selection) bool {
|
||||
cnt++
|
||||
t.Logf("At index %v, node %v", i, n.Nodes[0].Data)
|
||||
return false
|
||||
}).Find("a")
|
||||
|
||||
if cnt != 1 {
|
||||
t.Errorf("Expected Each() to call function 1 time, got %v times.", cnt)
|
||||
}
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestEachEmptySelection(t *testing.T) {
|
||||
var cnt int
|
||||
|
||||
@@ -51,3 +67,22 @@ func TestMap(t *testing.T) {
|
||||
t.Errorf("Expected Map array result to have a length of 3, found %v.", len(vals))
|
||||
}
|
||||
}
|
||||
|
||||
func TestForRange(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-content")
|
||||
initLen := sel.Length()
|
||||
for i := range sel.Nodes {
|
||||
single := sel.Eq(i)
|
||||
//h, err := single.Html()
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//fmt.Println(i, h)
|
||||
if single.Length() != 1 {
|
||||
t.Errorf("%d: expected length of 1, got %d", i, single.Length())
|
||||
}
|
||||
}
|
||||
if sel.Length() != initLen {
|
||||
t.Errorf("expected initial selection to still have length %d, got %d", initLen, sel.Length())
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2012 The Go Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
# git gofmt pre-commit hook
|
||||
#
|
||||
# To use, store as .git/hooks/pre-commit inside your repository and make sure
|
||||
# it has execute permissions.
|
||||
#
|
||||
# This script does not handle file names that contain spaces.
|
||||
|
||||
# golint is purely informational, it doesn't fail with exit code != 0 if it finds something,
|
||||
# because it may find a lot of false positives. Just print out its result for information.
|
||||
echo "lint result (informational only):"
|
||||
golint .
|
||||
|
||||
# go vet returns 1 if an error was found. Exit the hook with this exit code.
|
||||
go vet ./...
|
||||
vetres=$?
|
||||
|
||||
# Check for gofmt problems and report if any.
|
||||
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$')
|
||||
[ -z "$gofiles" ] && echo "EXIT $vetres" && exit $vetres
|
||||
|
||||
unformatted=$(gofmt -l $gofiles)
|
||||
[ -z "$unformatted" ] && echo "EXIT $vetres" && exit $vetres
|
||||
|
||||
# Some files are not gofmt'd. Print message and fail.
|
||||
|
||||
echo >&2 "Go files must be formatted with gofmt. Please run:"
|
||||
for fn in $unformatted; do
|
||||
echo >&2 " gofmt -w $PWD/$fn"
|
||||
done
|
||||
|
||||
echo "EXIT 1"
|
||||
exit 1
|
||||
+22
-21
@@ -2,50 +2,51 @@ package goquery
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"code.google.com/p/go.net/html"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// Attr() gets the specified attribute's value for the first element in the
|
||||
// Attr gets the specified attribute's value for the first element in the
|
||||
// Selection. To get the value for each element individually, use a looping
|
||||
// construct such as Each() or Map() method.
|
||||
func (this *Selection) Attr(attrName string) (val string, exists bool) {
|
||||
if len(this.Nodes) == 0 {
|
||||
// construct such as Each or Map method.
|
||||
func (s *Selection) Attr(attrName string) (val string, exists bool) {
|
||||
if len(s.Nodes) == 0 {
|
||||
return
|
||||
}
|
||||
return getAttributeValue(attrName, this.Nodes[0])
|
||||
return getAttributeValue(attrName, s.Nodes[0])
|
||||
}
|
||||
|
||||
// Text() gets the combined text contents of each element in the set of matched
|
||||
// Text gets the combined text contents of each element in the set of matched
|
||||
// elements, including their descendants.
|
||||
func (this *Selection) Text() string {
|
||||
func (s *Selection) Text() string {
|
||||
var buf bytes.Buffer
|
||||
|
||||
// Slightly optimized vs calling Each(): no single selection object created
|
||||
for _, n := range this.Nodes {
|
||||
// Slightly optimized vs calling Each: no single selection object created
|
||||
for _, n := range s.Nodes {
|
||||
buf.WriteString(getNodeText(n))
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// Size() is an alias for Length().
|
||||
func (this *Selection) Size() int {
|
||||
return this.Length()
|
||||
// Size is an alias for Length.
|
||||
func (s *Selection) Size() int {
|
||||
return s.Length()
|
||||
}
|
||||
|
||||
// Length() returns the number of elements in the Selection object.
|
||||
func (this *Selection) Length() int {
|
||||
return len(this.Nodes)
|
||||
// Length returns the number of elements in the Selection object.
|
||||
func (s *Selection) Length() int {
|
||||
return len(s.Nodes)
|
||||
}
|
||||
|
||||
// Html() gets the HTML contents of the first element in the set of matched
|
||||
// Html gets the HTML contents of the first element in the set of matched
|
||||
// elements. It includes text and comment nodes.
|
||||
func (this *Selection) Html() (ret string, e error) {
|
||||
func (s *Selection) Html() (ret string, e error) {
|
||||
// Since there is no .innerHtml, the HTML content must be re-created from
|
||||
// the nodes usint html.Render().
|
||||
// the nodes using html.Render.
|
||||
var buf bytes.Buffer
|
||||
|
||||
if len(this.Nodes) > 0 {
|
||||
for c := this.Nodes[0].FirstChild; c != nil; c = c.NextSibling {
|
||||
if len(s.Nodes) > 0 {
|
||||
for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling {
|
||||
e = html.Render(&buf, c)
|
||||
if e != nil {
|
||||
return
|
||||
|
||||
@@ -61,3 +61,25 @@ func TestHtml(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNbsp(t *testing.T) {
|
||||
src := `<p>Some text</p>`
|
||||
d, err := NewDocumentFromReader(strings.NewReader(src))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
txt := d.Find("p").Text()
|
||||
ix := strings.Index(txt, "\u00a0")
|
||||
if ix != 4 {
|
||||
t.Errorf("Text: expected a non-breaking space at index 4, got %d", ix)
|
||||
}
|
||||
|
||||
h, err := d.Find("p").Html()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ix = strings.Index(h, "\u00a0")
|
||||
if ix != 4 {
|
||||
t.Errorf("Html: expected a non-breaking space at index 4, got %d", ix)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,57 +1,57 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/cascadia"
|
||||
"code.google.com/p/go.net/html"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"code.google.com/p/cascadia"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// Is() checks the current matched set of elements against a selector and
|
||||
var rxClassTrim = regexp.MustCompile("[\t\r\n]")
|
||||
|
||||
// Is checks the current matched set of elements against a selector and
|
||||
// returns true if at least one of these elements matches.
|
||||
func (this *Selection) Is(selector string) bool {
|
||||
if len(this.Nodes) > 0 {
|
||||
func (s *Selection) Is(selector string) bool {
|
||||
if len(s.Nodes) > 0 {
|
||||
// Attempt a match with the selector
|
||||
cs := cascadia.MustCompile(selector)
|
||||
if len(this.Nodes) == 1 {
|
||||
return cs.Match(this.Nodes[0])
|
||||
} else {
|
||||
return len(cs.Filter(this.Nodes)) > 0
|
||||
if len(s.Nodes) == 1 {
|
||||
return cs.Match(s.Nodes[0])
|
||||
}
|
||||
return len(cs.Filter(s.Nodes)) > 0
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// IsFunction() checks the current matched set of elements against a predicate and
|
||||
// IsFunction checks the current matched set of elements against a predicate and
|
||||
// returns true if at least one of these elements matches.
|
||||
func (this *Selection) IsFunction(f func(int, *Selection) bool) bool {
|
||||
return this.FilterFunction(f).Length() > 0
|
||||
func (s *Selection) IsFunction(f func(int, *Selection) bool) bool {
|
||||
return s.FilterFunction(f).Length() > 0
|
||||
}
|
||||
|
||||
// IsSelection() checks the current matched set of elements against a Selection object
|
||||
// IsSelection checks the current matched set of elements against a Selection object
|
||||
// and returns true if at least one of these elements matches.
|
||||
func (this *Selection) IsSelection(s *Selection) bool {
|
||||
return this.FilterSelection(s).Length() > 0
|
||||
func (s *Selection) IsSelection(sel *Selection) bool {
|
||||
return s.FilterSelection(sel).Length() > 0
|
||||
}
|
||||
|
||||
// IsNodes() checks the current matched set of elements against the specified nodes
|
||||
// IsNodes checks the current matched set of elements against the specified nodes
|
||||
// and returns true if at least one of these elements matches.
|
||||
func (this *Selection) IsNodes(nodes ...*html.Node) bool {
|
||||
return this.FilterNodes(nodes...).Length() > 0
|
||||
func (s *Selection) IsNodes(nodes ...*html.Node) bool {
|
||||
return s.FilterNodes(nodes...).Length() > 0
|
||||
}
|
||||
|
||||
// HasClass() determines whether any of the matched elements are assigned the
|
||||
// HasClass determines whether any of the matched elements are assigned the
|
||||
// given class.
|
||||
func (this *Selection) HasClass(class string) bool {
|
||||
var rx = regexp.MustCompile("[\t\r\n]")
|
||||
|
||||
func (s *Selection) HasClass(class string) bool {
|
||||
class = " " + class + " "
|
||||
for _, n := range this.Nodes {
|
||||
for _, n := range s.Nodes {
|
||||
// Applies only to element nodes
|
||||
if n.Type == html.ElementNode {
|
||||
if elClass, ok := getAttributeValue("class", n); ok {
|
||||
elClass = rx.ReplaceAllString(" "+elClass+" ", " ")
|
||||
elClass = rxClassTrim.ReplaceAllString(" "+elClass+" ", " ")
|
||||
if strings.Index(elClass, class) > -1 {
|
||||
return true
|
||||
}
|
||||
@@ -61,11 +61,11 @@ func (this *Selection) HasClass(class string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Contains() returns true if the specified Node is within,
|
||||
// Contains returns true if the specified Node is within,
|
||||
// at any depth, one of the nodes in the Selection object.
|
||||
// It is NOT inclusive, to behave like jQuery's implementation, and
|
||||
// unlike Javascript's .contains(), so if the contained
|
||||
// unlike Javascript's .contains, so if the contained
|
||||
// node is itself in the selection, it returns false.
|
||||
func (this *Selection) Contains(n *html.Node) bool {
|
||||
return sliceContains(this.Nodes, n)
|
||||
func (s *Selection) Contains(n *html.Node) bool {
|
||||
return sliceContains(s.Nodes, n)
|
||||
}
|
||||
|
||||
+146
-148
@@ -2,7 +2,7 @@ package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/cascadia"
|
||||
"code.google.com/p/go.net/html"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
type siblingType int
|
||||
@@ -20,85 +20,85 @@ const (
|
||||
siblingAllIncludingNonElements
|
||||
)
|
||||
|
||||
// Find() gets the descendants of each element in the current set of matched
|
||||
// Find gets the descendants of each element in the current set of matched
|
||||
// elements, filtered by a selector. It returns a new Selection object
|
||||
// containing these matched elements.
|
||||
func (this *Selection) Find(selector string) *Selection {
|
||||
return pushStack(this, findWithSelector(this.Nodes, selector))
|
||||
func (s *Selection) Find(selector string) *Selection {
|
||||
return pushStack(s, findWithSelector(s.Nodes, selector))
|
||||
}
|
||||
|
||||
// FindSelection() gets the descendants of each element in the current
|
||||
// FindSelection gets the descendants of each element in the current
|
||||
// Selection, filtered by a Selection. It returns a new Selection object
|
||||
// containing these matched elements.
|
||||
func (this *Selection) FindSelection(sel *Selection) *Selection {
|
||||
func (s *Selection) FindSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return pushStack(this, nil)
|
||||
return pushStack(s, nil)
|
||||
}
|
||||
return this.FindNodes(sel.Nodes...)
|
||||
return s.FindNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// FindNodes() gets the descendants of each element in the current
|
||||
// FindNodes gets the descendants of each element in the current
|
||||
// Selection, filtered by some nodes. It returns a new Selection object
|
||||
// containing these matched elements.
|
||||
func (this *Selection) FindNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
|
||||
if sliceContains(this.Nodes, n) {
|
||||
func (s *Selection) FindNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
|
||||
if sliceContains(s.Nodes, n) {
|
||||
return []*html.Node{n}
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
||||
// Contents() gets the children of each element in the Selection,
|
||||
// Contents gets the children of each element in the Selection,
|
||||
// including text and comment nodes. It returns a new Selection object
|
||||
// containing these elements.
|
||||
func (this *Selection) Contents() *Selection {
|
||||
return pushStack(this, getChildrenNodes(this.Nodes, siblingAllIncludingNonElements))
|
||||
func (s *Selection) Contents() *Selection {
|
||||
return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements))
|
||||
}
|
||||
|
||||
// ContentsFiltered() gets the children of each element in the Selection,
|
||||
// ContentsFiltered gets the children of each element in the Selection,
|
||||
// filtered by the specified selector. It returns a new Selection
|
||||
// object containing these elements. Since selectors only act on Element nodes,
|
||||
// this function is an alias to ChildrenFiltered() unless the selector is empty,
|
||||
// in which case it is an alias to Contents().
|
||||
func (this *Selection) ContentsFiltered(selector string) *Selection {
|
||||
// this function is an alias to ChildrenFiltered unless the selector is empty,
|
||||
// in which case it is an alias to Contents.
|
||||
func (s *Selection) ContentsFiltered(selector string) *Selection {
|
||||
if selector != "" {
|
||||
return this.ChildrenFiltered(selector)
|
||||
return s.ChildrenFiltered(selector)
|
||||
}
|
||||
return this.Contents()
|
||||
return s.Contents()
|
||||
}
|
||||
|
||||
// Children() gets the child elements of each element in the Selection.
|
||||
// Children gets the child elements of each element in the Selection.
|
||||
// It returns a new Selection object containing these elements.
|
||||
func (this *Selection) Children() *Selection {
|
||||
return pushStack(this, getChildrenNodes(this.Nodes, siblingAll))
|
||||
func (s *Selection) Children() *Selection {
|
||||
return pushStack(s, getChildrenNodes(s.Nodes, siblingAll))
|
||||
}
|
||||
|
||||
// ChildrenFiltered() gets the child elements of each element in the Selection,
|
||||
// ChildrenFiltered gets the child elements of each element in the Selection,
|
||||
// filtered by the specified selector. It returns a new
|
||||
// Selection object containing these elements.
|
||||
func (this *Selection) ChildrenFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getChildrenNodes(this.Nodes, siblingAll), selector)
|
||||
func (s *Selection) ChildrenFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), selector)
|
||||
}
|
||||
|
||||
// Parent() gets the parent of each element in the Selection. It returns a
|
||||
// Parent gets the parent of each element in the Selection. It returns a
|
||||
// new Selection object containing the matched elements.
|
||||
func (this *Selection) Parent() *Selection {
|
||||
return pushStack(this, getParentNodes(this.Nodes))
|
||||
func (s *Selection) Parent() *Selection {
|
||||
return pushStack(s, getParentNodes(s.Nodes))
|
||||
}
|
||||
|
||||
// ParentFiltered() gets the parent of each element in the Selection filtered by a
|
||||
// ParentFiltered gets the parent of each element in the Selection filtered by a
|
||||
// selector. It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) ParentFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getParentNodes(this.Nodes), selector)
|
||||
func (s *Selection) ParentFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getParentNodes(s.Nodes), selector)
|
||||
}
|
||||
|
||||
// Closest() gets the first element that matches the selector by testing the
|
||||
// Closest gets the first element that matches the selector by testing the
|
||||
// element itself and traversing up through its ancestors in the DOM tree.
|
||||
func (this *Selection) Closest(selector string) *Selection {
|
||||
func (s *Selection) Closest(selector string) *Selection {
|
||||
cs := cascadia.MustCompile(selector)
|
||||
|
||||
return pushStack(this, mapNodes(this.Nodes, func(i int, n *html.Node) []*html.Node {
|
||||
return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node {
|
||||
// For each node in the selection, test the node itself, then each parent
|
||||
// until a match is found.
|
||||
for ; n != nil; n = n.Parent {
|
||||
@@ -110,10 +110,10 @@ func (this *Selection) Closest(selector string) *Selection {
|
||||
}))
|
||||
}
|
||||
|
||||
// ClosestNodes() gets the first element that matches one of the nodes by testing the
|
||||
// ClosestNodes gets the first element that matches one of the nodes by testing the
|
||||
// element itself and traversing up through its ancestors in the DOM tree.
|
||||
func (this *Selection) ClosestNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, mapNodes(this.Nodes, func(i int, n *html.Node) []*html.Node {
|
||||
func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node {
|
||||
// For each node in the selection, test the node itself, then each parent
|
||||
// until a match is found.
|
||||
for ; n != nil; n = n.Parent {
|
||||
@@ -125,242 +125,242 @@ func (this *Selection) ClosestNodes(nodes ...*html.Node) *Selection {
|
||||
}))
|
||||
}
|
||||
|
||||
// ClosestSelection() gets the first element that matches one of the nodes in the
|
||||
// ClosestSelection gets the first element that matches one of the nodes in the
|
||||
// Selection by testing the element itself and traversing up through its ancestors
|
||||
// in the DOM tree.
|
||||
func (this *Selection) ClosestSelection(s *Selection) *Selection {
|
||||
if s == nil {
|
||||
return pushStack(this, nil)
|
||||
func (s *Selection) ClosestSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return pushStack(s, nil)
|
||||
}
|
||||
return this.ClosestNodes(s.Nodes...)
|
||||
return s.ClosestNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// Parents() gets the ancestors of each element in the current Selection. It
|
||||
// Parents gets the ancestors of each element in the current Selection. It
|
||||
// returns a new Selection object with the matched elements.
|
||||
func (this *Selection) Parents() *Selection {
|
||||
return pushStack(this, getParentsNodes(this.Nodes, "", nil))
|
||||
func (s *Selection) Parents() *Selection {
|
||||
return pushStack(s, getParentsNodes(s.Nodes, "", nil))
|
||||
}
|
||||
|
||||
// ParentsFiltered() gets the ancestors of each element in the current
|
||||
// ParentsFiltered gets the ancestors of each element in the current
|
||||
// Selection. It returns a new Selection object with the matched elements.
|
||||
func (this *Selection) ParentsFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getParentsNodes(this.Nodes, "", nil), selector)
|
||||
func (s *Selection) ParentsFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getParentsNodes(s.Nodes, "", nil), selector)
|
||||
}
|
||||
|
||||
// ParentsUntil() gets the ancestors of each element in the Selection, up to but
|
||||
// ParentsUntil gets the ancestors of each element in the Selection, up to but
|
||||
// not including the element matched by the selector. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) ParentsUntil(selector string) *Selection {
|
||||
return pushStack(this, getParentsNodes(this.Nodes, selector, nil))
|
||||
func (s *Selection) ParentsUntil(selector string) *Selection {
|
||||
return pushStack(s, getParentsNodes(s.Nodes, selector, nil))
|
||||
}
|
||||
|
||||
// ParentsUntilSelection() gets the ancestors of each element in the Selection,
|
||||
// ParentsUntilSelection gets the ancestors of each element in the Selection,
|
||||
// up to but not including the elements in the specified Selection. It returns a
|
||||
// new Selection object containing the matched elements.
|
||||
func (this *Selection) ParentsUntilSelection(sel *Selection) *Selection {
|
||||
func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.Parents()
|
||||
return s.Parents()
|
||||
}
|
||||
return this.ParentsUntilNodes(sel.Nodes...)
|
||||
return s.ParentsUntilNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// ParentsUntilNodes() gets the ancestors of each element in the Selection,
|
||||
// ParentsUntilNodes gets the ancestors of each element in the Selection,
|
||||
// up to but not including the specified nodes. It returns a
|
||||
// new Selection object containing the matched elements.
|
||||
func (this *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, getParentsNodes(this.Nodes, "", nodes))
|
||||
func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, getParentsNodes(s.Nodes, "", nodes))
|
||||
}
|
||||
|
||||
// ParentsFilteredUntil() is like ParentsUntil(), with the option to filter the
|
||||
// ParentsFilteredUntil is like ParentsUntil, with the option to filter the
|
||||
// results based on a selector string. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) ParentsFilteredUntil(filterSelector string, untilSelector string) *Selection {
|
||||
return filterAndPush(this, getParentsNodes(this.Nodes, untilSelector, nil), filterSelector)
|
||||
func (s *Selection) ParentsFilteredUntil(filterSelector string, untilSelector string) *Selection {
|
||||
return filterAndPush(s, getParentsNodes(s.Nodes, untilSelector, nil), filterSelector)
|
||||
}
|
||||
|
||||
// ParentsFilteredUntilSelection() is like ParentsUntilSelection(), with the
|
||||
// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the
|
||||
// option to filter the results based on a selector string. It returns a new
|
||||
// Selection object containing the matched elements.
|
||||
func (this *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
|
||||
func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.ParentsFiltered(filterSelector)
|
||||
return s.ParentsFiltered(filterSelector)
|
||||
}
|
||||
return this.ParentsFilteredUntilNodes(filterSelector, sel.Nodes...)
|
||||
return s.ParentsFilteredUntilNodes(filterSelector, sel.Nodes...)
|
||||
}
|
||||
|
||||
// ParentsFilteredUntilNodes() is like ParentsUntilNodes(), with the
|
||||
// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the
|
||||
// option to filter the results based on a selector string. It returns a new
|
||||
// Selection object containing the matched elements.
|
||||
func (this *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
|
||||
return filterAndPush(this, getParentsNodes(this.Nodes, "", nodes), filterSelector)
|
||||
func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
|
||||
return filterAndPush(s, getParentsNodes(s.Nodes, "", nodes), filterSelector)
|
||||
}
|
||||
|
||||
// Siblings() gets the siblings of each element in the Selection. It returns
|
||||
// Siblings gets the siblings of each element in the Selection. It returns
|
||||
// a new Selection object containing the matched elements.
|
||||
func (this *Selection) Siblings() *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingAll, "", nil))
|
||||
func (s *Selection) Siblings() *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, "", nil))
|
||||
}
|
||||
|
||||
// SiblingsFiltered() gets the siblings of each element in the Selection
|
||||
// SiblingsFiltered gets the siblings of each element in the Selection
|
||||
// filtered by a selector. It returns a new Selection object containing the
|
||||
// matched elements.
|
||||
func (this *Selection) SiblingsFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingAll, "", nil), selector)
|
||||
func (s *Selection) SiblingsFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, "", nil), selector)
|
||||
}
|
||||
|
||||
// Next() gets the immediately following sibling of each element in the
|
||||
// Next gets the immediately following sibling of each element in the
|
||||
// Selection. It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) Next() *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingNext, "", nil))
|
||||
func (s *Selection) Next() *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, "", nil))
|
||||
}
|
||||
|
||||
// NextFiltered() gets the immediately following sibling of each element in the
|
||||
// NextFiltered gets the immediately following sibling of each element in the
|
||||
// Selection filtered by a selector. It returns a new Selection object
|
||||
// containing the matched elements.
|
||||
func (this *Selection) NextFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingNext, "", nil), selector)
|
||||
func (s *Selection) NextFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, "", nil), selector)
|
||||
}
|
||||
|
||||
// NextAll() gets all the following siblings of each element in the
|
||||
// NextAll gets all the following siblings of each element in the
|
||||
// Selection. It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) NextAll() *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingNextAll, "", nil))
|
||||
func (s *Selection) NextAll() *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, "", nil))
|
||||
}
|
||||
|
||||
// NextAllFiltered() gets all the following siblings of each element in the
|
||||
// NextAllFiltered gets all the following siblings of each element in the
|
||||
// Selection filtered by a selector. It returns a new Selection object
|
||||
// containing the matched elements.
|
||||
func (this *Selection) NextAllFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingNextAll, "", nil), selector)
|
||||
func (s *Selection) NextAllFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, "", nil), selector)
|
||||
}
|
||||
|
||||
// Prev() gets the immediately preceding sibling of each element in the
|
||||
// Prev gets the immediately preceding sibling of each element in the
|
||||
// Selection. It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) Prev() *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingPrev, "", nil))
|
||||
func (s *Selection) Prev() *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, "", nil))
|
||||
}
|
||||
|
||||
// PrevFiltered() gets the immediately preceding sibling of each element in the
|
||||
// PrevFiltered gets the immediately preceding sibling of each element in the
|
||||
// Selection filtered by a selector. It returns a new Selection object
|
||||
// containing the matched elements.
|
||||
func (this *Selection) PrevFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingPrev, "", nil), selector)
|
||||
func (s *Selection) PrevFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, "", nil), selector)
|
||||
}
|
||||
|
||||
// PrevAll() gets all the preceding siblings of each element in the
|
||||
// PrevAll gets all the preceding siblings of each element in the
|
||||
// Selection. It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) PrevAll() *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingPrevAll, "", nil))
|
||||
func (s *Selection) PrevAll() *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, "", nil))
|
||||
}
|
||||
|
||||
// PrevAllFiltered() gets all the preceding siblings of each element in the
|
||||
// PrevAllFiltered gets all the preceding siblings of each element in the
|
||||
// Selection filtered by a selector. It returns a new Selection object
|
||||
// containing the matched elements.
|
||||
func (this *Selection) PrevAllFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingPrevAll, "", nil), selector)
|
||||
func (s *Selection) PrevAllFiltered(selector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, "", nil), selector)
|
||||
}
|
||||
|
||||
// NextUntil() gets all following siblings of each element up to but not
|
||||
// NextUntil gets all following siblings of each element up to but not
|
||||
// including the element matched by the selector. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) NextUntil(selector string) *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingNextUntil,
|
||||
func (s *Selection) NextUntil(selector string) *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,
|
||||
selector, nil))
|
||||
}
|
||||
|
||||
// NextUntilSelection() gets all following siblings of each element up to but not
|
||||
// NextUntilSelection gets all following siblings of each element up to but not
|
||||
// including the element matched by the Selection. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) NextUntilSelection(sel *Selection) *Selection {
|
||||
func (s *Selection) NextUntilSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.NextAll()
|
||||
return s.NextAll()
|
||||
}
|
||||
return this.NextUntilNodes(sel.Nodes...)
|
||||
return s.NextUntilNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// NextUntilNodes() gets all following siblings of each element up to but not
|
||||
// NextUntilNodes gets all following siblings of each element up to but not
|
||||
// including the element matched by the nodes. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) NextUntilNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingNextUntil,
|
||||
func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,
|
||||
"", nodes))
|
||||
}
|
||||
|
||||
// PrevUntil() gets all preceding siblings of each element up to but not
|
||||
// PrevUntil gets all preceding siblings of each element up to but not
|
||||
// including the element matched by the selector. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) PrevUntil(selector string) *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingPrevUntil,
|
||||
func (s *Selection) PrevUntil(selector string) *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
|
||||
selector, nil))
|
||||
}
|
||||
|
||||
// PrevUntilSelection() gets all preceding siblings of each element up to but not
|
||||
// PrevUntilSelection gets all preceding siblings of each element up to but not
|
||||
// including the element matched by the Selection. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) PrevUntilSelection(sel *Selection) *Selection {
|
||||
func (s *Selection) PrevUntilSelection(sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.PrevAll()
|
||||
return s.PrevAll()
|
||||
}
|
||||
return this.PrevUntilNodes(sel.Nodes...)
|
||||
return s.PrevUntilNodes(sel.Nodes...)
|
||||
}
|
||||
|
||||
// PrevUntilNodes() gets all preceding siblings of each element up to but not
|
||||
// PrevUntilNodes gets all preceding siblings of each element up to but not
|
||||
// including the element matched by the nodes. It returns a new Selection
|
||||
// object containing the matched elements.
|
||||
func (this *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, getSiblingNodes(this.Nodes, siblingPrevUntil,
|
||||
func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
|
||||
"", nodes))
|
||||
}
|
||||
|
||||
// NextFilteredUntil() is like NextUntil(), with the option to filter
|
||||
// NextFilteredUntil is like NextUntil, with the option to filter
|
||||
// the results based on a selector string.
|
||||
// It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) NextFilteredUntil(filterSelector string, untilSelector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingNextUntil,
|
||||
func (s *Selection) NextFilteredUntil(filterSelector string, untilSelector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,
|
||||
untilSelector, nil), filterSelector)
|
||||
}
|
||||
|
||||
// NextFilteredUntilSelection() is like NextUntilSelection(), with the
|
||||
// NextFilteredUntilSelection is like NextUntilSelection, with the
|
||||
// option to filter the results based on a selector string. It returns a new
|
||||
// Selection object containing the matched elements.
|
||||
func (this *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
|
||||
func (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.NextFiltered(filterSelector)
|
||||
return s.NextFiltered(filterSelector)
|
||||
}
|
||||
return this.NextFilteredUntilNodes(filterSelector, sel.Nodes...)
|
||||
return s.NextFilteredUntilNodes(filterSelector, sel.Nodes...)
|
||||
}
|
||||
|
||||
// NextFilteredUntilNodes() is like NextUntilNodes(), with the
|
||||
// NextFilteredUntilNodes is like NextUntilNodes, with the
|
||||
// option to filter the results based on a selector string. It returns a new
|
||||
// Selection object containing the matched elements.
|
||||
func (this *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingNextUntil,
|
||||
func (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,
|
||||
"", nodes), filterSelector)
|
||||
}
|
||||
|
||||
// PrevFilteredUntil() is like PrevUntil(), with the option to filter
|
||||
// PrevFilteredUntil is like PrevUntil, with the option to filter
|
||||
// the results based on a selector string.
|
||||
// It returns a new Selection object containing the matched elements.
|
||||
func (this *Selection) PrevFilteredUntil(filterSelector string, untilSelector string) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingPrevUntil,
|
||||
func (s *Selection) PrevFilteredUntil(filterSelector string, untilSelector string) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
|
||||
untilSelector, nil), filterSelector)
|
||||
}
|
||||
|
||||
// PrevFilteredUntilSelection() is like PrevUntilSelection(), with the
|
||||
// PrevFilteredUntilSelection is like PrevUntilSelection, with the
|
||||
// option to filter the results based on a selector string. It returns a new
|
||||
// Selection object containing the matched elements.
|
||||
func (this *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
|
||||
func (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
|
||||
if sel == nil {
|
||||
return this.PrevFiltered(filterSelector)
|
||||
return s.PrevFiltered(filterSelector)
|
||||
}
|
||||
return this.PrevFilteredUntilNodes(filterSelector, sel.Nodes...)
|
||||
return s.PrevFilteredUntilNodes(filterSelector, sel.Nodes...)
|
||||
}
|
||||
|
||||
// PrevFilteredUntilNodes() is like PrevUntilNodes(), with the
|
||||
// PrevFilteredUntilNodes is like PrevUntilNodes, with the
|
||||
// option to filter the results based on a selector string. It returns a new
|
||||
// Selection object containing the matched elements.
|
||||
func (this *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
|
||||
return filterAndPush(this, getSiblingNodes(this.Nodes, siblingPrevUntil,
|
||||
func (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
|
||||
return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
|
||||
"", nodes), filterSelector)
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ func findWithSelector(nodes []*html.Node, selector string) []*html.Node {
|
||||
sel := cascadia.MustCompile(selector)
|
||||
// Map nodes to find the matches within the children of each node
|
||||
return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) {
|
||||
// Go down one level, becausejQuery's Find() selects only within descendants
|
||||
// Go down one level, becausejQuery's Find selects only within descendants
|
||||
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||
if c.Type == html.ElementNode {
|
||||
result = append(result, sel.MatchAll(c)...)
|
||||
@@ -389,7 +389,7 @@ func findWithSelector(nodes []*html.Node, selector string) []*html.Node {
|
||||
})
|
||||
}
|
||||
|
||||
// Internal implementation to get all parent nodes, stopping at the specified
|
||||
// Internal implementation to get all parent nodes, stopping at the specified
|
||||
// node (or nil if no stop).
|
||||
func getParentsNodes(nodes []*html.Node, stopSelector string, stopNodes []*html.Node) []*html.Node {
|
||||
return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) {
|
||||
@@ -416,7 +416,7 @@ func getParentsNodes(nodes []*html.Node, stopSelector string, stopNodes []*html.
|
||||
func getSiblingNodes(nodes []*html.Node, st siblingType, untilSelector string, untilNodes []*html.Node) []*html.Node {
|
||||
var f func(*html.Node) bool
|
||||
|
||||
// If the requested siblings are ...Until(), create the test function to
|
||||
// If the requested siblings are ...Until, create the test function to
|
||||
// determine if the until condition is reached (returns true if it is)
|
||||
if st == siblingNextUntil || st == siblingPrevUntil {
|
||||
f = func(n *html.Node) bool {
|
||||
@@ -488,16 +488,14 @@ func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *htm
|
||||
}
|
||||
if ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements {
|
||||
return
|
||||
} else {
|
||||
// Not a valid node, try again from this one
|
||||
cur = ret
|
||||
}
|
||||
// Not a valid node, try again from this one
|
||||
cur = ret
|
||||
}
|
||||
panic("Unreachable code reached.")
|
||||
}
|
||||
|
||||
for c := iter(nil); c != nil; c = iter(c) {
|
||||
// If this is an ...Until() case, test before append (returns true
|
||||
// If this is an ...Until case, test before append (returns true
|
||||
// if the until condition is reached)
|
||||
if st == siblingNextUntil || st == siblingPrevUntil {
|
||||
if untilFunc(c) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -673,3 +674,24 @@ func TestClosestNodesRollback(t *testing.T) {
|
||||
sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestIssue26(t *testing.T) {
|
||||
img1 := `<img src="assets/images/gallery/thumb-1.jpg" alt="150x150" />`
|
||||
img2 := `<img alt="150x150" src="assets/images/gallery/thumb-1.jpg" />`
|
||||
cases := []struct {
|
||||
s string
|
||||
l int
|
||||
}{
|
||||
{s: img1 + img2, l: 2},
|
||||
{s: img1, l: 1},
|
||||
{s: img2, l: 1},
|
||||
}
|
||||
for _, c := range cases {
|
||||
doc, err := NewDocumentFromReader(strings.NewReader(c.s))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
sel := doc.Find("img[src]")
|
||||
AssertLength(t, sel.Nodes, c.l)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/html"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// Document represents an HTML document to be manipulated. Unlike jQuery, which
|
||||
@@ -17,44 +20,67 @@ type Document struct {
|
||||
rootNode *html.Node
|
||||
}
|
||||
|
||||
// NewDocumentFromNode() is a Document constructor that takes a root html Node
|
||||
// NewDocumentFromNode is a Document constructor that takes a root html Node
|
||||
// as argument.
|
||||
func NewDocumentFromNode(root *html.Node) (d *Document) {
|
||||
func NewDocumentFromNode(root *html.Node) *Document {
|
||||
return newDocument(root, nil)
|
||||
}
|
||||
|
||||
// NewDocument() is a Document constructor that takes a string URL as argument.
|
||||
// NewDocument is a Document constructor that takes a string URL as argument.
|
||||
// It loads the specified document, parses it, and stores the root Document
|
||||
// node, ready to be manipulated.
|
||||
func NewDocument(url string) (d *Document, e error) {
|
||||
func NewDocument(url string) (*Document, error) {
|
||||
// Load the URL
|
||||
res, e := http.Get(url)
|
||||
if e != nil {
|
||||
return
|
||||
return nil, e
|
||||
}
|
||||
return NewDocumentFromResponse(res)
|
||||
}
|
||||
|
||||
// NewDocumentFromReader returns a Document from a generic reader.
|
||||
// It returns an error as second value if the reader's data cannot be parsed
|
||||
// as html. It does *not* check if the reader is also an io.Closer, so the
|
||||
// provided reader is never closed by this call, it is the responsibility
|
||||
// of the caller to close it if required.
|
||||
func NewDocumentFromReader(r io.Reader) (*Document, error) {
|
||||
root, e := html.Parse(r)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
return newDocument(root, nil), nil
|
||||
}
|
||||
|
||||
// NewDocumentFromResponse is another Document constructor that takes an http resonse as argument.
|
||||
// It loads the specified response's document, parses it, and stores the root Document
|
||||
// node, ready to be manipulated. The response's body is closed on return.
|
||||
func NewDocumentFromResponse(res *http.Response) (*Document, error) {
|
||||
if res == nil {
|
||||
return nil, errors.New("Response is nil pointer")
|
||||
}
|
||||
|
||||
defer res.Body.Close()
|
||||
|
||||
// Parse the HTML into nodes
|
||||
root, e := html.Parse(res.Body)
|
||||
if e != nil {
|
||||
return
|
||||
return nil, e
|
||||
}
|
||||
|
||||
// Create and fill the document
|
||||
d = newDocument(root, res.Request.URL)
|
||||
return
|
||||
return newDocument(root, res.Request.URL), nil
|
||||
}
|
||||
|
||||
// Private constructor, make sure all fields are correctly filled.
|
||||
func newDocument(root *html.Node, url *url.URL) (d *Document) {
|
||||
func newDocument(root *html.Node, url *url.URL) *Document {
|
||||
// Create and fill the document
|
||||
d = &Document{nil, url, root}
|
||||
d := &Document{nil, url, root}
|
||||
d.Selection = newSingleSelection(root, d)
|
||||
return
|
||||
return d
|
||||
}
|
||||
|
||||
// Selection represents a collection of nodes matching some criteria. The
|
||||
// initial Selection can be created by using Document.Find(), and then
|
||||
// initial Selection can be created by using Document.Find, and then
|
||||
// manipulated using the jQuery-like chainable syntax and methods.
|
||||
type Selection struct {
|
||||
Nodes []*html.Node
|
||||
|
||||
+69
-10
@@ -1,10 +1,12 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/html"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
// Test helper functions and members
|
||||
@@ -74,17 +76,19 @@ func AssertSelectionIs(t *testing.T, sel *Selection, is ...string) {
|
||||
}
|
||||
|
||||
func LoadDoc(page string) *Document {
|
||||
if f, e := os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil {
|
||||
var f *os.File
|
||||
var e error
|
||||
|
||||
if f, e = os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil {
|
||||
panic(e.Error())
|
||||
} else {
|
||||
defer f.Close()
|
||||
if node, e := html.Parse(f); e != nil {
|
||||
panic(e.Error())
|
||||
} else {
|
||||
return NewDocumentFromNode(node)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
defer f.Close()
|
||||
|
||||
var node *html.Node
|
||||
if node, e = html.Parse(f); e != nil {
|
||||
panic(e.Error())
|
||||
}
|
||||
return NewDocumentFromNode(node)
|
||||
}
|
||||
|
||||
func TestNewDocument(t *testing.T) {
|
||||
@@ -99,3 +103,58 @@ func TestNewDocument(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewDocumentFromReader(t *testing.T) {
|
||||
cases := []struct {
|
||||
src string
|
||||
err bool
|
||||
sel string
|
||||
cnt int
|
||||
}{
|
||||
0: {
|
||||
src: `
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<body>
|
||||
<h1>Hi</h1>
|
||||
</body>
|
||||
</html>`,
|
||||
sel: "h1",
|
||||
cnt: 1,
|
||||
},
|
||||
1: {
|
||||
// Actually pretty hard to make html.Parse return an error
|
||||
// based on content...
|
||||
src: `<html><body><aef<eqf>>>qq></body></ht>`,
|
||||
},
|
||||
}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
for i, c := range cases {
|
||||
buf.Reset()
|
||||
buf.WriteString(c.src)
|
||||
|
||||
d, e := NewDocumentFromReader(buf)
|
||||
if (e != nil) != c.err {
|
||||
if c.err {
|
||||
t.Errorf("[%d] - expected error, got none", i)
|
||||
} else {
|
||||
t.Errorf("[%d] - expected no error, got %s", i, e)
|
||||
}
|
||||
}
|
||||
if c.sel != "" {
|
||||
s := d.Find(c.sel)
|
||||
if s.Length() != c.cnt {
|
||||
t.Errorf("[%d] - expected %d nodes, found %d", i, c.cnt, s.Length())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewDocumentFromResponseNil(t *testing.T) {
|
||||
_, e := NewDocumentFromResponse(nil)
|
||||
if e == nil {
|
||||
t.Error("Expected error, got none")
|
||||
}
|
||||
}
|
||||
|
||||
+7
-10
@@ -1,14 +1,14 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/html"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
func getChildren(n *html.Node) (result []*html.Node) {
|
||||
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||
result = append(result, c)
|
||||
}
|
||||
return
|
||||
return result
|
||||
}
|
||||
|
||||
// Loop through all container nodes to search for the target node.
|
||||
@@ -55,9 +55,7 @@ func indexInSlice(slice []*html.Node, node *html.Node) int {
|
||||
// There is no check to the original state of the target slice, so it may still
|
||||
// contain duplicates. The target slice is returned because append() may create
|
||||
// a new underlying array.
|
||||
func appendWithoutDuplicates(target []*html.Node,
|
||||
nodes []*html.Node) []*html.Node {
|
||||
|
||||
func appendWithoutDuplicates(target []*html.Node, nodes []*html.Node) []*html.Node {
|
||||
for _, n := range nodes {
|
||||
if !isInSlice(target, n) {
|
||||
target = append(target, n)
|
||||
@@ -70,18 +68,17 @@ func appendWithoutDuplicates(target []*html.Node,
|
||||
// Loop through a selection, returning only those nodes that pass the predicate
|
||||
// function.
|
||||
func grep(sel *Selection, predicate func(i int, s *Selection) bool) (result []*html.Node) {
|
||||
|
||||
for i, n := range sel.Nodes {
|
||||
if predicate(i, newSingleSelection(n, sel.document)) {
|
||||
result = append(result, n)
|
||||
}
|
||||
}
|
||||
return
|
||||
return result
|
||||
}
|
||||
|
||||
// Creates a new Selection object based on the specified nodes, and keeps the
|
||||
// source Selection object on the stack (linked list).
|
||||
func pushStack(fromSel *Selection, nodes []*html.Node) (result *Selection) {
|
||||
result = &Selection{nodes, fromSel.document, fromSel}
|
||||
return
|
||||
func pushStack(fromSel *Selection, nodes []*html.Node) *Selection {
|
||||
result := &Selection{nodes, fromSel.document, fromSel}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user