Skip to content

Commit

Permalink
Merge pull request #443 from pythonspeed/420-sciagraph
Browse files Browse the repository at this point in the history
Advertise sciagraph a bit more, and nicer report layout
  • Loading branch information
itamarst authored Oct 25, 2022
2 parents 342fe78 + baa34f1 commit 137591d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 31 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions docs/theme/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ tt {
font-weight: 400;
font-display: swap;
src: url('https://pythonspeed.com/public/fonts/rosario-v13-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Rosario'), local('Rosario-Regular'),
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
src: url('https://pythonspeed.com/public/fonts/rosario-v13-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-regular.woff') format('woff'), /* Modern Browsers */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
Expand All @@ -36,8 +35,7 @@ tt {
font-weight: 400;
font-display: swap;
src: url('https://pythonspeed.com/public/fonts/rosario-v13-latin-italic.eot'); /* IE9 Compat Modes */
src: local('Rosario Italic'), local('Rosario-Italic'),
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
src: url('https://pythonspeed.com/public/fonts/rosario-v13-latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-italic.woff2') format('woff2'), /* Super Modern Browsers */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-italic.woff') format('woff'), /* Modern Browsers */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */
Expand All @@ -60,8 +58,7 @@ tt {
font-weight: 700;
font-display: swap;
src: url('https://pythonspeed.com/public/fonts/rosario-v13-latin-700.eot'); /* IE9 Compat Modes */
src: local('Rosario Bold'), local('Rosario-Bold'),
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
src: url('https://pythonspeed.com/public/fonts/rosario-v13-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-700.woff') format('woff'), /* Modern Browsers */
url('https://pythonspeed.com/public/fonts/rosario-v13-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
Expand All @@ -74,8 +71,7 @@ tt {
font-style: normal;
font-display: swap;
font-weight: 400;
src: local('Ubuntu Mono'), local('UbuntuMono-Regular'),
url('https://pythonspeed.com/public/fonts/ubuntu-mono-v8-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
src: url('https://pythonspeed.com/public/fonts/ubuntu-mono-v8-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('https://pythonspeed.com/public/fonts/ubuntu-mono-v8-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

Expand All @@ -85,7 +81,6 @@ tt {
font-style: normal;
font-display: swap;
font-weight: 700;
src: local('Ubuntu Mono Bold'), local('UbuntuMono-Bold'),
url('https://pythonspeed.com/public/fonts/ubuntu-mono-v8-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
src: url('https://pythonspeed.com/public/fonts/ubuntu-mono-v8-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('https://pythonspeed.com/public/fonts/ubuntu-mono-v8-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
37 changes: 20 additions & 17 deletions filprofiler/_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ def render_report(output_path: str, now: datetime) -> str:
body {{
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
line-height: 1.2;
max-width: 40rem;
max-width: 90%;
margin: 4rem auto;
font-size: 18px;
}}
blockquote {{ border-width: 1px; border-color: black; border-style: solid; padding: 1em; }}
div {{
text-align: center;
.center {{
max-width: 40rem;
margin: 0 auto;
}}
blockquote {{ border-width: 1px; border-color: black; border-style: solid; padding: 1em; }}
</style>
<script>
function compatRequestFullscreen(elem) {{
Expand Down Expand Up @@ -74,29 +75,31 @@ def render_report(output_path: str, now: datetime) -> str:
<p><code>{argv}</code><p>
<h2>Profiling result</h2>
<div><p><input type="button" onclick="fullScreen('#peak');" value="Full screen"> · <a href="peak-memory.svg" target="_blank"><button>Open in new window</button></a></p>
<div style="text-align: center;"><p><input type="button" onclick="fullScreen('#peak');" value="Full screen"> · <a href="peak-memory.svg" target="_blank"><button>Open in new window</button></a></p>
<iframe id="peak" src="peak-memory.svg" width="100%" height="400" scrolling="auto" frameborder="0"></iframe><br>
</div>
<blockquote class="center">
<p style="text-align: center;"><em>Check out my other project:</em></p>
<h3>Find memory and performance bottlenecks in production!</h3>
<p>When your data pipeline is too slow in production, reproducing the problem
on your laptop is hard or impossible—which means identifying and fixing the problem can be tricky.</p>
<p>What if you knew the cause of the problem as soon as you realized it was happening?</p>
<p>That's why you need
<strong><a href="https://sciagraph.com/">the Sciagraph profiler</a></strong>, designed to <strong>find performance
and memory bottlenecks by continuously profiling in production.</strong></p></blockquote>
<br>
<br>
<hr>
<br>
<div><p><input type="button" onclick="fullScreen('#peak-reversed');" value="Full screen"> · <a href="peak-memory-reversed.svg" target="_blank"><button>Open in new window</button></a></p>
<br>
<div style="text-align: center;"><p><input type="button" onclick="fullScreen('#peak-reversed');" value="Full screen"> ·
<a href="peak-memory-reversed.svg" target="_blank"><button>Open in new window</button></a></p>
<iframe id="peak-reversed" src="peak-memory-reversed.svg" width="100%" height="400" scrolling="auto" frameborder="0"></iframe><br>
</div>
<br>
<div class="center">
<blockquote><strong>Need help, or does something look wrong?</strong>
<a href="https://pythonspeed.com/fil/docs/">Read the documentation</a>,
and if that doesn't help please
<a href="https://github.com/pythonspeed/filprofiler/issues/new?body={bugreport}">file an issue</a>
and I'll try to help.</blockquote>
<br>
<blockquote><strong>Want memory and performance profiling for your production batch jobs?</strong>
I've also created an
<a href="https://pythonspeed.com/sciagraph/"
>always-on profiler called Sciagraph</a> that is fast and robust enough to run in production.</blockquote>
<br>
<h2>Learn how to reduce memory usage</h2>
<p>Need help reducing your data processing application's memory use? Check out tips and tricks <a href="https://pythonspeed.com/memory/">here</a>.</p>
Expand Down Expand Up @@ -133,7 +136,7 @@ def render_report(output_path: str, now: datetime) -> str:
</ul>
<p>See <a href="https://pythonspeed.com/articles/measuring-memory-python/">this article</a> for more details.</p>
</div>
</body>
</html>
""".format(
Expand Down
4 changes: 1 addition & 3 deletions memapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ libloading = "0.7"
libc = "0.2"

[dependencies.inferno]
# Temporary fork until https://github.com/jonhoo/inferno/pull/262 is merged.
git = "https://github.com/itamarst/inferno.git"
branch = "monospace-fonts"
version = "0.11"
default-features = false

[dependencies.psutil]
Expand Down

0 comments on commit 137591d

Please sign in to comment.