We compare the performance of the http-streams and the http-client libraries. The focus is on making a large number of small concurrent requests. This typically occurs in services that use HTTP to connect to backend services, such as a database, message queue, or log-message sink. Often those backend services use relatively small JSON encoded messages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedLists #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE UnicodeSyntax #-} | |
-- | The tools for forking and managing threads from 'Control.Concurrent' and | |
-- 'Control.Concurrent.Async' don't guarantee that finalizers or exception | |
-- handlers on the thread are executed when an exception is raised on the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module GadtClosedFamilyTest where | |
-- -------------------------------------------------------------------------- -- | |
-- type level peano numbers | |
data Nat = Z | S Nat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE UnicodeSyntax #-} | |
{-# LANGUAGE BangPatterns #-} | |
module RandomByteString | |
( random | |
, randomGen | |
) where | |
import Control.Exception (bracketOnError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DerivingStrategies #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE UnicodeSyntax #-} | |
-- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE UnicodeSyntax #-} | |
-- | | |
-- Module: Main | |
-- Copyright: Copyright © 2018 Kadena LLC. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The Haskell packages cryptonite and blake2 both include a version | |
# of the C sources of the blake2 reference implementation. Linking | |
# both packages into the same Haskell binary can result in a broken | |
# binary that produces unsound results. | |
TDIR=$(mktemp -d "${TMPDIR:-/tmp/}$(basename $0).XXXXXXXXXXXX") | |
trap "{ rm -rf "$TDIR"; }" EXIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
module WrappedException | |
( main | |
) where | |
import Control.Concurrent | |
import Control.Exception (SomeAsyncException(..)) | |
import Control.Monad.Catch |
This gist contains benchmarks for read-only concurrent transaction that involve many shared variables. The test data is a mutable single-linked list where individual list "cells" are linked via mutable shared variables. The goal is to measure the overhead of different transaction types and variables in read-only transactions when there are no concurrent writes.
The input to a benchmark run is a list of a of successive Int
values.
The benchmark code runs a number of concurrent threads that each fold over the list and
each compute the sum of all entries. The list isn't mutated during the benchmarks.
OlderNewer