[Haskell-cafe] Is it safe to create global variables using unsafePerformIO?

Johan Holmquist holmisen at gmail.com
Thu Jan 30 12:24:24 UTC 2014


You might be interested in
http://hackage.haskell.org/package/global-variables for this.

Cheers
Johan
On Jan 29, 2014 7:17 PM, "Brandon Allbery" <allbery.b at gmail.com> wrote:

> On Wed, Jan 29, 2014 at 1:09 PM, Ömer Sinan Ağacan <omeragacan at gmail.com>wrote:
>
>>
>> > It isn't clear that
>> > this will give an improvement in performance
>>
>> Why is that? I think it's clear since I'm eliminating malloc calls.
>> (though one may claim that malloc calls are so cheap it's not even
>> measurable)
>>
>
> (1) it's not really malloc since it's being garbage collected when out of
> scope
>
> (2) given that there is a lot of allocation anyway and anything allocated
> as ephemerally as this use case is very common and very highly optimized,
> it's not really worth it
>
> --
> brandon s allbery kf8nh                               sine nomine
> associates
> allbery.b at gmail.com
> ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140130/198aa668/attachment.html>


More information about the Haskell-Cafe mailing list