Skip to content

Commit 77ffedf

Browse files
committed
.
1 parent fd6ad38 commit 77ffedf

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

site/docs/_docs/gotcha.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
Despite my best efforts, there are frictions associated with cross platform initiatives.
1+
## On JVM
2+
3+
```
4+
val v : Array[Double] = ???
5+
6+
v.sum
7+
8+
```
9+
You will possibly bleed 8x performance. [Performance Perils of JVM Array Operations](https://blog.simon.codes/posts/jvm-array-performance-perils/)
10+
11+
12+
## On JS
13+
14+
Despite my best efforts, there are frictions associated with cross platform initiatives.
215

316
In javascript
417

@@ -9,6 +22,7 @@ arr[10]
922

1023
will result in `undefined`, and your program will continue onwards with essentially undefined future behaviuor.
1124

12-
This is materially different to the behaviour on the JVM and native arrays, which are going to throw `ArrayOutOfBounds` or some similar exception letting you know things have gone wrong. Whilst enabling this exception throwiung behaviour is _possible_ in scalaJS (use `Array[Double]`) , it comes with a performance impact.
25+
This is materially different to the behaviour on the JVM and native arrays, which are going to throw `ArrayOutOfBounds` or some similar exception letting you know things have gone wrong. Whilst enabling this exception throwiung behaviour is _possible_ in scalaJS (use `Array[Double]`) , it comes with a performance impact.
26+
27+
It is an explicit goal of `vecxt` to be performant, and to introduce as few abstractions as possible. We make no effort to solve this problem in JS land.
1328

14-
It is an explicit goal of `vecxt` to be performant, and to introduce as few abstractions as possible. We make no effort to solve this problem in JS land.

0 commit comments

Comments
 (0)