From 202c1dba3fd4410d37feb659d2a80c20172e9042 Mon Sep 17 00:00:00 2001 From: Simon Parten Date: Wed, 10 Jan 2024 22:12:06 +0100 Subject: [PATCH] tweaks --- site/docs/_docs/bounds.check.md | 12 ++++++++++-- site/docs/_docs/motivation.mdoc.md | 8 +++++--- site/docs/_docs/performance.md | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/site/docs/_docs/bounds.check.md b/site/docs/_docs/bounds.check.md index ec6e5fe..7963468 100644 --- a/site/docs/_docs/bounds.check.md +++ b/site/docs/_docs/bounds.check.md @@ -1,9 +1,17 @@ --- title: Bounds Checks --- +# Rationale + In performance sensitive vector applications, bounds checking may be an unwelcome overhead. -It is left to the developer, to decide whether, or where this is wanted or not. A boolean is required as a context (given) parameter to some operations. +# Mechanism + +This bounds checking mechansim is an inline given `Boolean`, which reduces to an inline `if` _at compile time_. So if you turn bounds checking off, the compiler doesn't generate the code. No code => zero runtime overhead. + +# Implications and use + +It is left to the developer, to decide whether, or where BoundsChecks are wanted or not. A boolean is required as a context (given) parameter. In this case, we disable bounds checks, maximising performance. @@ -18,7 +26,7 @@ println(v1 + v2) ``` -In this case, we disable bounds checks, maximising performance, and generate undefined runtime behaviour. It may fail, it may not, but the results will be unpredictable, wrong and potentially hard to track - it is your responsibility. +In this case, we disable bounds checks, maximising performance, and generate undefined runtime behaviour. It may fail, it may not, but the results will be unpredictable, wrong and potentially hard to track - it is _your_ responsibility. ```scala import vecxt._ diff --git a/site/docs/_docs/motivation.mdoc.md b/site/docs/_docs/motivation.mdoc.md index 34aa0f4..df4251f 100644 --- a/site/docs/_docs/motivation.mdoc.md +++ b/site/docs/_docs/motivation.mdoc.md @@ -2,9 +2,11 @@ title: Motivation --- -It is often prefereable to be able to perform sub-parts of a numeric algorithm to be executed as close to the user as possible. +# why vecxt -For example, data acquisition serverside, but parts of a calculation in browser or in response to user input, saving the cost of network traffc. +It is often prefereable to be able to perform sub-parts of a numeric algorithm to be executed as close to the user as possible. Everyone loves performance, no one wants to think about it :-). + +For example, your data acquisition is serverside, but do parts of a calculation in browser or in response to user input, saving the latency of network traffc and improving user experience in scalaJS. [[vecxt]] provides easy access to platform native common vector operations via intuitive and common syntax. Guaranteeing platform native performance - wherever you want to do your numerics. @@ -27,4 +29,4 @@ val c = 2.0 println(algo(a, b, c).mkString(", ")) ``` -Here I'm code coping (!)... but you can place the `algo` method in the shared part of your project, and use it on all platforms. \ No newline at end of file +You can place the `algo` method in the shared part of your project, and use it on all platforms. \ No newline at end of file diff --git a/site/docs/_docs/performance.md b/site/docs/_docs/performance.md index 0fdd826..5ec071e 100644 --- a/site/docs/_docs/performance.md +++ b/site/docs/_docs/performance.md @@ -14,5 +14,6 @@ Consider browsing the [[vecxt]] api, and particulaly the extensions object. You' ### JS -On Node, this stand ships with C BLAS. +On Node, this shim ships with it's own C BLAS implementation. + In browser / elsewhere, it's done in loop-unrolled native arrays.