You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Change to use mutable datastructures within a module/function to gain performance.
436
-
437
-
----
438
-
439
-
### Other things to consider
440
-
441
-
* Hardware, L1, L2, caches
442
-
* OS pointer sizes 32/64b
443
-
* Inlining functions
444
-
445
-
F# can be very [performant](https://www.youtube.com/@FastFSharp) - used by stock companies because of this and its safety. But it requires work and knowledge about .Net Il, Hardware and F# of course.
446
-
447
-
---
448
-
449
-
### Amortized bounds
450
-
451
-
* An extension to the Big-O notation from DOA
452
-
* Used to analysis average run time
453
-
* Usually used when some operations are fast and other are slow
454
-
455
-
* C# List is an example, its worst case bounds
456
-
* insert: `$ O(n) $` -- **why?**
457
-
* lookup: `$ O(1) $`
458
-
* delete: `$ O(1) $`
459
-
460
-
----
461
-
462
-
### C# List analysis over time
463
-
464
-
*`$ \rightarrow $``n` insertions are `$ O(n^2) $` worst case
465
-
* You can make the amortized analysis that shows <!-- .element: class="fragment" data-fragment-index="1" -->
466
-
*`n` insertions are `$ O(2n) $`<!-- .element: class="fragment" data-fragment-index="1" -->
467
-
* So amortized bounds are `$ O(1) $` for all operations <!-- .element: class="fragment" data-fragment-index="1" -->
468
-
* See references for detailed analysis<!-- .element: class="fragment" data-fragment-index="1" -->
0 commit comments