From 8396fbed1ac2c0358bb0c0d77d6ebffc8ee4d269 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 19 Jan 2023 20:58:55 -0500 Subject: Mention )profile on performance page --- docs/implementation/perf.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/implementation') diff --git a/docs/implementation/perf.html b/docs/implementation/perf.html index 76241e34..7e9dc1ff 100644 --- a/docs/implementation/perf.html +++ b/docs/implementation/perf.html @@ -15,10 +15,11 @@

Currently we aim for high performance on a single CPU core, and are focusing on 64-bit x86 and ARM. CBQN doesn't use additional cores or a GPU for acceleration. The Singeli build does use x86 vector instructions up to AVX2 (2013) if present, and has preliminary support for ARM NEON. Singeli is assumed for the discussion here, and without it there are a few more slow cases, particularly comparisons.

Performance resources

The spotty optimization coverage means that it's more accurate to say CBQN can be fast, not that it will be fast. Have to learn how to use it. Definitely ask on the forum if you're having performance troubles so you can find some tricks to use or request improvements.

-

There are two measurement tools in the time system values. •MonoTime is a high-precision timer for performance measurements; you can take a time before and after some operation or section of a program and subtract them to get a time in seconds (a profiling tool to do this automatically would be nice, but we don't have one). More convenient for small snippets, •_timed returns the time to evaluate 𝔽𝕩, averaging over 𝕨 runs if given. For two-argument functions you can write wF•_timed x or F´•_timed wx. CBQN also has a )time command that prints the time taken by an entire expression, not counting compilation time.

+

There are two measurement tools in the time system values. •MonoTime is a high-precision timer for performance measurements; you can take a time before and after some operation or section of a program and subtract them to get a time in seconds (a profiling tool to do this automatically would be nice, but we don't have one). More convenient for small snippets, •_timed returns the time to evaluate 𝔽𝕩, averaging over 𝕨 runs if given. For two-argument functions you can write wF•_timed x or F´•_timed wx.

100 +´•_timed 1e6  # Time +´ only
 )time:100 +´1e6    # Time entire expression
 
+

CBQN also has a )time command that prints the time taken by an entire expression, not counting compilation time. And a )profile command that samples where time was spent by the line—execution naturally has to be spread over several lines for this to be useful, and should take at least a few milliseconds too.

The bencharray tool has a page showing primitive benchmarks with some explanations.

Versus other array languages

Things get hard when you try to put array languages up next to each other. You can get completely different results depending on what sort of problems you want to solve and how you write code, and all those different results are valid. Because people ask for it, I'll try to give some description for the implementations I'm familiar with. I'm of course biased towards the languages I've worked on, Dyalog and BQN; if nothing else, these tend to prioritize just the features I find important! Note also that the situation can change over time; these comments are from 2023.

-- cgit v1.2.3