mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
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.
This commit is contained in:
parent
49d43ff11b
commit
010ee1e91d
@ -619,9 +619,8 @@
|
|||||||
::
|
::
|
||||||
++ format-ud-as-integer
|
++ format-ud-as-integer
|
||||||
|= a=@ud
|
|= a=@ud
|
||||||
^- @t
|
^- tape
|
||||||
?: =(0 a) '0'
|
?: =(0 a) ['0' ~]
|
||||||
%- crip
|
|
||||||
%- flop
|
%- flop
|
||||||
|- ^- tape
|
|- ^- tape
|
||||||
?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])
|
?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])
|
||||||
@ -823,7 +822,7 @@
|
|||||||
status-code=code
|
status-code=code
|
||||||
^= headers
|
^= headers
|
||||||
:~ ['content-type' content-type]
|
:~ ['content-type' content-type]
|
||||||
['content-length' (format-ud-as-integer p.data)]
|
['content-length' (crip (format-ud-as-integer p.data))]
|
||||||
==
|
==
|
||||||
data=[~ data]
|
data=[~ data]
|
||||||
complete=%.y
|
complete=%.y
|
||||||
@ -1354,7 +1353,7 @@
|
|||||||
::
|
::
|
||||||
=/ event-stream-lines=wall
|
=/ event-stream-lines=wall
|
||||||
%- weld :_ [""]~
|
%- weld :_ [""]~
|
||||||
:- "id: {<event-id>}"
|
:- (weld "id: " (format-ud-as-integer event-id))
|
||||||
%+ turn json-text
|
%+ turn json-text
|
||||||
|= =tape
|
|= =tape
|
||||||
(weld "data: " tape)
|
(weld "data: " tape)
|
||||||
@ -1436,7 +1435,7 @@
|
|||||||
200
|
200
|
||||||
^- header-list
|
^- header-list
|
||||||
:~ ['content-type' (en-mite:mimes:html p.result)]
|
:~ ['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]
|
`(unit octs)`[~ q.result]
|
||||||
complete=%.y
|
complete=%.y
|
||||||
|
Loading…
Reference in New Issue
Block a user