Menu

sockets Merge Request #1: Improve sockets send implementation by avoiding the copy (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Markus Ebner wants to merge 2 commits from /u/seiji-hiwatari/octave/ to default, 2019-08-29

The previous send implementation checked whether the amount of bytes in the given array were equal to the amount of elements, which means that it was essentially checking if it is a byte array.
But to send it, the data was interpreted as double, then copied into another buffer, and then sent. This lead to a HUGE memory consumption when sending a lot of data.

Since it is checked whether the data is a bytes-array anyway, interpret it as such and directly use it as buffer to send.

Commit Date  
[bb804f] (defaulttip) by Markus Ebner Markus Ebner

Fix indentation

2019-08-29 10:56:35 Tree
[ac8bbd] by Markus Ebner Markus Ebner

Improve sockets send implementation by avoiding the copy

- The previous send implementation checked whether the amount of bytes in the given
array were equal to the amount of elements, which means that it was checking if it is a byte array.
But to send it, the data was interpreted as double, then copied into another buffer, and then sent.
This lead to a HUGE memory consumption when sending a lot of data.
- Since it is checked whether the data is a bytes-array anyway, interpret it as such and directly use
it as buffer to send.

2019-08-29 10:51:57 Tree

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.