All Projects → DevJac → OwnTime.jl

DevJac / OwnTime.jl

Licence: MIT license
A Julia profiling package that provides an "own time" and "total time" view of profiling data

Programming Languages

julia
2034 projects

Labels

Projects that are alternatives of or similar to OwnTime.jl

flamescope
Export flame data to speedscope's format
Stars: ✭ 26 (-18.75%)
Mutual labels:  profiling
PHPench
Realtime benchmarks for PHP code
Stars: ✭ 53 (+65.63%)
Mutual labels:  profiling
nodejs
Node.js in-process collectors for Instana
Stars: ✭ 66 (+106.25%)
Mutual labels:  profiling
profiler
Continuous profiling based on pprof
Stars: ✭ 221 (+590.63%)
Mutual labels:  profiling
ghc-stack
Hacking GHC's Stack for Fun and Profit (featuring The Glorious Haskell Debugger v0.0.1 Pre-alpha)
Stars: ✭ 69 (+115.63%)
Mutual labels:  profiling
defpro
Defold Profiler interaction using Lua
Stars: ✭ 19 (-40.62%)
Mutual labels:  profiling
memcheck-cover
An HTML generator for Valgrind's Memcheck tool
Stars: ✭ 30 (-6.25%)
Mutual labels:  profiling
benchkit
A developer-centric toolkit module for Android to facilitate in-depth profiling and benchmarking.
Stars: ✭ 48 (+50%)
Mutual labels:  profiling
observable-profiler
Tracks new & disposed Observable subscriptions
Stars: ✭ 41 (+28.13%)
Mutual labels:  profiling
parca
Continuous profiling for analysis of CPU and memory usage, down to the line number and throughout time. Saving infrastructure cost, improving performance, and increasing reliability.
Stars: ✭ 2,834 (+8756.25%)
Mutual labels:  profiling
iopipe-js
Build and run serverless apps with confidence on AWS Lambda with Tracing, Profiling, Metrics, Monitoring, and more.
Stars: ✭ 33 (+3.13%)
Mutual labels:  profiling
jstackSeries.sh
Script for capturing a series of thread dumps from a Java process using jstack (on Linux and Windows)
Stars: ✭ 28 (-12.5%)
Mutual labels:  profiling
cov
An emacs extension for displaying coverage data on your code
Stars: ✭ 65 (+103.13%)
Mutual labels:  profiling
nodeprof.js
Instrumentation framework for Node.js compliant to ECMAScript 2020 based on GraalVM.
Stars: ✭ 44 (+37.5%)
Mutual labels:  profiling
VisualProfiler-Unity
The Visual Profiler provides a drop in solution for viewing your mixed reality Unity application's frame rate, scene complexity, and memory usage.
Stars: ✭ 120 (+275%)
Mutual labels:  profiling
go-recipes
🦩 Tools for Go projects
Stars: ✭ 2,490 (+7681.25%)
Mutual labels:  profiling
aws-codeguru-profiler-demo-application
Example application demonstrating the features of Amazon CodeGuru Profiler
Stars: ✭ 21 (-34.37%)
Mutual labels:  profiling
pylaprof
A Python sampling profiler for AWS Lambda functions (and not only).
Stars: ✭ 12 (-62.5%)
Mutual labels:  profiling
parca-agent
eBPF based always-on profiler auto-discovering targets in Kubernetes and systemd, zero code changes or restarts needed!
Stars: ✭ 250 (+681.25%)
Mutual labels:  profiling
ocaml-tracy
Bindings to the Tracy profiler
Stars: ✭ 21 (-34.37%)
Mutual labels:  profiling

OwnTime.jl

OwnTime provides two additional ways to view Julia's Profile data.

State of OwnTime

I consider OwnTime to be feature complete. If there have not been any recent commits, it's not because OwnTime is abandoned, it's because OwnTime is complete.

Furthermore, OwnTime consists of less than 200 lines of code in a single file, and the code is documented. If worse comes to worse, you could maintain it yourself without much effort.

Installation

Use Julia's package manager to install.

In the Julia REPL do:

using Pkg
Pkg.add("OwnTime")

Basic Usage

Let's say we have the following code in mycode.jl:

function myfunc()
    A = rand(200, 200, 400)
    maximum(A)
end

We profile our code in the usual way:

julia> include("mycode.jl")
myfunc (generic function with 1 method)

julia> myfunc()  # run once to force JIT compilation
0.9999999760080607

julia> using Profile

julia> @profile myfunc()
0.9999999988120492

We can now view our profiling data using owntime or totaltime:

julia> owntime()
 [1]  63% => dsfmt_fill_array_close_open!(::Random.DSFMT.DSFMT_state, ::Ptr{Float64}, ...) at DSFMT.jl:95
 [2]  13% => _fast at reduce.jl:454 [inlined]
 [3]  11% => eval(::Module, ::Any) at boot.jl:330
 [4]   8% => Array at boot.jl:408 [inlined]
 [5]   1% => != at float.jl:456 [inlined]


julia> totaltime()
 [1]  96% => eval(::Module, ::Any) at boot.jl:330
 [2]  96% => (::REPL.var"#26#27"{REPL.REPLBackend})() at task.jl:333
 [3]  96% => macro expansion at REPL.jl:118 [inlined]
 [4]  96% => eval_user_input(::Any, ::REPL.REPLBackend) at REPL.jl:86
 [5]  72% => myfunc() at mycode.jl:2
 [6]  72% => rand at Random.jl:277 [inlined]
 [7]  63% => rand(::Type{Float64}, ::Tuple{Int64,Int64,Int64}) at gcutils.jl:91
    ...
[11]  14% => myfunc() at mycode.jl:3
    ...

owntime vs totaltime

totaltime show the amount of time spent on a StackFrame including its sub-calls. owntime shows the amount of time spent on a StackFrame excluding its sub-calls.

Filtering StackFrames

We can filter StackFrames to shorten the output:

julia> owntime(stackframe_filter=filecontains("mycode.jl"))
 [1]  72% => myfunc() at mycode.jl:2
 [2]  14% => myfunc() at mycode.jl:3


julia> totaltime(stackframe_filter=filecontains("mycode.jl"))
 [1]  72% => myfunc() at mycode.jl:2
 [2]  14% => myfunc() at mycode.jl:3

julia> owntime(stackframe_filter=stackframe -> stackframe.func == :myfunc)
 [1]  72% => myfunc() at mycode.jl:2
 [2]  14% => myfunc() at mycode.jl:3

It's now clear that 72% of the time was spent on line 2 of our code, and 14% on line 3. The rest of the time was spent on overhead related to Julia and profiling; for such a small example a relatively large amount of time is spent on that overhead.

stackframe_filter should be passed a function that accepts a single StackFrame and returns true if that StackFrame should be included.

How does this relate to Profile in Julia's standard library?

OwnTime merely provides an alternate view into the profiling data collected by Julia. It is complimentary to the Profile package in the standard library.

totaltime provides a view of the profiling data similar to the flat format of Profile.print(format=:flat).

owntime is a view unique to OwnTime*, hence the name.

The ability to filter StackFrames is unique to OwnTime*.

(* At this time, and as far as I'm aware.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].