forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to a streaming zip encoding (digital-asset#2595)
This switches the creation of the archive in `daml build` from `zip-archive` to `zip`. This has a few advantages: 1. It gets rid of lazy IO for reading all the interface and source files. This avoids the high usage of file handles in `daml build`. 2. It seems to be a slight improvement in max memory usage and runtime and a giant improvement in allocations (but I think the latter probably comes primarily from the fact that the locations are moved to the bzip C library). The improvement in max memory usage is less than I expected so probably there is still something off somewhere. For now, I only switched over `createArchive`. Archive reading is still done using `zip-archive`. We might want to switch that over in a separate PR.
- Loading branch information
1 parent
c71237b
commit 3e2ccc0
Showing
12 changed files
with
147 additions
and
70 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_library( | ||
name = "bz2", | ||
srcs = [ | ||
"blocksort.c", | ||
"bzlib.c", | ||
"compress.c", | ||
"crctable.c", | ||
"decompress.c", | ||
"huffman.c", | ||
"randtable.c", | ||
], | ||
hdrs = [ | ||
"bzlib.h", | ||
"bzlib_private.h", | ||
], | ||
includes = [ | ||
".", | ||
], | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@rules_haskell//haskell:defs.bzl", "haskell_library") | ||
load("@ai_formation_hazel//:hazel.bzl", "hazel_library") | ||
|
||
haskell_library( | ||
name = "lib", | ||
visibility = ["//visibility:public"], | ||
srcs = [":Bindings/Utilities.hs"], | ||
deps = [hazel_library("base"), ":bindings-DSL-cbits"], | ||
) | ||
|
||
|
||
cc_library( | ||
name = "bindings-DSL-cbits", | ||
visibility = ["//visibility:public"], | ||
hdrs = [":bindings.dsl.h", ":bindings.cmacros.h"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/Data/Conduit/BZlib/Internal.hsc b/src/Data/Conduit/BZlib/Internal.hsc | ||
index f980d35..18d6e3a 100644 | ||
--- a/src/Data/Conduit/BZlib/Internal.hsc | ||
+++ b/src/Data/Conduit/BZlib/Internal.hsc | ||
@@ -1,7 +1,7 @@ | ||
{-# LANGUAGE ForeignFunctionInterface #-} | ||
|
||
#include <bzlib.h> | ||
-#include <bindings.dsl.h> | ||
+#include "bindings.dsl.h" | ||
|
||
module Data.Conduit.BZlib.Internal where | ||
|
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
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
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
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
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
Oops, something went wrong.