Repository navigation
Change pure calls to use the faster unsafeDupablePerformIO - #117
Conversation
This may allow the ioCall to be executed twice. This is safe as long as the documentation is followed, since the called function is not allowed to have side effects.
|
@Ofenhed thanks a lot for the investigation and fix. Could you amend the "BEWARE" comment for
|
|
Actually, re-reading the comment for
|
|
Oh and last request -- please link the issue above the code usage of |
|
I mostly used your text. What do you think about it now? |
Changing from unsafePerformIO to unsafeDupablePerformIO removes the thread safety of pure functions calls, which means that expensive CPU core memory synchronization is not performed. This means that pure functions may be called more than once if called at the same time from multiple threads. This change is safe as long as the documentation is followed, since the documentation asserts that called functions are not allowed to have side effects.
This fixes overhead reported in #115.