Skip to content

Commit

Permalink
Add Strict pragma to all modules
Browse files Browse the repository at this point in the history
In some not-terribly-scientific benchmarks it seems that there are
some leaking thunks in the library.  Adding this pragma and re-running
the benchmarks showed a drastic improvement in heap allocations.
  • Loading branch information
agentultra committed Sep 28, 2021
1 parent 1cf56df commit aa31b5a
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-|
Module : Database.PostgreSQL.Replicant
Description : A PostgreSQL streaming replication library
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Connection.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-
Module : Database.PostgreSQL.Replicant.Connection
Description : Create replication handling connections to PostgreSQL
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Exception.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

module Database.PostgreSQL.Replicant.Exception where

import Control.Exception
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Message.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-|
Module : Database.PostgreSQL.Replicant.Message
Description : Streaming replication message types
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/PostgresUtils.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

module Database.PostgreSQL.Replicant.PostgresUtils where

import Data.Fixed
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Protocol.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-|
Module : Database.PostgreSQL.Replicant.Protocol
Description : Streaming replication protocol
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/ReplicationSlot.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-|
Module : Database.PostgreSQL.Replicant.ReplicationSlot
Description : Replication slot query commands
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Serialize.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

module Database.PostgreSQL.Replicant.Serialize where

import Data.ByteString (ByteString)
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Settings.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

module Database.PostgreSQL.Replicant.Settings where

import Data.ByteString (ByteString)
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/State.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-|
Module : Database.PostgreSQL.Replicant.State
Description : Internal replication stream state
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Replicant/Types/Lsn.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE Strict #-}

{-|
Module : Database.PostgreSQL.Replicant.Types.Lsn
Description : Types and parsers for LSNs
Expand Down

0 comments on commit aa31b5a

Please sign in to comment.