full-duplex communication over single TCP connection
websocket.send('hi');
websocket.onmessage = function(evt) { console.log('server said: ' + evt.data); };
> server said: hello!
Processing a 16M text message
Be faster than most popular implementations
version 1
Instrument everything and profile
Very high GC pressure
Image would grow to over 1GB!
(Both brought down GC pressure significantly)
write-u8vector
(a websockets psuedo security mechanism)
Converted from pure Scheme code to C
(CHICKEN allows embedding C directly)
Most websockets implementations use a fast, freely available C algorithm/implementation
But it was broken!
Pretty much reached the goal but can we do better?
Realization:
> Unless byte is greater than 127 continue to next byte else bail to parser combinator algorithm