@@ -384,16 +384,54 @@ pretty_table(tabledata; header, backend = Val(:html))
384384```
385385
386386```julia
387- f = Figure(size = (800, 1200));
388- labels = ["Symbolic jacobian time", "Symbolic jacobian\nGC time", "Symbolic jacobian\nallocated memory (B)", "`build_function` time", "First call time", "Second call time"]
389- times = [jacobian_times, jacobian_gctimes, jacobian_allocs, build_times, first_call_times, second_call_times]
390- for (i, (label, data)) in enumerate(zip(labels, times))
391- ax = Axis(f[i, 1], xscale = log10, yscale = log10, ylabel = label, xticks = N)
392- l1 = lines!(ax, N, data[1])
393- l2 = lines!(ax, N, data[2])
394- legend_entries = startswith(label, "Symbolic") ? ["without hashconsing", "with hashconsing"] : ["without CSE", "with CSE"]
395- Legend(f[i, 2], [l1, l2], legend_entries)
387+ f = Figure(size = (750, 400))
388+ titles = [
389+ "Jacobian symbolic computation", "Jacobian symbolic computation", "Code generation",
390+ "Numerical function compilation", "Numerical function evaluation"]
391+ labels = ["Time (seconds)", "Allocated memory (bytes)",
392+ "Time (seconds)", "Time (seconds)", "Time (seconds)"]
393+ times = [jacobian_times, jacobian_allocs, build_times, first_call_times, second_call_times]
394+ axes = Axis[]
395+ for i in 1:2
396+ label = labels[i]
397+ data = times[i]
398+ ax = Axis(f[1, i], xscale = log10, yscale = log10, xlabel = "model size",
399+ xlabelsize = 10, ylabel = label, ylabelsize = 10, xticks = N,
400+ title = titles[i], titlesize = 12, xticklabelsize = 10, yticklabelsize = 10)
401+ push!(axes, ax)
402+ l1 = scatterlines!(ax, N, data[1], label = "without hashconsing")
403+ l2 = scatterlines!(ax, N, data[2], label = "with hashconsing")
396404end
405+ Legend(f[1, 3], axes[1], "Methods", tellwidth = false, labelsize = 12, titlesize = 15)
406+ axes2 = Axis[]
407+ # make equal y-axis unit length
408+ mn3, mx3 = extrema(reduce(vcat, times[3]))
409+ xn3 = log10(mx3 / mn3)
410+ mn4, mx4 = extrema(reduce(vcat, times[4]))
411+ xn4 = log10(mx4 / mn4)
412+ mn5, mx5 = extrema(reduce(vcat, times[5]))
413+ xn5 = log10(mx5 / mn5)
414+ xn = max(xn3, xn4, xn5)
415+ xn += 0.2
416+ hxn = xn / 2
417+ hxn3 = (log10(mx3) + log10(mn3)) / 2
418+ hxn4 = (log10(mx4) + log10(mn4)) / 2
419+ hxn5 = (log10(mx5) + log10(mn5)) / 2
420+ ylims = [(exp10(hxn3 - hxn), exp10(hxn3 + hxn)), (exp10(hxn4 - hxn), exp10(hxn4 + hxn)),
421+ (exp10(hxn5 - hxn), exp10(hxn5 + hxn))]
422+ for i in 1:3
423+ ir = i + 2
424+ label = labels[ir]
425+ data = times[ir]
426+ ax = Axis(f[2, i], xscale = log10, yscale = log10, xlabel = "model size",
427+ xlabelsize = 10, ylabel = label, ylabelsize = 10, xticks = N,
428+ title = titles[ir], titlesize = 12, xticklabelsize = 10, yticklabelsize = 10)
429+ ylims!(ax, ylims[i]...)
430+ push!(axes2, ax)
431+ l1 = scatterlines!(ax, N, data[1], label = "without hashconsing")
432+ l2 = scatterlines!(ax, N, data[2], label = "with hashconsing")
433+ end
434+ save("thermal_fluid.pdf", f)
397435f
398436```
399437
0 commit comments