aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorpacien2019-12-27 15:35:42 +0100
committerpacien2019-12-27 15:35:42 +0100
commita8cdc6eba4ba496bec816dcb7f3c2c0f5114f4c8 (patch)
tree4464184f55f400e23d5d6a436696ddaea7f3f7ad /compiler
parent45df822904cd1759ea4be4bf0c125d8fb6542479 (diff)
downloadldgallery-a8cdc6eba4ba496bec816dcb7f3c2c0f5114f4c8.tar.gz
compiler: enable parallelisation
Diffstat (limited to 'compiler')
-rw-r--r--compiler/package.yaml1
-rw-r--r--compiler/src/Resource.hs3
2 files changed, 3 insertions, 1 deletions
diff --git a/compiler/package.yaml b/compiler/package.yaml
index 21677fb..90c4ea5 100644
--- a/compiler/package.yaml
+++ b/compiler/package.yaml
@@ -25,6 +25,7 @@ dependencies:
25- cmdargs 25- cmdargs
26- JuicyPixels 26- JuicyPixels
27- JuicyPixels-extra 27- JuicyPixels-extra
28- parallel-io
28 29
29library: 30library:
30 source-dirs: src 31 source-dirs: src
diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs
index a8be913..c3ed959 100644
--- a/compiler/src/Resource.hs
+++ b/compiler/src/Resource.hs
@@ -32,6 +32,7 @@ module Resource
32 ) where 32 ) where
33 33
34 34
35import Control.Concurrent.ParallelIO.Global (parallel)
35import Data.Function ((&)) 36import Data.Function ((&))
36import Data.List ((\\), subsequences, sortBy) 37import Data.List ((\\), subsequences, sortBy)
37import Data.Ord (comparing) 38import Data.Ord (comparing)
@@ -76,7 +77,7 @@ buildResourceTree processDir processItem processThumbnail = resNode
76 do 77 do
77 processedDir <- processDir path 78 processedDir <- processDir path
78 processedThumbnail <- maybeThumbnail thumbnailPath 79 processedThumbnail <- maybeThumbnail thumbnailPath
79 dirItems <- mapM resNode items 80 dirItems <- parallel $ map resNode items
80 return DirResource 81 return DirResource
81 { items = dirItems 82 { items = dirItems
82 , resPath = processedDir 83 , resPath = processedDir