Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Jan 10, 2024
1 parent c324124 commit 202c1db
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
12 changes: 10 additions & 2 deletions site/docs/_docs/bounds.check.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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._
Expand Down
8 changes: 5 additions & 3 deletions site/docs/_docs/motivation.mdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
You can place the `algo` method in the shared part of your project, and use it on all platforms.
3 changes: 2 additions & 1 deletion site/docs/_docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 202c1db

Please sign in to comment.