Added a remark about data type efficiency
This commit is contained in:
parent
96315451dd
commit
4f126cbba6
1 changed files with 3 additions and 1 deletions
|
@ -18,7 +18,9 @@ And the second part more focused on OpenGL and content.
|
||||||
> import Graphics.UI.GLUT
|
> import Graphics.UI.GLUT
|
||||||
> import Data.IORef
|
> import Data.IORef
|
||||||
|
|
||||||
For efficiency reason, I will not use the default Haskell `Complex` data type.
|
For efficiency reason[^010001], I will not use the default Haskell `Complex` data type.
|
||||||
|
|
||||||
|
[^010001]: I tried `Complex Double`, `Complex Float`, this current data type with `Double` and the actual version `Float`. For rendering a 1024x1024 Mandelbrot set it takes `Complex Double` about 6.8s, for `Complex Float` about 5.1s, for the actual version with `Double` and `Float` it takes about `1.6` sec. See these sources for testing yourself: [https://gist.github.com/2945043](https://gist.github.com/2945043). I haven't tried to use unpacked data type because it looks weird in a tutorial. But I might try it in a sequel.
|
||||||
|
|
||||||
> data Complex = C (Float,Float) deriving (Show,Eq)
|
> data Complex = C (Float,Float) deriving (Show,Eq)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue