Skip to content

Commit

Permalink
✅ Make the data size stress test harder
Browse files Browse the repository at this point in the history
  • Loading branch information
leolabs committed Mar 26, 2022
1 parent 9954cdf commit 502ef2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions midi-script/Socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,23 @@ def shutdown(self):
def process(self):
try:
buffer = bytes()
num_messages = 0
while 1:
data = self._socket.recv(65536)
data = self._socket.recv(8192)
if len(data) and self.input_handler:
buffer += data[1:]
num_messages += 1

# \xFF for Live 10 (Python2) and 255 for Live 11 (Python3)
if(data[0] == b'\xFF' or data[0] == 255):
unzipped = zlib.decompress(buffer)
payload = json.loads(unzipped)

self.log_message("Receiving: " + str(payload))
self.log_message(
"Receiving from " + str(num_messages) + " messages, " + str(len(buffer)) + " bytes: " + str(payload))
self.input_handler(payload)
buffer = bytes()
num_messages = 0
except socket.error as e:
return
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion src/ns/song.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe("Song", () => {
await withAbleton(async (ab) => {
const largeArray: number[] = [];

for (let i = 0; i < 10000; i++) {
for (let i = 0; i < 100000; i++) {
largeArray.push(i);
}

Expand Down

0 comments on commit 502ef2f

Please sign in to comment.