Commit 8bc6d19a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3ff8da1e
<?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: t_syspread_go 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 1020)">
<title>t_syspread_go</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-1020 694,-1020 694,4 -4,4"/>
<g id="clust1" class="cluster"><title>cluster_L</title>
<polygon fill="none" stroke="black" points="8,-876 8,-1008 478,-1008 478,-876 8,-876"/>
</g>
<!-- File: t_syspread_go -->
<g id="node1" class="node"><title>File: t_syspread_go</title>
<polygon fill="#f8f8f8" stroke="black" points="470.5,-1000 15.5,-1000 15.5,-884 470.5,-884 470.5,-1000"/>
<text text-anchor="start" x="23.5" y="-983.2" font-family="Times,serif" font-size="16.00">File: t_syspread_go</text>
<text text-anchor="start" x="23.5" y="-965.2" font-family="Times,serif" font-size="16.00">Type: cpu</text>
<text text-anchor="start" x="23.5" y="-947.2" font-family="Times,serif" font-size="16.00">Time: Mar 17, 2017 at 11:21am (MSK)</text>
<text text-anchor="start" x="23.5" y="-929.2" font-family="Times,serif" font-size="16.00">Duration: 14.81s, Total samples = 146.50ms ( 0.99%)</text>
<text text-anchor="start" x="23.5" y="-911.2" font-family="Times,serif" font-size="16.00">Showing nodes accounting for 146.40ms, 99.93% of 146.50ms total</text>
<text text-anchor="start" x="23.5" y="-893.2" font-family="Times,serif" font-size="16.00">Dropped 4 nodes (cum &lt;= 0.73ms)</text>
</g>
<!-- N1 -->
<g id="node2" class="node"><title>N1</title>
<g id="a_node2"><a xlink:title="syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s (143.70ms)">
<polygon fill="#edd5d5" stroke="#b20100" points="652.5,-496 419.5,-496 419.5,-358 652.5,-358 652.5,-496"/>
<text text-anchor="middle" x="536" y="-472.8" font-family="Times,serif" font-size="24.00">syscall</text>
<text text-anchor="middle" x="536" y="-446.8" font-family="Times,serif" font-size="24.00">Syscall6</text>
<text text-anchor="middle" x="536" y="-420.8" font-family="Times,serif" font-size="24.00">asm_linux_amd64.s</text>
<text text-anchor="middle" x="536" y="-394.8" font-family="Times,serif" font-size="24.00">115.30ms (78.70%)</text>
<text text-anchor="middle" x="536" y="-368.8" font-family="Times,serif" font-size="24.00">of 143.70ms (98.09%)</text>
</a>
</g>
</g>
<!-- N5 -->
<g id="node6" class="node"><title>N5</title>
<g id="a_node6"><a xlink:title="runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (13.20ms)">
<polygon fill="#ede7e2" stroke="#b28b62" points="467,-307 363,-307 363,-239 467,-239 467,-307"/>
<text text-anchor="middle" x="415" y="-294.2" font-family="Times,serif" font-size="11.00">runtime</text>
<text text-anchor="middle" x="415" y="-282.2" font-family="Times,serif" font-size="11.00">exitsyscall</text>
<text text-anchor="middle" x="415" y="-270.2" font-family="Times,serif" font-size="11.00">proc.go</text>
<text text-anchor="middle" x="415" y="-258.2" font-family="Times,serif" font-size="11.00">3.50ms (2.39%)</text>
<text text-anchor="middle" x="415" y="-246.2" font-family="Times,serif" font-size="11.00">of 13.20ms (9.01%)</text>
</a>
</g>
</g>
<!-- N1&#45;&gt;N5 -->
<g id="edge7" class="edge"><title>N1&#45;&gt;N5</title>
<g id="a_edge7"><a xlink:title="syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s &#45;&gt; runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (13.20ms)">
<path fill="none" stroke="#b28b62" d="M481.518,-357.559C469.985,-343.073 458.159,-328.216 447.736,-315.123"/>
<polygon fill="#b28b62" stroke="#b28b62" points="450.409,-312.862 441.443,-307.218 444.933,-317.221 450.409,-312.862"/>
</a>
</g>
<g id="a_edge7&#45;label"><a xlink:title="syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s &#45;&gt; runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (13.20ms)">
<text text-anchor="middle" x="491" y="-328.8" font-family="Times,serif" font-size="14.00"> 13.20ms</text>
</a>
</g>
</g>
<!-- N8 -->
<g id="node9" class="node"><title>N8</title>
<g id="a_node9"><a xlink:title="runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (15.20ms)">
<polygon fill="#ede6e0" stroke="#b28355" points="586.5,-304.5 485.5,-304.5 485.5,-241.5 586.5,-241.5 586.5,-304.5"/>
<text text-anchor="middle" x="536" y="-292.5" font-family="Times,serif" font-size="10.00">runtime</text>
<text text-anchor="middle" x="536" y="-281.5" font-family="Times,serif" font-size="10.00">entersyscall</text>
<text text-anchor="middle" x="536" y="-270.5" font-family="Times,serif" font-size="10.00">proc.go</text>
<text text-anchor="middle" x="536" y="-259.5" font-family="Times,serif" font-size="10.00">0.50ms (0.34%)</text>
<text text-anchor="middle" x="536" y="-248.5" font-family="Times,serif" font-size="10.00">of 15.20ms (10.38%)</text>
</a>
</g>
</g>
<!-- N1&#45;&gt;N8 -->
<g id="edge5" class="edge"><title>N1&#45;&gt;N8</title>
<g id="a_edge5"><a xlink:title="syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s &#45;&gt; runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (15.20ms)">
<path fill="none" stroke="#b28355" d="M536,-357.559C536,-343.01 536,-328.087 536,-314.953"/>
<polygon fill="#b28355" stroke="#b28355" points="539.5,-314.844 536,-304.844 532.5,-314.844 539.5,-314.844"/>
</a>
</g>
<g id="a_edge5&#45;label"><a xlink:title="syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s &#45;&gt; runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (15.20ms)">
<text text-anchor="middle" x="562" y="-328.8" font-family="Times,serif" font-size="14.00"> 15.20ms</text>
</a>
</g>
</g>
<!-- N2 -->
<g id="node3" class="node"><title>N2</title>
<g id="a_node3"><a xlink:title="runtime.main /home/kirr/src/tools/go/go/src/runtime/proc.go (146.40ms)">
<polygon fill="#edd5d5" stroke="#b20000" points="583,-964 489,-964 489,-920 583,-920 583,-964"/>
<text text-anchor="middle" x="536" y="-953.6" font-family="Times,serif" font-size="8.00">runtime</text>
<text text-anchor="middle" x="536" y="-944.6" font-family="Times,serif" font-size="8.00">main</text>
<text text-anchor="middle" x="536" y="-935.6" font-family="Times,serif" font-size="8.00">proc.go</text>
<text text-anchor="middle" x="536" y="-926.6" font-family="Times,serif" font-size="8.00">0 of 146.40ms (99.93%)</text>
</a>
</g>
</g>
<!-- N6 -->
<g id="node7" class="node"><title>N6</title>
<g id="a_node7"><a xlink:title="main.main /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go (146.40ms)">
<polygon fill="#edd5d5" stroke="#b20000" points="589.5,-833 482.5,-833 482.5,-770 589.5,-770 589.5,-833"/>
<text text-anchor="middle" x="536" y="-821" font-family="Times,serif" font-size="10.00">main</text>
<text text-anchor="middle" x="536" y="-810" font-family="Times,serif" font-size="10.00">main</text>
<text text-anchor="middle" x="536" y="-799" font-family="Times,serif" font-size="10.00">t_syspread_go.go</text>
<text text-anchor="middle" x="536" y="-788" font-family="Times,serif" font-size="10.00">1.50ms (1.02%)</text>
<text text-anchor="middle" x="536" y="-777" font-family="Times,serif" font-size="10.00">of 146.40ms (99.93%)</text>
</a>
</g>
</g>
<!-- N2&#45;&gt;N6 -->
<g id="edge1" class="edge"><title>N2&#45;&gt;N6</title>
<g id="a_edge1"><a xlink:title="runtime.main /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; main.main /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go (146.40ms)">
<path fill="none" stroke="#b20000" stroke-width="5" d="M536,-919.965C536,-899.679 536,-868.436 536,-843.269"/>
<polygon fill="#b20000" stroke="#b20000" stroke-width="5" points="540.375,-843.258 536,-833.258 531.625,-843.258 540.375,-843.258"/>
</a>
</g>
<g id="a_edge1&#45;label"><a xlink:title="runtime.main /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; main.main /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go (146.40ms)">
<text text-anchor="middle" x="565" y="-854.8" font-family="Times,serif" font-size="14.00"> 146.40ms</text>
</a>
</g>
</g>
<!-- N3 -->
<g id="node4" class="node"><title>N3</title>
<g id="a_node4"><a xlink:title="runtime.casgstatus /home/kirr/src/tools/go/go/src/runtime/proc.go (9.90ms)">
<polygon fill="#ede9e5" stroke="#b29776" points="586.5,-64 485.5,-64 485.5,-0 586.5,-0 586.5,-64"/>
<text text-anchor="middle" x="536" y="-49.6" font-family="Times,serif" font-size="13.00">runtime</text>
<text text-anchor="middle" x="536" y="-35.6" font-family="Times,serif" font-size="13.00">casgstatus</text>
<text text-anchor="middle" x="536" y="-21.6" font-family="Times,serif" font-size="13.00">proc.go</text>
<text text-anchor="middle" x="536" y="-7.6" font-family="Times,serif" font-size="13.00">9.90ms (6.76%)</text>
</a>
</g>
</g>
<!-- N4 -->
<g id="node5" class="node"><title>N4</title>
<g id="a_node5"><a xlink:title="runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (13.90ms)">
<polygon fill="#ede7e1" stroke="#b2885d" points="591.5,-188 480.5,-188 480.5,-115 591.5,-115 591.5,-188"/>
<text text-anchor="middle" x="536" y="-174.4" font-family="Times,serif" font-size="12.00">runtime</text>
<text text-anchor="middle" x="536" y="-161.4" font-family="Times,serif" font-size="12.00">reentersyscall</text>
<text text-anchor="middle" x="536" y="-148.4" font-family="Times,serif" font-size="12.00">proc.go</text>
<text text-anchor="middle" x="536" y="-135.4" font-family="Times,serif" font-size="12.00">7ms (4.78%)</text>
<text text-anchor="middle" x="536" y="-122.4" font-family="Times,serif" font-size="12.00">of 13.90ms (9.49%)</text>
</a>
</g>
</g>
<!-- N4&#45;&gt;N3 -->
<g id="edge8" class="edge"><title>N4&#45;&gt;N3</title>
<g id="a_edge8"><a xlink:title="runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.casgstatus /home/kirr/src/tools/go/go/src/runtime/proc.go (6.10ms)">
<path fill="none" stroke="#b2a48d" d="M536,-114.927C536,-102.136 536,-87.5987 536,-74.3571"/>
<polygon fill="#b2a48d" stroke="#b2a48d" points="539.5,-74.0735 536,-64.0735 532.5,-74.0735 539.5,-74.0735"/>
</a>
</g>
<g id="a_edge8&#45;label"><a xlink:title="runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.casgstatus /home/kirr/src/tools/go/go/src/runtime/proc.go (6.10ms)">
<text text-anchor="middle" x="558.5" y="-85.8" font-family="Times,serif" font-size="14.00"> 6.10ms</text>
</a>
</g>
</g>
<!-- N13 -->
<g id="node14" class="node"><title>N13</title>
<g id="a_node14"><a xlink:title="runtime.save /home/kirr/src/tools/go/go/src/runtime/proc.go (0.80ms)">
<polygon fill="#ededec" stroke="#b2b1ad" points="685,-58 605,-58 605,-6 685,-6 685,-58"/>
<text text-anchor="middle" x="645" y="-46" font-family="Times,serif" font-size="10.00">runtime</text>
<text text-anchor="middle" x="645" y="-35" font-family="Times,serif" font-size="10.00">save</text>
<text text-anchor="middle" x="645" y="-24" font-family="Times,serif" font-size="10.00">proc.go</text>
<text text-anchor="middle" x="645" y="-13" font-family="Times,serif" font-size="10.00">0.80ms (0.55%)</text>
</a>
</g>
</g>
<!-- N4&#45;&gt;N13 -->
<g id="edge13" class="edge"><title>N4&#45;&gt;N13</title>
<g id="a_edge13"><a xlink:title="runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.save /home/kirr/src/tools/go/go/src/runtime/proc.go (0.80ms)">
<path fill="none" stroke="#b2b1ad" d="M568.999,-114.927C583.513,-99.282 600.449,-81.0252 614.645,-65.7217"/>
<polygon fill="#b2b1ad" stroke="#b2b1ad" points="617.557,-67.7292 621.792,-58.0176 612.425,-62.9686 617.557,-67.7292"/>
</a>
</g>
<g id="a_edge13&#45;label"><a xlink:title="runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.save /home/kirr/src/tools/go/go/src/runtime/proc.go (0.80ms)">
<text text-anchor="middle" x="620.5" y="-85.8" font-family="Times,serif" font-size="14.00"> 0.80ms</text>
</a>
</g>
</g>
<!-- N5&#45;&gt;N3 -->
<g id="edge10" class="edge"><title>N5&#45;&gt;N3</title>
<g id="a_edge10"><a xlink:title="runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.casgstatus /home/kirr/src/tools/go/go/src/runtime/proc.go (3.80ms)">
<path fill="none" stroke="#b2aa9b" d="M409.671,-238.822C405.987,-205.425 404.972,-153.484 426,-115 437.591,-93.7874 457.278,-76.5069 476.821,-63.3745"/>
<polygon fill="#b2aa9b" stroke="#b2aa9b" points="478.944,-66.1708 485.461,-57.8176 475.157,-60.2833 478.944,-66.1708"/>
</a>
</g>
<g id="a_edge10&#45;label"><a xlink:title="runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.casgstatus /home/kirr/src/tools/go/go/src/runtime/proc.go (3.80ms)">
<text text-anchor="middle" x="448.5" y="-147.8" font-family="Times,serif" font-size="14.00"> 3.80ms</text>
</a>
</g>
</g>
<!-- N7 -->
<g id="node8" class="node"><title>N7</title>
<g id="a_node8"><a xlink:title="runtime.exitsyscallfast /home/kirr/src/tools/go/go/src/runtime/proc.go (5.90ms)">
<polygon fill="#edebe8" stroke="#b2a48e" points="380.5,-188 275.5,-188 275.5,-115 380.5,-115 380.5,-188"/>
<text text-anchor="middle" x="328" y="-174.4" font-family="Times,serif" font-size="12.00">runtime</text>
<text text-anchor="middle" x="328" y="-161.4" font-family="Times,serif" font-size="12.00">exitsyscallfast</text>
<text text-anchor="middle" x="328" y="-148.4" font-family="Times,serif" font-size="12.00">proc.go</text>
<text text-anchor="middle" x="328" y="-135.4" font-family="Times,serif" font-size="12.00">4.90ms (3.34%)</text>
<text text-anchor="middle" x="328" y="-122.4" font-family="Times,serif" font-size="12.00">of 5.90ms (4.03%)</text>
</a>
</g>
</g>
<!-- N5&#45;&gt;N7 -->
<g id="edge9" class="edge"><title>N5&#45;&gt;N7</title>
<g id="a_edge9"><a xlink:title="runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.exitsyscallfast /home/kirr/src/tools/go/go/src/runtime/proc.go (5.90ms)">
<path fill="none" stroke="#b2a48e" d="M373.559,-238.861C367.914,-233.266 362.518,-227.237 358,-221 352.799,-213.819 348.237,-205.594 344.345,-197.393"/>
<polygon fill="#b2a48e" stroke="#b2a48e" points="347.512,-195.902 340.236,-188.202 341.122,-198.759 347.512,-195.902"/>
</a>
</g>
<g id="a_edge9&#45;label"><a xlink:title="runtime.exitsyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.exitsyscallfast /home/kirr/src/tools/go/go/src/runtime/proc.go (5.90ms)">
<text text-anchor="middle" x="380.5" y="-209.8" font-family="Times,serif" font-size="14.00"> 5.90ms</text>
</a>
</g>
</g>
<!-- N10 -->
<g id="node11" class="node"><title>N10</title>
<g id="a_node11"><a xlink:title="main.xpread /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go (144.90ms)">
<polygon fill="#edd5d5" stroke="#b20000" points="585,-719 487,-719 487,-661 585,-661 585,-719"/>
<text text-anchor="middle" x="536" y="-707.8" font-family="Times,serif" font-size="9.00">main</text>
<text text-anchor="middle" x="536" y="-697.8" font-family="Times,serif" font-size="9.00">xpread</text>
<text text-anchor="middle" x="536" y="-687.8" font-family="Times,serif" font-size="9.00">t_syspread_go.go</text>
<text text-anchor="middle" x="536" y="-677.8" font-family="Times,serif" font-size="9.00">0.40ms (0.27%)</text>
<text text-anchor="middle" x="536" y="-667.8" font-family="Times,serif" font-size="9.00">of 144.90ms (98.91%)</text>
</a>
</g>
</g>
<!-- N6&#45;&gt;N10 -->
<g id="edge2" class="edge"><title>N6&#45;&gt;N10</title>
<g id="a_edge2"><a xlink:title="main.main /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go &#45;&gt; main.xpread /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go (144.90ms)">
<path fill="none" stroke="#b20000" stroke-width="5" d="M536,-769.998C536,-757.415 536,-742.69 536,-729.386"/>
<polygon fill="#b20000" stroke="#b20000" stroke-width="5" points="540.375,-729.088 536,-719.088 531.625,-729.088 540.375,-729.088"/>
</a>
</g>
<g id="a_edge2&#45;label"><a xlink:title="main.main /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go &#45;&gt; main.xpread /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go (144.90ms)">
<text text-anchor="middle" x="565" y="-740.8" font-family="Times,serif" font-size="14.00"> 144.90ms</text>
</a>
</g>
</g>
<!-- N11 -->
<g id="node12" class="node"><title>N11</title>
<g id="a_node12"><a xlink:title="runtime.exitsyscallfast_reacquired /home/kirr/src/tools/go/go/src/runtime/proc.go (1ms)">
<polygon fill="#edecec" stroke="#b2b1ac" points="389,-58 267,-58 267,-6 389,-6 389,-58"/>
<text text-anchor="middle" x="328" y="-46" font-family="Times,serif" font-size="10.00">runtime</text>
<text text-anchor="middle" x="328" y="-35" font-family="Times,serif" font-size="10.00">exitsyscallfast_reacquired</text>
<text text-anchor="middle" x="328" y="-24" font-family="Times,serif" font-size="10.00">proc.go</text>
<text text-anchor="middle" x="328" y="-13" font-family="Times,serif" font-size="10.00">1ms (0.68%)</text>
</a>
</g>
</g>
<!-- N7&#45;&gt;N11 -->
<g id="edge11" class="edge"><title>N7&#45;&gt;N11</title>
<g id="a_edge11"><a xlink:title="runtime.exitsyscallfast /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.exitsyscallfast_reacquired /home/kirr/src/tools/go/go/src/runtime/proc.go (1ms)">
<path fill="none" stroke="#b2b1ac" d="M328,-114.927C328,-100.143 328,-83.0272 328,-68.2748"/>
<polygon fill="#b2b1ac" stroke="#b2b1ac" points="331.5,-68.0176 328,-58.0176 324.5,-68.0176 331.5,-68.0176"/>
</a>
</g>
<g id="a_edge11&#45;label"><a xlink:title="runtime.exitsyscallfast /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.exitsyscallfast_reacquired /home/kirr/src/tools/go/go/src/runtime/proc.go (1ms)">
<text text-anchor="middle" x="342" y="-85.8" font-family="Times,serif" font-size="14.00"> 1ms</text>
</a>
</g>
</g>
<!-- N8&#45;&gt;N4 -->
<g id="edge6" class="edge"><title>N8&#45;&gt;N4</title>
<g id="a_edge6"><a xlink:title="runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (13.90ms)">
<path fill="none" stroke="#b2885d" d="M536,-241.226C536,-228.204 536,-212.76 536,-198.436"/>
<polygon fill="#b2885d" stroke="#b2885d" points="539.5,-198.255 536,-188.255 532.5,-198.255 539.5,-198.255"/>
</a>
</g>
<g id="a_edge6&#45;label"><a xlink:title="runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.reentersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go (13.90ms)">
<text text-anchor="middle" x="562" y="-209.8" font-family="Times,serif" font-size="14.00"> 13.90ms</text>
</a>
</g>
</g>
<!-- N12 -->
<g id="node13" class="node"><title>N12</title>
<g id="a_node13"><a xlink:title="runtime.getcallerpc /home/kirr/src/tools/go/go/src/runtime/asm_amd64.s (0.80ms)">
<polygon fill="#ededec" stroke="#b2b1ad" points="690,-177.5 610,-177.5 610,-125.5 690,-125.5 690,-177.5"/>
<text text-anchor="middle" x="650" y="-165.5" font-family="Times,serif" font-size="10.00">runtime</text>
<text text-anchor="middle" x="650" y="-154.5" font-family="Times,serif" font-size="10.00">getcallerpc</text>
<text text-anchor="middle" x="650" y="-143.5" font-family="Times,serif" font-size="10.00">asm_amd64.s</text>
<text text-anchor="middle" x="650" y="-132.5" font-family="Times,serif" font-size="10.00">0.80ms (0.55%)</text>
</a>
</g>
</g>
<!-- N8&#45;&gt;N12 -->
<g id="edge12" class="edge"><title>N8&#45;&gt;N12</title>
<g id="a_edge12"><a xlink:title="runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.getcallerpc /home/kirr/src/tools/go/go/src/runtime/asm_amd64.s (0.80ms)">
<path fill="none" stroke="#b2b1ad" d="M571.016,-241.395C578.122,-234.83 585.427,-227.815 592,-221 602.811,-209.791 614.02,-196.895 623.669,-185.336"/>
<polygon fill="#b2b1ad" stroke="#b2b1ad" points="626.403,-187.523 630.076,-177.585 621.007,-183.063 626.403,-187.523"/>
</a>
</g>
<g id="a_edge12&#45;label"><a xlink:title="runtime.entersyscall /home/kirr/src/tools/go/go/src/runtime/proc.go &#45;&gt; runtime.getcallerpc /home/kirr/src/tools/go/go/src/runtime/asm_amd64.s (0.80ms)">
<text text-anchor="middle" x="628.5" y="-209.8" font-family="Times,serif" font-size="14.00"> 0.80ms</text>
</a>
</g>
</g>
<!-- N9 -->
<g id="node10" class="node"><title>N9</title>
<g id="a_node10"><a xlink:title="syscall.Pread /home/kirr/src/tools/go/go/src/syscall/zsyscall_linux_amd64.go (144.50ms)">
<polygon fill="#edd5d5" stroke="#b20000" points="597,-610 475,-610 475,-547 597,-547 597,-610"/>
<text text-anchor="middle" x="536" y="-598" font-family="Times,serif" font-size="10.00">syscall</text>
<text text-anchor="middle" x="536" y="-587" font-family="Times,serif" font-size="10.00">Pread</text>
<text text-anchor="middle" x="536" y="-576" font-family="Times,serif" font-size="10.00">zsyscall_linux_amd64.go</text>
<text text-anchor="middle" x="536" y="-565" font-family="Times,serif" font-size="10.00">0.80ms (0.55%)</text>
<text text-anchor="middle" x="536" y="-554" font-family="Times,serif" font-size="10.00">of 144.50ms (98.63%)</text>
</a>
</g>
</g>
<!-- N9&#45;&gt;N1 -->
<g id="edge4" class="edge"><title>N9&#45;&gt;N1</title>
<g id="a_edge4"><a xlink:title="syscall.Pread /home/kirr/src/tools/go/go/src/syscall/zsyscall_linux_amd64.go &#45;&gt; syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s (143.70ms)">
<path fill="none" stroke="#b20100" stroke-width="5" d="M536,-546.886C536,-534.947 536,-520.669 536,-506.218"/>
<polygon fill="#b20100" stroke="#b20100" stroke-width="5" points="540.375,-506.212 536,-496.212 531.625,-506.212 540.375,-506.212"/>
</a>
</g>
<g id="a_edge4&#45;label"><a xlink:title="syscall.Pread /home/kirr/src/tools/go/go/src/syscall/zsyscall_linux_amd64.go &#45;&gt; syscall.Syscall6 /home/kirr/src/tools/go/go/src/syscall/asm_linux_amd64.s (143.70ms)">
<text text-anchor="middle" x="565" y="-517.8" font-family="Times,serif" font-size="14.00"> 143.70ms</text>
</a>
</g>
</g>
<!-- N10&#45;&gt;N9 -->
<g id="edge3" class="edge"><title>N10&#45;&gt;N9</title>
<g id="a_edge3"><a xlink:title="main.xpread /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go &#45;&gt; syscall.Pread /home/kirr/src/tools/go/go/src/syscall/zsyscall_linux_amd64.go (144.50ms)">
<path fill="none" stroke="#b20000" stroke-width="5" d="M536,-660.801C536,-648.48 536,-633.792 536,-620.312"/>
<polygon fill="#b20000" stroke="#b20000" stroke-width="5" points="540.375,-620.298 536,-610.298 531.625,-620.298 540.375,-620.298"/>
</a>
</g>
<g id="a_edge3&#45;label"><a xlink:title="main.xpread /home/kirr/src/wendelin/z/rust/bench/t_syspread_go.go &#45;&gt; syscall.Pread /home/kirr/src/tools/go/go/src/syscall/zsyscall_linux_amd64.go (144.50ms)">
<text text-anchor="middle" x="565" y="-631.8" font-family="Times,serif" font-size="14.00"> 144.50ms</text>
</a>
</g>
</g>
</g>
</g></svg>
......@@ -6,6 +6,7 @@ import (
"log"
"os"
"runtime/pprof"
"syscall"
"time"
)
......@@ -13,8 +14,8 @@ import (
const Niter = 1000000
// xpread is pread(2) but aborts on an error or when fewer bytes was read
func xpread(f *os.File, buf []byte, offset int64) {
n, err := f.ReadAt(buf, offset)
func xpread(fd int, buf []byte, offset int64) {
n, err := syscall.Pread(fd, buf, offset)
if err != nil {
panic(err)
}
......@@ -23,6 +24,18 @@ func xpread(f *os.File, buf []byte, offset int64) {
}
}
// xreadat is ReadAt but aborts on an error or when fewer bytes was read
func xreadat(f *os.File, buf []byte, offset int64) {
n, err := f.ReadAt(buf, offset)
if err != nil {
panic(err)
}
if n != len(buf) {
panic(fmt.Errorf("readat(%v) -> %v", len(buf), n))
}
}
const BufSize = 4096
var buf [BufSize]byte
......@@ -50,17 +63,18 @@ func main() {
if err != nil {
log.Fatal(err)
}
fd := int(f.Fd())
for size := 0; size <= BufSize; {
sbuf := buf[:size]
// warmup
xpread(f, sbuf, /*offset=*/0)
xpread(fd, sbuf, /*offset=*/0)
Tstart := time.Now()
for i := 0; i < Niter; i++ {
xpread(f, sbuf, /*offset=*/0)
xpread(fd, sbuf, /*offset=*/0)
}
Tend := time.Now()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment