Skip to content

Instantly share code, notes, and snippets.

@tumdum
Last active January 24, 2016 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tumdum/83581aee2693a60f5133 to your computer and use it in GitHub Desktop.
Save tumdum/83581aee2693a60f5133 to your computer and use it in GitHub Desktop.
Cost of string
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"regexp"
"runtime/pprof"
)
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
func main() {
flag.Parse()
if *cpuprofile != "" {
f, err := os.Create(*cpuprofile)
if err != nil {
log.Fatal(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
file, err := os.Open(flag.Args()[0])
if err != nil {
panic(err)
}
defer file.Close()
scanner := bufio.NewScanner(file)
var i int
// Compile regular expression first
r := regexp.MustCompile(`sshd\[\d{5}\]:\s*Failed`)
for scanner.Scan() {
line := scanner.Bytes()
if r.Match(line) {
i++
}
}
if err := scanner.Err(); err != nil {
fmt.Println(err)
}
fmt.Println(i)
}
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: goregexp Pages: 1 -->
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<script type="text/ecmascript"><![CDATA[
/**
* SVGPan library 1.2.1
* ======================
*
* Given an unique existing element with id "viewport" (or when missing, the first g
* element), including the the library into any SVG adds the following capabilities:
*
* - Mouse panning
* - Mouse zooming (using the wheel)
* - Object dragging
*
* You can configure the behaviour of the pan/zoom/drag with the variables
* listed in the CONFIGURATION section of this file.
*
* Known issues:
*
* - Zooming (while panning) on Safari has still some issues
*
* Releases:
*
* 1.2.1, Mon Jul 4 00:33:18 CEST 2011, Andrea Leofreddi
* - Fixed a regression with mouse wheel (now working on Firefox 5)
* - Working with viewBox attribute (#4)
* - Added "use strict;" and fixed resulting warnings (#5)
* - Added configuration variables, dragging is disabled by default (#3)
*
* 1.2, Sat Mar 20 08:42:50 GMT 2010, Zeng Xiaohui
* Fixed a bug with browser mouse handler interaction
*
* 1.1, Wed Feb 3 17:39:33 GMT 2010, Zeng Xiaohui
* Updated the zoom code to support the mouse wheel on Safari/Chrome
*
* 1.0, Andrea Leofreddi
* First release
*
* This code is licensed under the following BSD license:
*
* Copyright 2009-2010 Andrea Leofreddi <a.leofreddi@itcharm.com>. 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. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY Andrea Leofreddi ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Andrea Leofreddi OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Andrea Leofreddi.
*/
"use strict";
/// CONFIGURATION
/// ====>
var enablePan = 1; // 1 or 0: enable or disable panning (default enabled)
var enableZoom = 1; // 1 or 0: enable or disable zooming (default enabled)
var enableDrag = 0; // 1 or 0: enable or disable dragging (default disabled)
/// <====
/// END OF CONFIGURATION
var root = document.documentElement;
var state = 'none', svgRoot, stateTarget, stateOrigin, stateTf;
setupHandlers(root);
/**
* Register handlers
*/
function setupHandlers(root){
setAttributes(root, {
"onmouseup" : "handleMouseUp(evt)",
"onmousedown" : "handleMouseDown(evt)",
"onmousemove" : "handleMouseMove(evt)",
//"onmouseout" : "handleMouseUp(evt)", // Decomment this to stop the pan functionality when dragging out of the SVG element
});
if(navigator.userAgent.toLowerCase().indexOf('webkit') >= 0)
window.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari
else
window.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others
}
/**
* Retrieves the root element for SVG manipulation. The element is then cached into the svgRoot global variable.
*/
function getRoot(root) {
if(typeof(svgRoot) == "undefined") {
var g = null;
g = root.getElementById("viewport");
if(g == null)
g = root.getElementsByTagName('g')[0];
if(g == null)
alert('Unable to obtain SVG root element');
setCTM(g, g.getCTM());
g.removeAttribute("viewBox");
svgRoot = g;
}
return svgRoot;
}
/**
* Instance an SVGPoint object with given event coordinates.
*/
function getEventPoint(evt) {
var p = root.createSVGPoint();
p.x = evt.clientX;
p.y = evt.clientY;
return p;
}
/**
* Sets the current transform matrix of an element.
*/
function setCTM(element, matrix) {
var s = "matrix(" + matrix.a + "," + matrix.b + "," + matrix.c + "," + matrix.d + "," + matrix.e + "," + matrix.f + ")";
element.setAttribute("transform", s);
}
/**
* Dumps a matrix to a string (useful for debug).
*/
function dumpMatrix(matrix) {
var s = "[ " + matrix.a + ", " + matrix.c + ", " + matrix.e + "\n " + matrix.b + ", " + matrix.d + ", " + matrix.f + "\n 0, 0, 1 ]";
return s;
}
/**
* Sets attributes of an element.
*/
function setAttributes(element, attributes){
for (var i in attributes)
element.setAttributeNS(null, i, attributes[i]);
}
/**
* Handle mouse wheel event.
*/
function handleMouseWheel(evt) {
if(!enableZoom)
return;
if(evt.preventDefault)
evt.preventDefault();
evt.returnValue = false;
var svgDoc = evt.target.ownerDocument;
var delta;
if(evt.wheelDelta)
delta = evt.wheelDelta / 3600; // Chrome/Safari
else
delta = evt.detail / -90; // Mozilla
var z = 1 + delta; // Zoom factor: 0.9/1.1
var g = getRoot(svgDoc);
var p = getEventPoint(evt);
p = p.matrixTransform(g.getCTM().inverse());
// Compute new scale matrix in current mouse position
var k = root.createSVGMatrix().translate(p.x, p.y).scale(z).translate(-p.x, -p.y);
setCTM(g, g.getCTM().multiply(k));
if(typeof(stateTf) == "undefined")
stateTf = g.getCTM().inverse();
stateTf = stateTf.multiply(k.inverse());
}
/**
* Handle mouse move event.
*/
function handleMouseMove(evt) {
if(evt.preventDefault)
evt.preventDefault();
evt.returnValue = false;
var svgDoc = evt.target.ownerDocument;
var g = getRoot(svgDoc);
if(state == 'pan' && enablePan) {
// Pan mode
var p = getEventPoint(evt).matrixTransform(stateTf);
setCTM(g, stateTf.inverse().translate(p.x - stateOrigin.x, p.y - stateOrigin.y));
} else if(state == 'drag' && enableDrag) {
// Drag mode
var p = getEventPoint(evt).matrixTransform(g.getCTM().inverse());
setCTM(stateTarget, root.createSVGMatrix().translate(p.x - stateOrigin.x, p.y - stateOrigin.y).multiply(g.getCTM().inverse()).multiply(stateTarget.getCTM()));
stateOrigin = p;
}
}
/**
* Handle click event.
*/
function handleMouseDown(evt) {
if(evt.preventDefault)
evt.preventDefault();
evt.returnValue = false;
var svgDoc = evt.target.ownerDocument;
var g = getRoot(svgDoc);
if(
evt.target.tagName == "svg"
|| !enableDrag // Pan anyway when drag is disabled and the user clicked on an element
) {
// Pan mode
state = 'pan';
stateTf = g.getCTM().inverse();
stateOrigin = getEventPoint(evt).matrixTransform(stateTf);
} else {
// Drag mode
state = 'drag';
stateTarget = evt.target;
stateTf = g.getCTM().inverse();
stateOrigin = getEventPoint(evt).matrixTransform(stateTf);
}
}
/**
* Handle mouse button release event.
*/
function handleMouseUp(evt) {
if(evt.preventDefault)
evt.preventDefault();
evt.returnValue = false;
var svgDoc = evt.target.ownerDocument;
if(state == 'pan' || state == 'drag') {
// Quit pan mode
state = '';
}
}
]]></script><g id="viewport" transform="scale(0.5,0.5) translate(0,0)"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 941)">
<title>goregexp</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-941 1301.5,-941 1301.5,4 -4,4"/>
<g id="clust1" class="cluster"><title>cluster_L</title>
<polygon fill="none" stroke="black" points="225.5,-800 225.5,-929 621.5,-929 621.5,-800 225.5,-800"/>
</g>
<!-- L -->
<g id="node1" class="node"><title>L</title>
<polygon fill="#f8f8f8" stroke="black" points="614,-921 233,-921 233,-808 614,-808 614,-921"/>
<text text-anchor="start" x="241" y="-891.4" font-family="Times,serif" font-size="32.00">File: goregexp</text>
<text text-anchor="start" x="241" y="-856.4" font-family="Times,serif" font-size="32.00">Type: cpu</text>
<text text-anchor="start" x="241" y="-821.4" font-family="Times,serif" font-size="32.00">1.53s of 1.53s total ( &#160;100%)</text>
</g>
<!-- N1 -->
<g id="node2" class="node"><title>N1</title>
<g id="a_node2"><a xlink:title="runtime.indexbytebody (0.60s)">
<polygon fill="#f8f8f8" stroke="black" points="787.5,-60 547.5,-60 547.5,-3.55271e-15 787.5,-3.55271e-15 787.5,-60"/>
<text text-anchor="middle" x="667.5" y="-36.8" font-family="Times,serif" font-size="24.00">runtime.indexbytebody</text>
<text text-anchor="middle" x="667.5" y="-10.8" font-family="Times,serif" font-size="24.00">0.60s(39.22%)</text>
</a>
</g>
</g>
<!-- N2 -->
<g id="node3" class="node"><title>N2</title>
<g id="a_node3"><a xlink:title="bytes.Index (0.85s)">
<polygon fill="#f8f8f8" stroke="black" points="742,-182 593,-182 593,-111 742,-111 742,-182"/>
<text text-anchor="middle" x="667.5" y="-162.8" font-family="Times,serif" font-size="19.00">bytes.Index</text>
<text text-anchor="middle" x="667.5" y="-141.8" font-family="Times,serif" font-size="19.00">0.24s(15.69%)</text>
<text text-anchor="middle" x="667.5" y="-120.8" font-family="Times,serif" font-size="19.00">of 0.85s(55.56%)</text>
</a>
</g>
</g>
<!-- N2&#45;&gt;N1 -->
<g id="edge8" class="edge"><title>N2&#45;&gt;N1</title>
<g id="a_edge8"><a xlink:title="bytes.Index &#45;&gt; runtime.indexbytebody (0.51s)">
<path fill="none" stroke="black" stroke-width="2" d="M667.5,-110.835C667.5,-98.059 667.5,-83.4953 667.5,-70.3358"/>
<polygon fill="black" stroke="black" stroke-width="2" points="671,-70.1442 667.5,-60.1443 664,-70.1443 671,-70.1442"/>
</a>
</g>
<g id="a_edge8&#45;label"><a xlink:title="bytes.Index &#45;&gt; runtime.indexbytebody (0.51s)">
<text text-anchor="middle" x="684.5" y="-81.8" font-family="Times,serif" font-size="14.00"> 0.51s</text>
</a>
</g>
</g>
<!-- N6 -->
<g id="node7" class="node"><title>N6</title>
<g id="a_node7"><a xlink:title="runtime.memeqbody (0.06s)">
<polygon fill="#f8f8f8" stroke="black" points="437,-49 306,-49 306,-11 437,-11 437,-49"/>
<text text-anchor="middle" x="371.5" y="-33.8" font-family="Times,serif" font-size="14.00">runtime.memeqbody</text>
<text text-anchor="middle" x="371.5" y="-18.8" font-family="Times,serif" font-size="14.00">0.06s(3.92%)</text>
</a>
</g>
</g>
<!-- N2&#45;&gt;N6 -->
<g id="edge22" class="edge"><title>N2&#45;&gt;N6</title>
<g id="a_edge22"><a xlink:title="bytes.Index &#45;&gt; runtime.memeqbody (0.06s)">
<path fill="none" stroke="black" d="M592.937,-115.04C589.413,-113.662 585.921,-112.309 582.5,-111 560.442,-102.557 554.653,-101.188 532.5,-93 493.71,-78.6623 484.086,-74.8782 445.5,-60 439.501,-57.687 433.235,-55.2552 426.997,-52.8246"/>
<polygon fill="black" stroke="black" points="427.848,-49.3998 417.26,-49.0233 425.302,-55.9205 427.848,-49.3998"/>
</a>
</g>
<g id="a_edge22&#45;label"><a xlink:title="bytes.Index &#45;&gt; runtime.memeqbody (0.06s)">
<text text-anchor="middle" x="549.5" y="-81.8" font-family="Times,serif" font-size="14.00"> 0.06s</text>
</a>
</g>
</g>
<!-- N12 -->
<g id="node13" class="node"><title>N12</title>
<g id="a_node13"><a xlink:title="bytes.Equal (0.02s)">
<polygon fill="#f8f8f8" stroke="black" points="530,-48 455,-48 455,-12 530,-12 530,-48"/>
<text text-anchor="middle" x="492.5" y="-33.2" font-family="Times,serif" font-size="11.00">bytes.Equal</text>
<text text-anchor="middle" x="492.5" y="-21.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
</a>
</g>
</g>
<!-- N2&#45;&gt;N12 -->
<g id="edge28" class="edge"><title>N2&#45;&gt;N12</title>
<g id="a_edge28"><a xlink:title="bytes.Index &#45;&gt; bytes.Equal (0.02s)">
<path fill="none" stroke="black" d="M614.519,-110.835C586.263,-92.3475 552.286,-70.1172 527.37,-53.8147"/>
<polygon fill="black" stroke="black" points="529.243,-50.8577 518.958,-48.3114 525.41,-56.7153 529.243,-50.8577"/>
</a>
</g>
<g id="a_edge28&#45;label"><a xlink:title="bytes.Index &#45;&gt; bytes.Equal (0.02s)">
<text text-anchor="middle" x="602.5" y="-81.8" font-family="Times,serif" font-size="14.00"> 0.02s</text>
</a>
</g>
</g>
<!-- N13 -->
<g id="node14" class="node"><title>N13</title>
<g id="a_node14"><a xlink:title="bytes.IndexByte (0.02s)">
<polygon fill="#f8f8f8" stroke="black" points="288,-48 199,-48 199,-12 288,-12 288,-48"/>
<text text-anchor="middle" x="243.5" y="-33.2" font-family="Times,serif" font-size="11.00">bytes.IndexByte</text>
<text text-anchor="middle" x="243.5" y="-21.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
</a>
</g>
</g>
<!-- N2&#45;&gt;N13 -->
<g id="edge29" class="edge"><title>N2&#45;&gt;N13</title>
<g id="a_edge29"><a xlink:title="bytes.Index &#45;&gt; bytes.IndexByte (0.02s)">
<path fill="none" stroke="black" d="M592.755,-114.005C589.312,-112.921 585.883,-111.912 582.5,-111 527.454,-96.169 511.66,-102.798 455.5,-93 384.401,-80.5964 364.231,-84.9277 296.5,-60 291.014,-57.9809 285.404,-55.4664 279.985,-52.7679"/>
<polygon fill="black" stroke="black" points="281.582,-49.6533 271.101,-48.1079 278.331,-55.8523 281.582,-49.6533"/>
</a>
</g>
<g id="a_edge29&#45;label"><a xlink:title="bytes.Index &#45;&gt; bytes.IndexByte (0.02s)">
<text text-anchor="middle" x="472.5" y="-81.8" font-family="Times,serif" font-size="14.00"> 0.02s</text>
</a>
</g>
</g>
<!-- N3 -->
<g id="node4" class="node"><title>N3</title>
<g id="a_node4"><a xlink:title="regexp.(*machine).tryBacktrack (0.16s)">
<polygon fill="#f8f8f8" stroke="black" points="442.5,-295 220.5,-295 220.5,-233 442.5,-233 442.5,-295"/>
<text text-anchor="middle" x="331.5" y="-278.2" font-family="Times,serif" font-size="16.00">regexp.(*machine).tryBacktrack</text>
<text text-anchor="middle" x="331.5" y="-260.2" font-family="Times,serif" font-size="16.00">0.13s(8.50%)</text>
<text text-anchor="middle" x="331.5" y="-242.2" font-family="Times,serif" font-size="16.00">of 0.16s(10.46%)</text>
</a>
</g>
</g>
<!-- N17 -->
<g id="node18" class="node"><title>N17</title>
<g id="a_node18"><a xlink:title="regexp.(*inputBytes).step (0.02s)">
<polygon fill="#f8f8f8" stroke="black" points="293,-164.5 162,-164.5 162,-128.5 293,-128.5 293,-164.5"/>
<text text-anchor="middle" x="227.5" y="-149.7" font-family="Times,serif" font-size="11.00">regexp.(*inputBytes).step</text>
<text text-anchor="middle" x="227.5" y="-137.7" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
</a>
</g>
</g>
<!-- N3&#45;&gt;N17 -->
<g id="edge31" class="edge"><title>N3&#45;&gt;N17</title>
<g id="a_edge31"><a xlink:title="regexp.(*machine).tryBacktrack &#45;&gt; regexp.(*inputBytes).step (0.02s)">
<path fill="none" stroke="black" d="M304.447,-232.955C287.432,-214.059 265.748,-189.977 249.738,-172.197"/>
<polygon fill="black" stroke="black" points="252.111,-169.602 242.818,-164.512 246.909,-174.286 252.111,-169.602"/>
</a>
</g>
<g id="a_edge31&#45;label"><a xlink:title="regexp.(*machine).tryBacktrack &#45;&gt; regexp.(*inputBytes).step (0.02s)">
<text text-anchor="middle" x="303.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.02s</text>
</a>
</g>
</g>
<!-- N27 -->
<g id="node28" class="node"><title>N27</title>
<g id="a_node28"><a xlink:title="regexp/syntax.(*Inst).MatchRune (0.01s)">
<polygon fill="#f8f8f8" stroke="black" points="435.5,-164.5 311.5,-164.5 311.5,-128.5 435.5,-128.5 435.5,-164.5"/>
<text text-anchor="middle" x="373.5" y="-149.1" font-family="Times,serif" font-size="8.00">regexp/syntax.(*Inst).MatchRune</text>
<text text-anchor="middle" x="373.5" y="-140.1" font-family="Times,serif" font-size="8.00">0 of 0.01s(0.65%)</text>
</a>
</g>
</g>
<!-- N3&#45;&gt;N27 -->
<g id="edge32" class="edge"><title>N3&#45;&gt;N27</title>
<g id="a_edge32"><a xlink:title="regexp.(*machine).tryBacktrack &#45;&gt; regexp/syntax.(*Inst).MatchRune (0.01s)">
<path fill="none" stroke="black" d="M342.425,-232.955C349.049,-214.74 357.425,-191.706 363.812,-174.143"/>
<polygon fill="black" stroke="black" points="367.185,-175.106 367.314,-164.512 360.607,-172.714 367.185,-175.106"/>
</a>
</g>
<g id="a_edge32&#45;label"><a xlink:title="regexp.(*machine).tryBacktrack &#45;&gt; regexp/syntax.(*Inst).MatchRune (0.01s)">
<text text-anchor="middle" x="371.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.01s</text>
</a>
</g>
</g>
<!-- N4 -->
<g id="node5" class="node"><title>N4</title>
<g id="a_node5"><a xlink:title="syscall.Syscall (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="1297.5,-49 1201.5,-49 1201.5,-11 1297.5,-11 1297.5,-49"/>
<text text-anchor="middle" x="1249.5" y="-33.8" font-family="Times,serif" font-size="14.00">syscall.Syscall</text>
<text text-anchor="middle" x="1249.5" y="-18.8" font-family="Times,serif" font-size="14.00">0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N5 -->
<g id="node6" class="node"><title>N5</title>
<g id="a_node6"><a xlink:title="runtime.memclr (0.07s)">
<polygon fill="#f8f8f8" stroke="black" points="573.5,-165.5 467.5,-165.5 467.5,-127.5 573.5,-127.5 573.5,-165.5"/>
<text text-anchor="middle" x="520.5" y="-150.3" font-family="Times,serif" font-size="14.00">runtime.memclr</text>
<text text-anchor="middle" x="520.5" y="-135.3" font-family="Times,serif" font-size="14.00">0.07s(4.58%)</text>
</a>
</g>
</g>
<!-- N7 -->
<g id="node8" class="node"><title>N7</title>
<g id="a_node8"><a xlink:title="sync/atomic.CompareAndSwapUint32 (0.05s)">
<polygon fill="#f8f8f8" stroke="black" points="1132.5,-164.5 908.5,-164.5 908.5,-128.5 1132.5,-128.5 1132.5,-164.5"/>
<text text-anchor="middle" x="1020.5" y="-150.1" font-family="Times,serif" font-size="13.00">sync/atomic.CompareAndSwapUint32</text>
<text text-anchor="middle" x="1020.5" y="-136.1" font-family="Times,serif" font-size="13.00">0.05s(3.27%)</text>
</a>
</g>
</g>
<!-- N8 -->
<g id="node9" class="node"><title>N8</title>
<g id="a_node9"><a xlink:title="bufio.(*Scanner).Scan (0.22s)">
<polygon fill="#f8f8f8" stroke="black" points="871.5,-583 749.5,-583 749.5,-536 871.5,-536 871.5,-583"/>
<text text-anchor="middle" x="810.5" y="-569.4" font-family="Times,serif" font-size="12.00">bufio.(*Scanner).Scan</text>
<text text-anchor="middle" x="810.5" y="-556.4" font-family="Times,serif" font-size="12.00">0.03s(1.96%)</text>
<text text-anchor="middle" x="810.5" y="-543.4" font-family="Times,serif" font-size="12.00">of 0.22s(14.38%)</text>
</a>
</g>
</g>
<!-- N11 -->
<g id="node12" class="node"><title>N11</title>
<g id="a_node12"><a xlink:title="bufio.ScanLines (0.11s)">
<polygon fill="#f8f8f8" stroke="black" points="855,-485 766,-485 766,-441 855,-441 855,-485"/>
<text text-anchor="middle" x="810.5" y="-472.2" font-family="Times,serif" font-size="11.00">bufio.ScanLines</text>
<text text-anchor="middle" x="810.5" y="-460.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
<text text-anchor="middle" x="810.5" y="-448.2" font-family="Times,serif" font-size="11.00">of 0.11s(7.19%)</text>
</a>
</g>
</g>
<!-- N8&#45;&gt;N11 -->
<g id="edge11" class="edge"><title>N8&#45;&gt;N11</title>
<g id="a_edge11"><a xlink:title="bufio.(*Scanner).Scan &#45;&gt; bufio.ScanLines (0.11s)">
<path fill="none" stroke="black" d="M810.5,-535.624C810.5,-523.469 810.5,-508.351 810.5,-495.142"/>
<polygon fill="black" stroke="black" points="814,-495.05 810.5,-485.05 807,-495.05 814,-495.05"/>
</a>
</g>
<g id="a_edge11&#45;label"><a xlink:title="bufio.(*Scanner).Scan &#45;&gt; bufio.ScanLines (0.11s)">
<text text-anchor="middle" x="827.5" y="-506.8" font-family="Times,serif" font-size="14.00"> 0.11s</text>
</a>
</g>
</g>
<!-- N24 -->
<g id="node25" class="node"><title>N24</title>
<g id="a_node25"><a xlink:title="os.(*File).Read (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="1157.5,-481 1083.5,-481 1083.5,-445 1157.5,-445 1157.5,-481"/>
<text text-anchor="middle" x="1120.5" y="-465.6" font-family="Times,serif" font-size="8.00">os.(*File).Read</text>
<text text-anchor="middle" x="1120.5" y="-456.6" font-family="Times,serif" font-size="8.00">0 of 0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N8&#45;&gt;N24 -->
<g id="edge13" class="edge"><title>N8&#45;&gt;N24</title>
<g id="a_edge13"><a xlink:title="bufio.(*Scanner).Scan &#45;&gt; os.(*File).Read (0.08s)">
<path fill="none" stroke="black" d="M871.746,-539.83C931.048,-521.752 1019.68,-494.734 1073.58,-478.302"/>
<polygon fill="black" stroke="black" points="1074.68,-481.625 1083.23,-475.361 1072.64,-474.93 1074.68,-481.625"/>
</a>
</g>
<g id="a_edge13&#45;label"><a xlink:title="bufio.(*Scanner).Scan &#45;&gt; os.(*File).Read (0.08s)">
<text text-anchor="middle" x="1001.5" y="-506.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
<!-- N9 -->
<g id="node10" class="node"><title>N9</title>
<g id="a_node10"><a xlink:title="sync.(*Mutex).Unlock (0.06s)">
<polygon fill="#f8f8f8" stroke="black" points="887.5,-287.5 763.5,-287.5 763.5,-240.5 887.5,-240.5 887.5,-287.5"/>
<text text-anchor="middle" x="825.5" y="-273.9" font-family="Times,serif" font-size="12.00">sync.(*Mutex).Unlock</text>
<text text-anchor="middle" x="825.5" y="-260.9" font-family="Times,serif" font-size="12.00">0.03s(1.96%)</text>
<text text-anchor="middle" x="825.5" y="-247.9" font-family="Times,serif" font-size="12.00">of 0.06s(3.92%)</text>
</a>
</g>
</g>
<!-- N10 -->
<g id="node11" class="node"><title>N10</title>
<g id="a_node11"><a xlink:title="sync/atomic.AddUint32 (0.03s)">
<polygon fill="#f8f8f8" stroke="black" points="890.5,-164.5 760.5,-164.5 760.5,-128.5 890.5,-128.5 890.5,-164.5"/>
<text text-anchor="middle" x="825.5" y="-149.9" font-family="Times,serif" font-size="12.00">sync/atomic.AddUint32</text>
<text text-anchor="middle" x="825.5" y="-136.9" font-family="Times,serif" font-size="12.00">0.03s(1.96%)</text>
</a>
</g>
</g>
<!-- N9&#45;&gt;N10 -->
<g id="edge27" class="edge"><title>N9&#45;&gt;N10</title>
<g id="a_edge27"><a xlink:title="sync.(*Mutex).Unlock &#45;&gt; sync/atomic.AddUint32 (0.03s)">
<path fill="none" stroke="black" d="M825.5,-240.456C825.5,-221.647 825.5,-194.781 825.5,-174.764"/>
<polygon fill="black" stroke="black" points="829,-174.722 825.5,-164.722 822,-174.722 829,-174.722"/>
</a>
</g>
<g id="a_edge27&#45;label"><a xlink:title="sync.(*Mutex).Unlock &#45;&gt; sync/atomic.AddUint32 (0.03s)">
<text text-anchor="middle" x="842.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.03s</text>
</a>
</g>
</g>
<!-- N11&#45;&gt;N1 -->
<g id="edge12" class="edge"><title>N11&#45;&gt;N1</title>
<g id="a_edge12"><a xlink:title="bufio.ScanLines &#45;&gt; runtime.indexbytebody (0.09s)">
<path fill="none" stroke="black" d="M855.183,-459.501C949.539,-453 1160.5,-431.479 1160.5,-369 1160.5,-369 1160.5,-369 1160.5,-145.5 1160.5,-71.0071 944.232,-44.963 798.177,-35.8681"/>
<polygon fill="black" stroke="black" points="797.978,-32.3499 787.786,-35.2421 797.557,-39.3373 797.978,-32.3499"/>
</a>
</g>
<g id="a_edge12&#45;label"><a xlink:title="bufio.ScanLines &#45;&gt; runtime.indexbytebody (0.09s)">
<text text-anchor="middle" x="1177.5" y="-260.3" font-family="Times,serif" font-size="14.00"> 0.09s</text>
</a>
</g>
</g>
<!-- N14 -->
<g id="node15" class="node"><title>N14</title>
<g id="a_node15"><a xlink:title="regexp.(*Regexp).Match (1.31s)">
<polygon fill="#f8f8f8" stroke="black" points="731.5,-581.5 603.5,-581.5 603.5,-537.5 731.5,-537.5 731.5,-581.5"/>
<text text-anchor="middle" x="667.5" y="-568.7" font-family="Times,serif" font-size="11.00">regexp.(*Regexp).Match</text>
<text text-anchor="middle" x="667.5" y="-556.7" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
<text text-anchor="middle" x="667.5" y="-544.7" font-family="Times,serif" font-size="11.00">of 1.31s(85.62%)</text>
</a>
</g>
</g>
<!-- N15 -->
<g id="node16" class="node"><title>N15</title>
<g id="a_node16"><a xlink:title="regexp.(*Regexp).doExecute (1.29s)">
<polygon fill="#f8f8f8" stroke="black" points="740.5,-485 594.5,-485 594.5,-441 740.5,-441 740.5,-485"/>
<text text-anchor="middle" x="667.5" y="-472.2" font-family="Times,serif" font-size="11.00">regexp.(*Regexp).doExecute</text>
<text text-anchor="middle" x="667.5" y="-460.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
<text text-anchor="middle" x="667.5" y="-448.2" font-family="Times,serif" font-size="11.00">of 1.29s(84.31%)</text>
</a>
</g>
</g>
<!-- N14&#45;&gt;N15 -->
<g id="edge4" class="edge"><title>N14&#45;&gt;N15</title>
<g id="a_edge4"><a xlink:title="regexp.(*Regexp).Match &#45;&gt; regexp.(*Regexp).doExecute (1.29s)">
<path fill="none" stroke="black" stroke-width="5" d="M667.5,-537.056C667.5,-524.646 667.5,-508.808 667.5,-495.054"/>
<polygon fill="black" stroke="black" stroke-width="5" points="671.875,-495.033 667.5,-485.033 663.125,-495.033 671.875,-495.033"/>
</a>
</g>
<g id="a_edge4&#45;label"><a xlink:title="regexp.(*Regexp).Match &#45;&gt; regexp.(*Regexp).doExecute (1.29s)">
<text text-anchor="middle" x="684.5" y="-506.8" font-family="Times,serif" font-size="14.00"> 1.29s</text>
</a>
</g>
</g>
<!-- N16 -->
<g id="node17" class="node"><title>N16</title>
<g id="a_node17"><a xlink:title="regexp.(*Regexp).get (0.07s)">
<polygon fill="#f8f8f8" stroke="black" points="872,-390 759,-390 759,-346 872,-346 872,-390"/>
<text text-anchor="middle" x="815.5" y="-377.2" font-family="Times,serif" font-size="11.00">regexp.(*Regexp).get</text>
<text text-anchor="middle" x="815.5" y="-365.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
<text text-anchor="middle" x="815.5" y="-353.2" font-family="Times,serif" font-size="11.00">of 0.07s(4.58%)</text>
</a>
</g>
</g>
<!-- N15&#45;&gt;N16 -->
<g id="edge20" class="edge"><title>N15&#45;&gt;N16</title>
<g id="a_edge20"><a xlink:title="regexp.(*Regexp).doExecute &#45;&gt; regexp.(*Regexp).get (0.07s)">
<path fill="none" stroke="black" d="M701.083,-440.897C722.561,-427.401 750.59,-409.788 773.531,-395.373"/>
<polygon fill="black" stroke="black" points="775.445,-398.304 782.049,-390.02 771.72,-392.377 775.445,-398.304"/>
</a>
</g>
<g id="a_edge20&#45;label"><a xlink:title="regexp.(*Regexp).doExecute &#45;&gt; regexp.(*Regexp).get (0.07s)">
<text text-anchor="middle" x="767.5" y="-411.8" font-family="Times,serif" font-size="14.00"> 0.07s</text>
</a>
</g>
</g>
<!-- N18 -->
<g id="node19" class="node"><title>N18</title>
<g id="a_node19"><a xlink:title="regexp.(*machine).backtrack (1.12s)">
<polygon fill="#f8f8f8" stroke="black" points="740.5,-390 594.5,-390 594.5,-346 740.5,-346 740.5,-390"/>
<text text-anchor="middle" x="667.5" y="-377.2" font-family="Times,serif" font-size="11.00">regexp.(*machine).backtrack</text>
<text text-anchor="middle" x="667.5" y="-365.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
<text text-anchor="middle" x="667.5" y="-353.2" font-family="Times,serif" font-size="11.00">of 1.12s(73.20%)</text>
</a>
</g>
</g>
<!-- N15&#45;&gt;N18 -->
<g id="edge5" class="edge"><title>N15&#45;&gt;N18</title>
<g id="a_edge5"><a xlink:title="regexp.(*Regexp).doExecute &#45;&gt; regexp.(*machine).backtrack (1.12s)">
<path fill="none" stroke="black" stroke-width="4" d="M667.5,-440.897C667.5,-428.887 667.5,-413.617 667.5,-400.242"/>
<polygon fill="black" stroke="black" stroke-width="4" points="671,-400.02 667.5,-390.02 664,-400.02 671,-400.02"/>
</a>
</g>
<g id="a_edge5&#45;label"><a xlink:title="regexp.(*Regexp).doExecute &#45;&gt; regexp.(*machine).backtrack (1.12s)">
<text text-anchor="middle" x="684.5" y="-411.8" font-family="Times,serif" font-size="14.00"> 1.12s</text>
</a>
</g>
</g>
<!-- N26 -->
<g id="node27" class="node"><title>N26</title>
<g id="a_node27"><a xlink:title="regexp.(*Regexp).put (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="976.5,-386 890.5,-386 890.5,-350 976.5,-350 976.5,-386"/>
<text text-anchor="middle" x="933.5" y="-370.6" font-family="Times,serif" font-size="8.00">regexp.(*Regexp).put</text>
<text text-anchor="middle" x="933.5" y="-361.6" font-family="Times,serif" font-size="8.00">0 of 0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N15&#45;&gt;N26 -->
<g id="edge16" class="edge"><title>N15&#45;&gt;N26</title>
<g id="a_edge16"><a xlink:title="regexp.(*Regexp).doExecute &#45;&gt; regexp.(*Regexp).put (0.08s)">
<path fill="none" stroke="black" d="M734.198,-440.932C751.889,-435.227 770.949,-428.974 788.5,-423 829.623,-409.002 839.858,-405.336 880.5,-390 880.708,-389.921 880.917,-389.843 881.126,-389.763"/>
<polygon fill="black" stroke="black" points="882.648,-392.929 890.735,-386.084 880.145,-386.391 882.648,-392.929"/>
</a>
</g>
<g id="a_edge16&#45;label"><a xlink:title="regexp.(*Regexp).doExecute &#45;&gt; regexp.(*Regexp).put (0.08s)">
<text text-anchor="middle" x="849.5" y="-411.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
<!-- N16&#45;&gt;N9 -->
<g id="edge30" class="edge"><title>N16&#45;&gt;N9</title>
<g id="a_edge30"><a xlink:title="regexp.(*Regexp).get &#45;&gt; sync.(*Mutex).Unlock (0.02s)">
<path fill="none" stroke="black" d="M815.077,-345.922C815.084,-335.922 815.393,-323.82 816.5,-313 817.002,-308.092 817.741,-302.936 818.583,-297.897"/>
<polygon fill="black" stroke="black" points="822.066,-298.302 820.413,-287.837 815.179,-297.049 822.066,-298.302"/>
</a>
</g>
<g id="a_edge30&#45;label"><a xlink:title="regexp.(*Regexp).get &#45;&gt; sync.(*Mutex).Unlock (0.02s)">
<text text-anchor="middle" x="833.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.02s</text>
</a>
</g>
</g>
<!-- N19 -->
<g id="node20" class="node"><title>N19</title>
<g id="a_node20"><a xlink:title="sync.(*Mutex).Lock (0.07s)">
<polygon fill="#f8f8f8" stroke="black" points="1040,-286 933,-286 933,-242 1040,-242 1040,-286"/>
<text text-anchor="middle" x="986.5" y="-273.2" font-family="Times,serif" font-size="11.00">sync.(*Mutex).Lock</text>
<text text-anchor="middle" x="986.5" y="-261.2" font-family="Times,serif" font-size="11.00">0.02s(1.31%)</text>
<text text-anchor="middle" x="986.5" y="-249.2" font-family="Times,serif" font-size="11.00">of 0.07s(4.58%)</text>
</a>
</g>
</g>
<!-- N16&#45;&gt;N19 -->
<g id="edge26" class="edge"><title>N16&#45;&gt;N19</title>
<g id="a_edge26"><a xlink:title="regexp.(*Regexp).get &#45;&gt; sync.(*Mutex).Lock (0.03s)">
<path fill="none" stroke="black" d="M833.089,-345.736C842.929,-334.856 855.925,-322.037 869.5,-313 885.919,-302.069 905.223,-292.899 923.366,-285.6"/>
<polygon fill="black" stroke="black" points="924.678,-288.845 932.726,-281.954 922.137,-282.322 924.678,-288.845"/>
</a>
</g>
<g id="a_edge26&#45;label"><a xlink:title="regexp.(*Regexp).get &#45;&gt; sync.(*Mutex).Lock (0.03s)">
<text text-anchor="middle" x="886.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.03s</text>
</a>
</g>
</g>
<!-- N18&#45;&gt;N3 -->
<g id="edge10" class="edge"><title>N18&#45;&gt;N3</title>
<g id="a_edge10"><a xlink:title="regexp.(*machine).backtrack &#45;&gt; regexp.(*machine).tryBacktrack (0.16s)">
<path fill="none" stroke="black" d="M598.288,-345.989C552.713,-332.154 492.095,-313.752 440.159,-297.986"/>
<polygon fill="black" stroke="black" points="441.154,-294.63 430.568,-295.074 439.12,-301.328 441.154,-294.63"/>
</a>
</g>
<g id="a_edge10&#45;label"><a xlink:title="regexp.(*machine).backtrack &#45;&gt; regexp.(*machine).tryBacktrack (0.16s)">
<text text-anchor="middle" x="547.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.16s</text>
</a>
</g>
</g>
<!-- N20 -->
<g id="node21" class="node"><title>N20</title>
<g id="a_node21"><a xlink:title="regexp.(*bitState).reset (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="581,-286 460,-286 460,-242 581,-242 581,-286"/>
<text text-anchor="middle" x="520.5" y="-273.2" font-family="Times,serif" font-size="11.00">regexp.(*bitState).reset</text>
<text text-anchor="middle" x="520.5" y="-261.2" font-family="Times,serif" font-size="11.00">0.01s(0.65%)</text>
<text text-anchor="middle" x="520.5" y="-249.2" font-family="Times,serif" font-size="11.00">of 0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N18&#45;&gt;N20 -->
<g id="edge17" class="edge"><title>N18&#45;&gt;N20</title>
<g id="a_edge17"><a xlink:title="regexp.(*machine).backtrack &#45;&gt; regexp.(*bitState).reset (0.08s)">
<path fill="none" stroke="black" d="M637.042,-345.866C614.474,-330.206 583.547,-308.747 559.223,-291.869"/>
<polygon fill="black" stroke="black" points="561.131,-288.933 550.919,-286.107 557.14,-294.684 561.131,-288.933"/>
</a>
</g>
<g id="a_edge17&#45;label"><a xlink:title="regexp.(*machine).backtrack &#45;&gt; regexp.(*bitState).reset (0.08s)">
<text text-anchor="middle" x="624.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
<!-- N21 -->
<g id="node22" class="node"><title>N21</title>
<g id="a_node22"><a xlink:title="regexp.(*inputBytes).index (0.86s)">
<polygon fill="#f8f8f8" stroke="black" points="736,-286 599,-286 599,-242 736,-242 736,-286"/>
<text text-anchor="middle" x="667.5" y="-273.2" font-family="Times,serif" font-size="11.00">regexp.(*inputBytes).index</text>
<text text-anchor="middle" x="667.5" y="-261.2" font-family="Times,serif" font-size="11.00">0.01s(0.65%)</text>
<text text-anchor="middle" x="667.5" y="-249.2" font-family="Times,serif" font-size="11.00">of 0.86s(56.21%)</text>
</a>
</g>
</g>
<!-- N18&#45;&gt;N21 -->
<g id="edge6" class="edge"><title>N18&#45;&gt;N21</title>
<g id="a_edge6"><a xlink:title="regexp.(*machine).backtrack &#45;&gt; regexp.(*inputBytes).index (0.86s)">
<path fill="none" stroke="black" stroke-width="3" d="M667.5,-345.866C667.5,-331.505 667.5,-312.268 667.5,-296.159"/>
<polygon fill="black" stroke="black" stroke-width="3" points="671,-296.107 667.5,-286.107 664,-296.107 671,-296.107"/>
</a>
</g>
<g id="a_edge6&#45;label"><a xlink:title="regexp.(*machine).backtrack &#45;&gt; regexp.(*inputBytes).index (0.86s)">
<text text-anchor="middle" x="684.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.86s</text>
</a>
</g>
</g>
<!-- N19&#45;&gt;N7 -->
<g id="edge23" class="edge"><title>N19&#45;&gt;N7</title>
<g id="a_edge23"><a xlink:title="sync.(*Mutex).Lock &#45;&gt; sync/atomic.CompareAndSwapUint32 (0.05s)">
<path fill="none" stroke="black" d="M992.736,-241.816C998.312,-222.873 1006.51,-195.015 1012.56,-174.484"/>
<polygon fill="black" stroke="black" points="1015.95,-175.365 1015.41,-164.784 1009.23,-173.388 1015.95,-175.365"/>
</a>
</g>
<g id="a_edge23&#45;label"><a xlink:title="sync.(*Mutex).Lock &#45;&gt; sync/atomic.CompareAndSwapUint32 (0.05s)">
<text text-anchor="middle" x="1022.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.05s</text>
</a>
</g>
</g>
<!-- N20&#45;&gt;N5 -->
<g id="edge21" class="edge"><title>N20&#45;&gt;N5</title>
<g id="a_edge21"><a xlink:title="regexp.(*bitState).reset &#45;&gt; runtime.memclr (0.07s)">
<path fill="none" stroke="black" d="M520.5,-241.816C520.5,-223.267 520.5,-196.17 520.5,-175.774"/>
<polygon fill="black" stroke="black" points="524,-175.515 520.5,-165.515 517,-175.515 524,-175.515"/>
</a>
</g>
<g id="a_edge21&#45;label"><a xlink:title="regexp.(*bitState).reset &#45;&gt; runtime.memclr (0.07s)">
<text text-anchor="middle" x="537.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.07s</text>
</a>
</g>
</g>
<!-- N21&#45;&gt;N2 -->
<g id="edge7" class="edge"><title>N21&#45;&gt;N2</title>
<g id="a_edge7"><a xlink:title="regexp.(*inputBytes).index &#45;&gt; bytes.Index (0.85s)">
<path fill="none" stroke="black" stroke-width="3" d="M667.5,-241.816C667.5,-228.009 667.5,-209.466 667.5,-192.476"/>
<polygon fill="black" stroke="black" stroke-width="3" points="671,-192.154 667.5,-182.154 664,-192.154 671,-192.154"/>
</a>
</g>
<g id="a_edge7&#45;label"><a xlink:title="regexp.(*inputBytes).index &#45;&gt; bytes.Index (0.85s)">
<text text-anchor="middle" x="684.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.85s</text>
</a>
</g>
</g>
<!-- N22 -->
<g id="node23" class="node"><title>N22</title>
<g id="a_node23"><a xlink:title="regexp/syntax.(*Inst).MatchRunePos (0.01s)">
<polygon fill="#f8f8f8" stroke="black" points="181,-48 0,-48 0,-12 181,-12 181,-48"/>
<text text-anchor="middle" x="90.5" y="-33.2" font-family="Times,serif" font-size="11.00">regexp/syntax.(*Inst).MatchRunePos</text>
<text text-anchor="middle" x="90.5" y="-21.2" font-family="Times,serif" font-size="11.00">0.01s(0.65%)</text>
</a>
</g>
</g>
<!-- N23 -->
<g id="node24" class="node"><title>N23</title>
<g id="a_node24"><a xlink:title="main.main (1.53s)">
<polygon fill="#f8f8f8" stroke="black" points="703.5,-670 631.5,-670 631.5,-634 703.5,-634 703.5,-670"/>
<text text-anchor="middle" x="667.5" y="-654.6" font-family="Times,serif" font-size="8.00">main.main</text>
<text text-anchor="middle" x="667.5" y="-645.6" font-family="Times,serif" font-size="8.00">0 of 1.53s(100%)</text>
</a>
</g>
</g>
<!-- N23&#45;&gt;N8 -->
<g id="edge9" class="edge"><title>N23&#45;&gt;N8</title>
<g id="a_edge9"><a xlink:title="main.main &#45;&gt; bufio.(*Scanner).Scan (0.22s)">
<path fill="none" stroke="black" d="M694.397,-633.978C714.556,-621.22 742.591,-603.477 766.062,-588.623"/>
<polygon fill="black" stroke="black" points="768.23,-591.393 774.808,-583.088 764.487,-585.478 768.23,-591.393"/>
</a>
</g>
<g id="a_edge9&#45;label"><a xlink:title="main.main &#45;&gt; bufio.(*Scanner).Scan (0.22s)">
<text text-anchor="middle" x="760.5" y="-604.8" font-family="Times,serif" font-size="14.00"> 0.22s</text>
</a>
</g>
</g>
<!-- N23&#45;&gt;N14 -->
<g id="edge3" class="edge"><title>N23&#45;&gt;N14</title>
<g id="a_edge3"><a xlink:title="main.main &#45;&gt; regexp.(*Regexp).Match (1.31s)">
<path fill="none" stroke="black" stroke-width="5" d="M667.5,-633.978C667.5,-622.145 667.5,-606.025 667.5,-591.898"/>
<polygon fill="black" stroke="black" stroke-width="5" points="671.875,-591.588 667.5,-581.588 663.125,-591.588 671.875,-591.588"/>
</a>
</g>
<g id="a_edge3&#45;label"><a xlink:title="main.main &#45;&gt; regexp.(*Regexp).Match (1.31s)">
<text text-anchor="middle" x="684.5" y="-604.8" font-family="Times,serif" font-size="14.00"> 1.31s</text>
</a>
</g>
</g>
<!-- N25 -->
<g id="node26" class="node"><title>N25</title>
<g id="a_node26"><a xlink:title="os.(*File).read (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="1274.5,-386 1200.5,-386 1200.5,-350 1274.5,-350 1274.5,-386"/>
<text text-anchor="middle" x="1237.5" y="-370.6" font-family="Times,serif" font-size="8.00">os.(*File).read</text>
<text text-anchor="middle" x="1237.5" y="-361.6" font-family="Times,serif" font-size="8.00">0 of 0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N24&#45;&gt;N25 -->
<g id="edge14" class="edge"><title>N24&#45;&gt;N25</title>
<g id="a_edge14"><a xlink:title="os.(*File).Read &#45;&gt; os.(*File).read (0.08s)">
<path fill="none" stroke="black" d="M1145.01,-444.949C1154.37,-438.272 1165.05,-430.441 1174.5,-423 1186.61,-413.462 1199.61,-402.461 1210.63,-392.887"/>
<polygon fill="black" stroke="black" points="1213.04,-395.427 1218.27,-386.21 1208.44,-390.157 1213.04,-395.427"/>
</a>
</g>
<g id="a_edge14&#45;label"><a xlink:title="os.(*File).Read &#45;&gt; os.(*File).read (0.08s)">
<text text-anchor="middle" x="1208.5" y="-411.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
<!-- N30 -->
<g id="node31" class="node"><title>N30</title>
<g id="a_node31"><a xlink:title="syscall.Read (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="1286.5,-282 1212.5,-282 1212.5,-246 1286.5,-246 1286.5,-282"/>
<text text-anchor="middle" x="1249.5" y="-266.6" font-family="Times,serif" font-size="8.00">syscall.Read</text>
<text text-anchor="middle" x="1249.5" y="-257.6" font-family="Times,serif" font-size="8.00">0 of 0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N25&#45;&gt;N30 -->
<g id="edge15" class="edge"><title>N25&#45;&gt;N30</title>
<g id="a_edge15"><a xlink:title="os.(*File).read &#45;&gt; syscall.Read (0.08s)">
<path fill="none" stroke="black" d="M1239.54,-349.697C1241.39,-333.923 1244.16,-310.364 1246.31,-292.094"/>
<polygon fill="black" stroke="black" points="1249.8,-292.388 1247.49,-282.047 1242.85,-291.57 1249.8,-292.388"/>
</a>
</g>
<g id="a_edge15&#45;label"><a xlink:title="os.(*File).read &#45;&gt; syscall.Read (0.08s)">
<text text-anchor="middle" x="1260.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
<!-- N26&#45;&gt;N9 -->
<g id="edge25" class="edge"><title>N26&#45;&gt;N9</title>
<g id="a_edge25"><a xlink:title="regexp.(*Regexp).put &#45;&gt; sync.(*Mutex).Unlock (0.04s)">
<path fill="none" stroke="black" d="M928.225,-349.886C924.029,-338.423 917.235,-323.555 907.5,-313 900.622,-305.542 892.317,-298.898 883.666,-293.106"/>
<polygon fill="black" stroke="black" points="885.266,-289.976 874.941,-287.6 881.53,-295.896 885.266,-289.976"/>
</a>
</g>
<g id="a_edge25&#45;label"><a xlink:title="regexp.(*Regexp).put &#45;&gt; sync.(*Mutex).Unlock (0.04s)">
<text text-anchor="middle" x="935.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.04s</text>
</a>
</g>
</g>
<!-- N26&#45;&gt;N19 -->
<g id="edge24" class="edge"><title>N26&#45;&gt;N19</title>
<g id="a_edge24"><a xlink:title="regexp.(*Regexp).put &#45;&gt; sync.(*Mutex).Lock (0.04s)">
<path fill="none" stroke="black" d="M949.353,-349.642C954.681,-343.183 960.325,-335.575 964.5,-328 970.01,-318.005 974.537,-306.373 978.022,-295.844"/>
<polygon fill="black" stroke="black" points="981.401,-296.765 981.042,-286.176 974.719,-294.678 981.401,-296.765"/>
</a>
</g>
<g id="a_edge24&#45;label"><a xlink:title="regexp.(*Regexp).put &#45;&gt; sync.(*Mutex).Lock (0.04s)">
<text text-anchor="middle" x="989.5" y="-316.8" font-family="Times,serif" font-size="14.00"> 0.04s</text>
</a>
</g>
</g>
<!-- N27&#45;&gt;N22 -->
<g id="edge33" class="edge"><title>N27&#45;&gt;N22</title>
<g id="a_edge33"><a xlink:title="regexp/syntax.(*Inst).MatchRune &#45;&gt; regexp/syntax.(*Inst).MatchRunePos (0.01s)">
<path fill="none" stroke="black" d="M342.759,-128.343C330.284,-122.031 315.529,-115.366 301.5,-111 252.523,-95.7571 235.458,-111.198 187.5,-93 162.98,-83.6959 138.112,-67.6405 119.694,-54.1994"/>
<polygon fill="black" stroke="black" points="121.563,-51.2266 111.456,-48.0473 117.374,-56.8352 121.563,-51.2266"/>
</a>
</g>
<g id="a_edge33&#45;label"><a xlink:title="regexp/syntax.(*Inst).MatchRune &#45;&gt; regexp/syntax.(*Inst).MatchRunePos (0.01s)">
<text text-anchor="middle" x="204.5" y="-81.8" font-family="Times,serif" font-size="14.00"> 0.01s</text>
</a>
</g>
</g>
<!-- N28 -->
<g id="node29" class="node"><title>N28</title>
<g id="a_node29"><a xlink:title="runtime.goexit (1.53s)">
<polygon fill="#f8f8f8" stroke="black" points="703.5,-882.5 631.5,-882.5 631.5,-846.5 703.5,-846.5 703.5,-882.5"/>
<text text-anchor="middle" x="667.5" y="-867.1" font-family="Times,serif" font-size="8.00">runtime.goexit</text>
<text text-anchor="middle" x="667.5" y="-858.1" font-family="Times,serif" font-size="8.00">0 of 1.53s(100%)</text>
</a>
</g>
</g>
<!-- N29 -->
<g id="node30" class="node"><title>N29</title>
<g id="a_node30"><a xlink:title="runtime.main (1.53s)">
<polygon fill="#f8f8f8" stroke="black" points="703.5,-757 631.5,-757 631.5,-721 703.5,-721 703.5,-757"/>
<text text-anchor="middle" x="667.5" y="-741.6" font-family="Times,serif" font-size="8.00">runtime.main</text>
<text text-anchor="middle" x="667.5" y="-732.6" font-family="Times,serif" font-size="8.00">0 of 1.53s(100%)</text>
</a>
</g>
</g>
<!-- N28&#45;&gt;N29 -->
<g id="edge1" class="edge"><title>N28&#45;&gt;N29</title>
<g id="a_edge1"><a xlink:title="runtime.goexit &#45;&gt; runtime.main (1.53s)">
<path fill="none" stroke="black" stroke-width="6" d="M667.5,-846.328C667.5,-825.867 667.5,-791.423 667.5,-767.297"/>
<polygon fill="black" stroke="black" stroke-width="6" points="672.75,-767.026 667.5,-757.026 662.25,-767.026 672.75,-767.026"/>
</a>
</g>
<g id="a_edge1&#45;label"><a xlink:title="runtime.goexit &#45;&gt; runtime.main (1.53s)">
<text text-anchor="middle" x="684.5" y="-778.8" font-family="Times,serif" font-size="14.00"> 1.53s</text>
</a>
</g>
</g>
<!-- N29&#45;&gt;N23 -->
<g id="edge2" class="edge"><title>N29&#45;&gt;N23</title>
<g id="a_edge2"><a xlink:title="runtime.main &#45;&gt; main.main (1.53s)">
<path fill="none" stroke="black" stroke-width="6" d="M667.5,-720.799C667.5,-709.163 667.5,-693.548 667.5,-680.237"/>
<polygon fill="black" stroke="black" stroke-width="6" points="672.75,-680.175 667.5,-670.175 662.25,-680.175 672.75,-680.175"/>
</a>
</g>
<g id="a_edge2&#45;label"><a xlink:title="runtime.main &#45;&gt; main.main (1.53s)">
<text text-anchor="middle" x="684.5" y="-691.8" font-family="Times,serif" font-size="14.00"> 1.53s</text>
</a>
</g>
</g>
<!-- N31 -->
<g id="node32" class="node"><title>N31</title>
<g id="a_node32"><a xlink:title="syscall.read (0.08s)">
<polygon fill="#f8f8f8" stroke="black" points="1286.5,-164.5 1212.5,-164.5 1212.5,-128.5 1286.5,-128.5 1286.5,-164.5"/>
<text text-anchor="middle" x="1249.5" y="-149.1" font-family="Times,serif" font-size="8.00">syscall.read</text>
<text text-anchor="middle" x="1249.5" y="-140.1" font-family="Times,serif" font-size="8.00">0 of 0.08s(5.23%)</text>
</a>
</g>
</g>
<!-- N30&#45;&gt;N31 -->
<g id="edge18" class="edge"><title>N30&#45;&gt;N31</title>
<g id="a_edge18"><a xlink:title="syscall.Read &#45;&gt; syscall.read (0.08s)">
<path fill="none" stroke="black" d="M1249.5,-245.958C1249.5,-227.191 1249.5,-196.756 1249.5,-174.687"/>
<polygon fill="black" stroke="black" points="1253,-174.612 1249.5,-164.612 1246,-174.612 1253,-174.612"/>
</a>
</g>
<g id="a_edge18&#45;label"><a xlink:title="syscall.Read &#45;&gt; syscall.read (0.08s)">
<text text-anchor="middle" x="1266.5" y="-203.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
<!-- N31&#45;&gt;N4 -->
<g id="edge19" class="edge"><title>N31&#45;&gt;N4</title>
<g id="a_edge19"><a xlink:title="syscall.read &#45;&gt; syscall.Syscall (0.08s)">
<path fill="none" stroke="black" d="M1249.5,-128.11C1249.5,-109.914 1249.5,-81.052 1249.5,-59.5151"/>
<polygon fill="black" stroke="black" points="1253,-59.313 1249.5,-49.3131 1246,-59.3131 1253,-59.313"/>
</a>
</g>
<g id="a_edge19&#45;label"><a xlink:title="syscall.read &#45;&gt; syscall.Syscall (0.08s)">
<text text-anchor="middle" x="1266.5" y="-81.8" font-family="Times,serif" font-size="14.00"> 0.08s</text>
</a>
</g>
</g>
</g>
</g></svg>
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"regexp"
"runtime/pprof"
)
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
func main() {
flag.Parse()
if *cpuprofile != "" {
f, err := os.Create(*cpuprofile)
if err != nil {
log.Fatal(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
file, err := os.Open(flag.Args()[0])
if err != nil {
panic(err)
}
defer file.Close()
scanner := bufio.NewScanner(file)
var i int
// Compile regular expression first
r := regexp.MustCompile(`sshd\[\d{5}\]:\s*Failed`)
for scanner.Scan() {
line := scanner.Text()
if r.MatchString(line) {
i++
}
}
if err := scanner.Err(); err != nil {
fmt.Println(err)
}
fmt.Println(i)
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment