mkovatsc / Copper

Copper (Cu) CoAP user-agent (JavaScript implementation)

Home Page:http://people.inf.ethz.ch/mkovatsc/copper.php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slow blockwise upload, 100% CPU load, ultimately fails

rfjakob opened this issue · comments

Trying to PUT a 100kB file with 256B blocks runs slow and ultimately fails with a timeout. Checking with Wireshark shows that Copper waits about 2 seconds after getting the ACK before sending the next block:
pcap
The Firefox process spins at 100% CPU during the upload.

PS: Thanks for the plugin, great work!

Interestingly, the message log tells a different story. According to the log, there is no gap between ACK and PUT:
message log
However, this is incorrect as seen in the Wireshark log. The packet just seems to take 2 seconds to process inside Copper.

Uploading the file through coap-client from libcoap finishes in 29 seconds.

As mentioned in the PR, it is the renderer loop for binary that is super slow and needs to be reworked with cached sub-results...