@@ -0,0 +1,74 @@
1++++
2+title = "Vere Profiling"
3+date = "2022-08-26"
4+
5+[taxonomies]
6+grant_type = [ "Apprenticeship" ]
7+grant_category = [ "Core Dev", "Runtime" ]
8+
9+[extra]
10+image = ""
11+description = "Uncover and visualize performance bottlenecks in the runtime"
12+reward = "1 star"
13+mentor = ["~fanfun-mocbud"]
14+assignee = ["~pontus-fadpun"]
15+grant_id = "A0180"
16+completed = false
17+work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=A0180&prefill_Grant+Name=Vere%20Profiling"
18++++
19+
20+# Vere Profiling Apprenticeship
21+
22+Urbit currently has two profilers: a tracing profiler and a sampling profiler.
23+The tracing profiler writes a stack trace to `<pier>/.urb/put/trace`. To enable:
24+```console
25+$ urbit -j <pier>
26+```
27+
28+The sampling profiler uses `SIGPROF` to build up a set of data points detailing
29+the code paths that the runtime spends the most time executing. To enable:
30+```console
31+$ cd <urbit_repo>/pkg/urbit
32+$ CPU_DEBUG=1 ./configure
33+$ make
34+$ build/urbit -P <pier>
35+```
36+
37+This project will add additional profiling capabilites to Vere by using
38+well-known profiling tools like `dtrace`, `bpftrace`, and similar to develop
39+more nuanced insights into the performance bottlenecks in Vere. Upon
40+identification, the bottlenecks will be addressed where possible, leading to a
41+more performant runtime. Exploration of alternative profiling techniques like
42+causal profiling is encouraged.
43+
44+## Deliverables
45+
46+- Integration of additional profiling tooling into Vere;
47+- list of performance bottlenecks;
48+- and patches addressing as many of the performance bottlenecks as possible.
49+
50+## Prerequisites
51+
52+- Proficiency in C
53+- Experience with profiling tools like `dtrace` (macOS, FreeBSD), `bpftrace`
54+ (Linux)
55+
56+## Educational Outcomes for the Apprentice
57+
58+The apprentice will:
59+
60+- learn about the current state of profiling in Vere;
61+- integrate new tooling into Vere;
62+- and address any performance bottlenecks discovered.
63+
64+## Responsibilities of the Mentor
65+
66+The mentor will:
67+
68+- provide technical direction via recurring meetings and DM;
69+- review code;
70+- and help the apprentice prepare the changes for release.
71+
72+## Duration and Compensation
73+
74+The expected duration is two months. Compensation is 1 star upon sucessful completion of the apprenticeship.