purebred-mua / hs-notmuch

Modern Haskell binding to the Notmuch mail indexer
11 stars 2 forks source link

use 'unsafe' for all c calls #28

Closed frasertweedale closed 6 years ago

frasertweedale commented 6 years ago

None of the routines we invoke can call back into the Haskell runtime, so it is safe to use 'unsafe'. This avoids some book keeping, giving a big performance increase:

  total time  =        3.73 secs   (3728 ticks @ 1000 us, 1 processor)
  total alloc = 260,249,536 bytes  (excludes profiling overheads)

compared to previously:

  total time  =        6.53 secs   (6530 ticks @ 1000 us, 1 processor)
  total alloc = 260,249,536 bytes  (excludes profiling overheads)