Author: Maciej Fijalkowski <[email protected]>
Branch: extradoc
Changeset: r4262:7c0f05196854
Date: 2012-07-03 12:32 +0200
http://bitbucket.org/pypy/extradoc/changeset/7c0f05196854/
Log: talk, completely fijal-dependent
diff --git a/talk/ep2012/tools/demo.py b/talk/ep2012/tools/demo.py
new file mode 100644
--- /dev/null
+++ b/talk/ep2012/tools/demo.py
@@ -0,0 +1,114 @@
+
+def simple():
+ for i in range(100000):
+ pass
+
+
+
+
+
+
+
+
+
+def bridge():
+ s = 0
+ for i in range(100000):
+ if i % 2:
+ s += 1
+ else:
+ s += 2
+
+
+
+
+
+
+
+def bridge_overflow():
+ s = 2
+ for i in range(100000):
+ s += i*i*i*i
+ return s
+
+
+
+
+
+
+
+
+def nested_loops():
+ s = 0
+ for i in range(10000):
+ for j in range(100000):
+ s += 1
+
+
+
+
+
+
+
+
+
+def inner1():
+ return 1
+
+def inlined_call():
+ s = 0
+ for i in range(10000):
+ s += inner1()
+
+
+
+
+
+
+
+
+
+def inner2(a):
+ for i in range(3):
+ a += 1
+ return a
+
+def inlined_call_loop():
+ s = 0
+ for i in range(100000):
+ s += inner2(i)
+
+
+
+
+
+
+class A(object):
+ def __init__(self, x):
+ if x % 2:
+ self.y = 3
+ self.x = x
+
+def object_maps():
+ l = [A(i) for i in range(100)]
+ s = 0
+ for i in range(1000000):
+ s += l[i % 100].x
+
+
+
+
+
+
+
+
+
+
+if __name__ == '__main__':
+ simple()
+ bridge()
+ bridge_overflow()
+ nested_loops()
+ inlined_call()
+ inlined_call_loop()
+ object_maps()
diff --git a/talk/ep2012/tools/talk.html b/talk/ep2012/tools/talk.html
new file mode 100644
--- /dev/null
+++ b/talk/ep2012/tools/talk.html
@@ -0,0 +1,120 @@
+<html>
+<head>
+ <meta name="viewport" content="width=1024, user-scalable=no">
+ <link rel="stylesheet" href="/home/fijal/src/deckjs/core/deck.core.css">
+ <link rel="stylesheet" href="web-2.0.css">
+ <link rel="stylesheet"
href="/home/fijal/src/deckjs/themes/transition/horizontal-slide.css">
+ <script src="/home/fijal/src/deckjs/modernizr.custom.js"></script>
+ <script src="/home/fijal/src/deckjs/jquery-1.7.min.js"></script>
+ <script src="/home/fijal/src/deckjs/core/deck.core.js"></script>
+ <script>
+ $(function() {
+ $.deck('.slide');
+ });
+ </script>
+
+</head>
+<body class="deck-container">
+ <section class="slide" id="title-slide">
+ <h1>Performance analysis tools for JITted VMs</h1>
+ </section>
+ <section class="slide">
+ <h2>Who am I?</h2>
+ <ul>
+ <li>worked on PyPy for 5+ years</li>
+ <li>often presented with a task "my program runs slow"</li>
+ <li>never completely satisfied with present solutions</li>
+ <li class="slide">I'm not antisocial, just shy</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>The talk</h2>
+ <ul>
+ <li>apologies for a lack of advanced warning - this is a rant</li>
+ <div class="slide">
+ <li>I'll talk about tools</li>
+ <li>primarily profiling tools</li>
+ </div>
+ <div class="slide">
+ <li>lots of questions</li>
+ <li>not that many answers</li>
+ </div>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>Why ranting?</h2>
+ <ul>
+ <li>the topic at hand is hard</li>
+ <li>the mindset about tools is very much rooted in the static land</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>Profiling theory</h2>
+ <ul>
+ <li>you spend 90% of your time in 10% of the functions</li>
+ <li>hence you can start profiling after you're done developing</li>
+ <li>by optimizing few functions</li>
+ <div class="slide">
+ <li>problem - 10% of 600k lines is still 60k lines</li>
+ <li>that might be even 1000s of functions</li>
+ </div>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>Let's talk about profiling</h2>
+ <ul>
+ <li>I'll try profiling!</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>JITted landscape</h2>
+ <ul>
+ <li>you have to account for warmup times</li>
+ <li>time spent in functions is very context dependent</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>Let's try!</h2>
+ </section>
+ <section class="slide">
+ <h2>High level languages</h2>
+ <ul>
+ <li>in C relation C <-> assembler is "trivial"</li>
+ <li>in PyPy, V8 (JS) or luajit (lua), the mapping is far from
trivial</li>
+ <div class="slide">
+ <li>multiple versions of the same code</li>
+ <li>bridges even if there is no branch in user code</li>
+ </div>
+ <li class="slide">sometimes I have absolutely no clue</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>The problem</h2>
+ <ul>
+ <li>what I've shown is pretty much the state of the art</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>Another problem</h2>
+ <ul>
+ <li>often when presented with profiling, it's already too late</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2>Better tools</h2>
+ <ul>
+ <li>good vm-level instrumentation</li>
+ <li>better visualizations, more code oriented</li>
+ <li>hints at the editor level about your code</li>
+ <li>hints about coverage, tests</li>
+ </ul>
+ </section>
+ <section class="slide">
+ <h2></rant></h2>
+ <ul>
+ <li>good part - there are people working on it</li>
+ <li>questions, suggestions?</li>
+ </ul>
+ </section>
+</body>
+</html>
diff --git a/talk/ep2012/tools/web-2.0.css b/talk/ep2012/tools/web-2.0.css
new file mode 100644
--- /dev/null
+++ b/talk/ep2012/tools/web-2.0.css
@@ -0,0 +1,215 @@
+@charset "UTF-8";
+.deck-container {
+ font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
+ font-size: 2.75em;
+ background: #f4fafe;
+ /* Old browsers */
+ background: -moz-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
+ /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,
#f4fafe), color-stop(100%, #ccf0f0));
+ /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
+ /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
+ /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
+ /* IE10+ */
+ background: linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
+ /* W3C */
+ background-attachment: fixed;
+}
+.deck-container > .slide {
+ text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
+}
+.deck-container > .slide .deck-before, .deck-container > .slide .deck-previous
{
+ opacity: 0.4;
+}
+.deck-container > .slide .deck-before:not(.deck-child-current) .deck-before,
.deck-container > .slide .deck-before:not(.deck-child-current) .deck-previous,
.deck-container > .slide .deck-previous:not(.deck-child-current) .deck-before,
.deck-container > .slide .deck-previous:not(.deck-child-current) .deck-previous
{
+ opacity: 1;
+}
+.deck-container > .slide .deck-child-current {
+ opacity: 1;
+}
+.deck-container .slide h1, .deck-container .slide h2, .deck-container .slide
h3, .deck-container .slide h4, .deck-container .slide h5, .deck-container
.slide h6 {
+ font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype",
"Book Antiqua", Georgia, serif;
+ font-size: 1.75em;
+}
+.deck-container .slide h1 {
+ color: #08455f;
+}
+.deck-container .slide h2 {
+ color: #0b7495;
+ border-bottom: 0;
+}
+.cssreflections .deck-container .slide h2 {
+ line-height: 1;
+ -webkit-box-reflect: below -0.556em -webkit-gradient(linear, left top, left
bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7,
rgba(255, 255, 255, 0.1)), to(transparent));
+ -moz-box-reflect: below -0.556em -moz-linear-gradient(top, transparent 0%,
transparent 30%, rgba(255, 255, 255, 0.3) 100%);
+}
+.deck-container .slide h3 {
+ color: #000;
+}
+.deck-container .slide pre {
+ border-color: #cde;
+ background: #fff;
+ position: relative;
+ z-index: auto;
+ /* http://nicolasgallagher.com/css-drop-shadows-without-images/ */
+}
+.borderradius .deck-container .slide pre {
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.csstransforms.boxshadow .deck-container .slide pre > :first-child:before {
+ content: "";
+ position: absolute;
+ z-index: -1;
+ background: #fff;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+.csstransforms.boxshadow .deck-container .slide pre:before,
.csstransforms.boxshadow .deck-container .slide pre:after {
+ content: "";
+ position: absolute;
+ z-index: -2;
+ bottom: 15px;
+ width: 50%;
+ height: 20%;
+ max-width: 300px;
+ -webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
+ -moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
+ box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
+}
+.csstransforms.boxshadow .deck-container .slide pre:before {
+ left: 10px;
+ -webkit-transform: rotate(-3deg);
+ -moz-transform: rotate(-3deg);
+ -ms-transform: rotate(-3deg);
+ -o-transform: rotate(-3deg);
+ transform: rotate(-3deg);
+}
+.csstransforms.boxshadow .deck-container .slide pre:after {
+ right: 10px;
+ -webkit-transform: rotate(3deg);
+ -moz-transform: rotate(3deg);
+ -ms-transform: rotate(3deg);
+ -o-transform: rotate(3deg);
+ transform: rotate(3deg);
+}
+.deck-container .slide code {
+ color: #789;
+}
+.deck-container .slide blockquote {
+ font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype",
"Book Antiqua", Georgia, serif;
+ font-size: 2em;
+ padding: 1em 2em .5em 2em;
+ color: #000;
+ background: #fff;
+ position: relative;
+ border: 1px solid #cde;
+ z-index: auto;
+}
+.borderradius .deck-container .slide blockquote {
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.boxshadow .deck-container .slide blockquote > :first-child:before {
+ content: "";
+ position: absolute;
+ z-index: -1;
+ background: #fff;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+.boxshadow .deck-container .slide blockquote:after {
+ content: "";
+ position: absolute;
+ z-index: -2;
+ top: 10px;
+ bottom: 10px;
+ left: 0;
+ right: 50%;
+ -moz-border-radius: 10px/100px;
+ border-radius: 10px/100px;
+ -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
+ -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
+}
+.deck-container .slide blockquote p {
+ margin: 0;
+}
+.deck-container .slide blockquote cite {
+ font-size: .5em;
+ font-style: normal;
+ font-weight: bold;
+ color: #888;
+}
+.deck-container .slide blockquote:before {
+ content: "“";
+ position: absolute;
+ top: 0;
+ left: 0;
+ font-size: 5em;
+ line-height: 1;
+ color: #ccf0f0;
+ z-index: 1;
+}
+.deck-container .slide ::-moz-selection {
+ background: #08455f;
+ color: #fff;
+}
+.deck-container .slide ::selection {
+ background: #08455f;
+ color: #fff;
+}
+.deck-container .slide a, .deck-container .slide a:hover, .deck-container
.slide a:focus, .deck-container .slide a:active, .deck-container .slide
a:visited {
+ color: #599;
+ text-decoration: none;
+}
+.deck-container .slide a:hover, .deck-container .slide a:focus {
+ text-decoration: underline;
+}
+.deck-container .deck-prev-link, .deck-container .deck-next-link {
+ background: #fff;
+ opacity: 0.5;
+}
+.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover,
.deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active,
.deck-container .deck-prev-link:visited, .deck-container .deck-next-link,
.deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus,
.deck-container .deck-next-link:active, .deck-container .deck-next-link:visited
{
+ color: #599;
+}
+.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus,
.deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus {
+ opacity: 1;
+ text-decoration: none;
+}
+.deck-container .deck-status {
+ font-size: 0.6666em;
+}
+.deck-container.deck-menu .slide {
+ background: transparent;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.rgba .deck-container.deck-menu .slide {
+ background: rgba(0, 0, 0, 0.1);
+}
+.deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu
.slide.deck-current, .no-touch .deck-container.deck-menu .slide:hover {
+ background: #fff;
+}
+.deck-container .goto-form {
+ background: #fff;
+ border: 1px solid #cde;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.boxshadow .deck-container .goto-form {
+ -webkit-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0,
0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
+ -moz-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0,
0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
+ box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0,
0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
+}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit