Skip to content

Commit 11569b4

Browse files
committed
add overview
1 parent 52411f7 commit 11569b4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

notebooks/PerformantSerialJulia.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ VERSION
4747
# ╔═╡ e1852c8d-4028-409e-8e1a-8253bbd6e6a5
4848
html"<button onclick='present()'>Toggle presentation mode</button>"
4949

50+
# ╔═╡ e611b52c-8d8c-41e8-a5d1-765c0d4306be
51+
md"""
52+
# What makes Julia code slow?
53+
54+
### Type instability
55+
##### Type instability refers to a situation where the types of variables are *not* determined by the types of inputs, but instead by *values* of inputs.
56+
57+
### Allocations
58+
##### Due to decisions in the standard libraries it is easy to accidentally allocate lots of memory, especially in hot loops. But this isn't *always* bad!
59+
"""
60+
5061
# ╔═╡ 9331fad2-f29e-11eb-0349-477bd2e7e412
5162
md"""
5263
# Analysis toolbox
@@ -251,7 +262,7 @@ function matmul1(A, B)
251262
m, p = size(A, 1), size(B, 2)
252263
C = zeros(m, p)
253264
for i = 1:m, j = 1:p
254-
@views C[i, j] = sum(A[i, :] .* B[:, j])
265+
C[i, j] = sum(A[i, :] .* B[:, j])
255266
end
256267
return C
257268
end
@@ -1013,7 +1024,8 @@ version = "17.4.0+2"
10131024
# ╠═5de2a556-f3af-4a64-a5c6-32d30f758be3
10141025
# ╠═1ac5ba38-0eef-41bb-8f9c-3bbf057cae21
10151026
# ╟─e1852c8d-4028-409e-8e1a-8253bbd6e6a5
1016-
# ╟─9331fad2-f29e-11eb-0349-477bd2e7e412
1027+
# ╟─e611b52c-8d8c-41e8-a5d1-765c0d4306be
1028+
# ╠═9331fad2-f29e-11eb-0349-477bd2e7e412
10171029
# ╟─3d98e7db-c643-4500-987d-4a225e55b2a5
10181030
# ╠═b4f2a99e-de45-49d2-be86-9f2d03357462
10191031
# ╟─068b3e45-5105-48aa-a547-536470f6abda

0 commit comments

Comments
 (0)