Skip to content

Commit 6b444b9

Browse files
authored
Merge pull request #5943 from unisonweb/topic/deserial-perf
2 parents 9f7fc16 + 17e4c3a commit 6b444b9

File tree

15 files changed

+701
-386
lines changed

15 files changed

+701
-386
lines changed

unison-cli/src/Unison/Main.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ import ArgParse
2525
)
2626
import Compat (defaultInterruptHandler, withInterruptHandler)
2727
import Control.Concurrent (newEmptyMVar, runInUnboundThread, takeMVar)
28-
import Control.Exception (displayException, evaluate, fromException)
28+
import Control.Exception (displayException, fromException)
2929
import Data.Bitraversable (bitraverse)
3030
import Data.ByteString qualified as BS
31-
import Data.ByteString.Lazy qualified as BL
3231
import Data.Either.Validation (Validation (..))
3332
import Data.List.NonEmpty (NonEmpty)
3433
import Data.Text qualified as Text
@@ -230,8 +229,8 @@ main version = do
230229
noOpCheckForChanges
231230
CommandLine.ShouldNotWatchFiles
232231
Run (RunCompiled file) args ->
233-
BL.readFile file >>= \bs ->
234-
try (evaluate $ RTI.decodeStandalone bs) >>= \case
232+
BS.readFile file >>= \bs ->
233+
try (RTI.decodeStandalone bs) >>= \case
235234
Left re -> do
236235
exnMessage <- RTI.prettyRuntimeExn fetchIssueFromGitHub re
237236
exitError . P.lines $

unison-runtime/cbits/i2d.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdint.h>
2+
3+
double unisonWord64ToDouble(uint64_t lin) {
4+
union {
5+
double d;
6+
uint64_t l;
7+
} u;
8+
u.l = lin;
9+
return u.d;
10+
}
11+
12+
float unisonWord32ToFloat(uint32_t lin) {
13+
union {
14+
float f;
15+
uint32_t l;
16+
} u;
17+
u.l = lin;
18+
return u.f;
19+
}

unison-runtime/package.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ library:
4949
- condition: false
5050
other-modules: Paths_unison_runtime
5151

52+
c-sources:
53+
- cbits/i2d.c
54+
5255
dependencies:
5356
- asn1-encoding
5457
- asn1-types
@@ -58,7 +61,6 @@ library:
5861
- binary
5962
- bytes
6063
- bytestring
61-
- cereal
6264
- clock
6365
- containers >= 0.6.3
6466
- cryptonite
@@ -119,9 +121,7 @@ tests:
119121
other-modules: Paths_unison_parser_typechecker
120122
dependencies:
121123
- base
122-
- bytes
123124
- bytestring
124-
- cereal
125125
- code-page
126126
- containers
127127
- cryptonite

0 commit comments

Comments
 (0)