Skip to content

Commit 7455cbc

Browse files
committed
Don't serialize the history any more
1 parent 97a9e9e commit 7455cbc

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/api/server.rkt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,16 @@
434434
[analysis (if (hash? backend-hash)
435435
(hash-ref backend-hash 'end)
436436
'())])
437-
(define history (read (open-input-string (hash-ref analysis 'history))))
438-
(define block `(div ([id "history"]) (ol ,@history)))
437+
(define history (hash-ref analysis 'history))
438+
(define block `(div ([id "history"]) (ol ,@(render-history history ctx))))
439439
(call-with-output-string (curry write-xexpr block))))
440440

441441
(define derivations
442-
(for/list ([altn (in-list altns)])
443-
(render-json altn pcontext (test-context test) errcache)))
442+
(for/list ([altn (in-list altns)]
443+
[analysis (if (hash? backend-hash)
444+
(hash-ref backend-hash 'end)
445+
'())])
446+
(hash-ref analysis 'history)))
444447

445448
(hasheq 'test
446449
(~s test-fpcore)
@@ -479,7 +482,6 @@
479482
(define cost (alt-cost alt repr))
480483

481484
(define history-json (render-json alt pcontext (test-context test) errcache))
482-
(define history (render-history history-json (test-context test)))
483485

484486
(define vars (test-vars test))
485487
(define splitpoints
@@ -492,7 +494,7 @@
492494
(hasheq 'expr
493495
(~s (alt-expr alt))
494496
'history
495-
(~s history)
497+
history-json
496498
'errors
497499
test-errors
498500
'cost

src/reports/make-graph.rkt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
(require (only-in xml write-xexpr xexpr?)
44
(only-in fpbench core->tex *expr-cse-able?* [core-common-subexpr-elim core-cse]))
55

6-
(require "../utils/common.rkt"
7-
"../core/points.rkt"
6+
(require "../utils/alternative.rkt"
7+
"../utils/common.rkt"
88
"../utils/float.rkt"
9-
"../utils/alternative.rkt"
10-
"../syntax/types.rkt"
119
"../syntax/read.rkt"
10+
"../syntax/types.rkt"
1211
"../core/bsearch.rkt"
12+
"../core/points.rkt"
1313
"../api/sandbox.rkt"
14-
"common.rkt")
14+
"common.rkt"
15+
"history.rkt")
1516

1617
(provide make-graph
1718
dummy-graph)
@@ -50,7 +51,7 @@
5051
(define end-costs (map (curryr hash-ref 'cost) end))
5152
(define end-histories
5253
(for/list ([end-analysis (in-list end)])
53-
(read (open-input-string (hash-ref end-analysis 'history)))))
54+
(hash-ref end-analysis 'history)))
5455

5556
; Speedup is going to be #f if cost is 0 for each alternative
5657
(define speedup
@@ -167,7 +168,8 @@
167168
,dropdown
168169
,(render-help "report.html#alternatives"))
169170
,body
170-
(details (summary "Derivation") (ol ((class "history")) ,@history))))
171+
(details (summary "Derivation") (ol ((class "history"))
172+
,@(render-history history ctx)))))
171173
,@(for/list ([i (in-naturals 1)]
172174
[target (in-list targets)])
173175
(define target-error (hash-ref target 'errors))

0 commit comments

Comments
 (0)