Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions benchmark/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import qualified DataFrame as D
import qualified DataFrame.Functions as F

import Control.DeepSeq (NFData (..))
import Control.Monad (void)
import Control.Monad (void, when)
import Criterion.Main
import DataFrame.Internal.DataFrame (forceDataFrame)
import DataFrame.Operations.Join
import DataFrame.Operators
import System.Directory (doesFileExist)
import System.Process hiding (env)
import System.Random.Stateful

Expand Down Expand Up @@ -95,6 +96,15 @@ groupByExplorer = do
parseFile :: String -> IO ()
parseFile = void . D.readCsv

covidCsv :: String
covidCsv = "./data/effects-of-covid-19-on-trade-at-15-december-2021-provisional.csv"

-- The 9.5 MB covid input is not shipped in the sdist; no-op when absent.
parseFileIfPresent :: String -> IO ()
parseFileIfPresent path = do
exists <- doesFileExist path
when exists (parseFile path)

parseHousingCSV :: IO ()
parseHousingCSV = parseFile "./data/housing.csv"

Expand Down Expand Up @@ -223,10 +233,7 @@ main = do
]
, bgroup
"effects-of-covid-19-on-trade-at-15-december-2021-provisional.csv (9.1 MB)"
[ bench "Attoparsec" $
nfIO $
parseFile
"./data/effects-of-covid-19-on-trade-at-15-december-2021-provisional.csv"
[ bench "Attoparsec" $ nfIO $ parseFileIfPresent covidCsv
]
, bgroup
"join/inner/1:1"
Expand Down
1 change: 0 additions & 1 deletion dataframe-operations/src/DataFrame/Functions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
Expand Down
8 changes: 8 additions & 0 deletions dataframe.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ extra-source-files: cbits/arrow_abi.h
tests/data/*.parquet
tests/data/unstable_csv/*.csv
tests/data/unstable_csv/*.tsv
data/housing.csv
data/starwars.csv
data/chipotle.tsv
data/measurements.txt
benchmark/pandas/*.py
benchmark/polars/*.py
benchmark/explorer/*.exs
-- tests/data/*.md
-- tests/data/*.bin
-- tests/data/*.json
Expand Down Expand Up @@ -290,6 +297,7 @@ benchmark dataframe-benchmark
build-depends: base >= 4 && < 5,
criterion >= 1 && < 2,
deepseq >= 1.4 && < 2,
directory >= 1.3 && < 2,
process >= 1.6 && < 2,
dataframe >= 3.5 && < 3.6,
dataframe-core >= 2.4 && < 2.5,
Expand Down
Loading