Lists, nested vectors, and unpacked vectors for heavy scientific computing

I was told that I should use unboxed vectors for heavy scientific computing (simulations that work for hours or even days) instead of lists or even nested vectors.

  • It's true?
  • Are there other data structures than lists, nested vectors, or unrecognized vectors that are shared?
  • Can you explain the difference between the boxed and unpacked vectors?
+4
source share
1 answer

A few things to understand. Firstly, in a box against unboxed:

  • " ", . (, , , , - .)

  • "unboxed" number, .

, 64- Char - 64- - Haskell-, 32- Unicode, , . , Char# - 32- . - , CPU - .

Char# - , C , Char - , C ... , , , , . .

, ; . unboxed . , 32- ; . , unboxed .

, . ( ..). , .

vs :

  • Haskell [Double] ( - ) float . , . , !

  • - . ; . , , . , . , !

- . . , ? , unboxed vector , — — .

, , , .

, GHC , , "". GHC , "list fusion", , , . , , ... , .

+10

Source: https://habr.com/ru/post/1623533/


All Articles