Remove implicit +sell
On each wakeup during send in light, we were spending about 7ms inside
+sell. Replace that with an equivalent way of printing an integer to
a tape. We now spend about half a ms on each outbound message.
::
++ format-ud-as-integer
|= a=@ud
- ^- @t
- ?: =(0 a) '0'
- %- crip
+ ^- tape
+ ?: =(0 a) ['0' ~]
%- flop
|- ^- tape
?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])
status-code=code
^= headers
:~ ['content-type' content-type]
- ['content-length' (format-ud-as-integer p.data)]
+ ['content-length' (crip (format-ud-as-integer p.data))]
==
data=[~ data]
complete=%.y
::
=/ event-stream-lines=wall
%- weld :_ [""]~
- :- "id: {<event-id>}"
+ :- (weld "id: " (format-ud-as-integer event-id))
%+ turn json-text
|= =tape
(weld "data: " tape)
200
^- header-list
:~ ['content-type' (en-mite:mimes:html p.result)]
- ['content-length' (format-ud-as-integer p.q.result)]
+ ['content-length' (crip (format-ud-as-integer p.q.result))]
==
`(unit octs)`[~ q.result]
complete=%.y
