Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
snawaz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
snawaz
6y ago
>I don't know how to avoid heap memory allocations in haskell or make sure memory is on the stack, but both are very easy to do in C++. Yup. I know it's easy and the default behavior in C++. This Haskell page says, it is pretty
2.
▲
by
snawaz
6y ago
> In the case of an image of this size you could probably just put everything on the stack. That sounds interesting and will probably make it more efficient. But how do I put things on the stack? As per this answer on Stackoverflow, the
3.
▲
by
snawaz
6y ago
> The runtime allocates and frees heap memory while performing local calculations. 1) If it allocates, why does `top` not show it? 2) Why does it allocate SO MUCH when it uses only a fraction? Looks like a very bad strategy to allocate 2
4.
▲
by
snawaz
6y ago
That is puzzling to me as well, particularly because `top` and `htop` on my machine don't even touch `50 MB`. That means, the first figure must be something else and I don't find a good explanation for that. I came across people w
5.
▲
by
snawaz
6y ago
To be fair, the Rust program isn't yet optimized fully. We tweaked few things here and there, and the speed improved from 26s to 19s. I believe it can still be improved further. I'm sure it can get better (especially if the issues
6.
▲
by
snawaz
6y ago
I didn't know that. I'll try that. Thanks for mentioning it.
7.
▲
by
snawaz
6y ago
It was indeed my first Haskell program. So I'd take your comment as compliment. I have been a long time C++ programmer ( https://stackoverflow.com/users/415784/nawaz ), so I know what kind of tools one should l