-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
It occurs to me that if SCP reads and writes used memoryviews much more internally it may be possible to extract further performance improvements.
- Allow the
datapart of SDP and SCP packets to be a byte-formattedmemoryview- ensure thatbytesis called on it prior to creating a bytestring for the packet. -
SCPConnection.writeshould accept a byte-formattedmemoryviewto write and should cast all other arguments into this type before constructing write packets.-
MachineController.writeshould be documented appropriately, and performmemoryview.castupon any received objects to ensure that they are in an appropriate format.
-
- More controversially
SCPConnection.readshould be replaced withread_intowhich accepts, instead of a number of bytes, a byte-formattedmemoryviewto fill with data from the machine.- @mossblaser This will affect integration with project-rig/rig-scp - do you have any thoughts here? It may still be possible to use
ctypesand return a pointer to a char array from amemoryview, but I'm not sure. -
MachineController.readshould work a currently, just modified to create a buffer to pass toread_into -
MachineController.read_intoshould be added and should cast thememoryviewit receives as appropriate.
- @mossblaser This will affect integration with project-rig/rig-scp - do you have any thoughts here? It may still be possible to use
- In WIP Even faster SCP. #115
send_scp_burstshould call callbacks with bytestrings/memoryviews RATHER than unpacked packets. This reduce the amount of needless unpacking in the case that none or only some of the SCP fields are used.
Reactions are currently unavailable