Open nimbupani opened 10 years ago
This is a major change. But yes, it's the correct fix.
I started the work a long time ago in this branch: https://github.com/adobe-photoshop/generator-core/tree/jrb/streaming
The reason it wasn't implemented this way initially is because node v0.8 didn't have streaming implementations of the crypto functions (which are necessary for socket-based communication with Photoshop). Node v0.10 does, but we haven't had the time to rewrite it.
Implementing it to ensure that buffer copies don't happen is challenging, because a.) there are different code paths for sockets and pipes (pipes aren't encrypted) and b.) in the socket case, not all bytes are encrypted (so the entire stream can't just be piped through the crypto stream). Making matters worse, reading a specified number of bytes from a node stream actually results in a buffer copy (of the unread portion, which can be as large as 64MB on mac -- PS dumps pixels quickly, and OS socket buffers are large). So, implementing this correctly involves writing a complicated transform stream that shuttles off the correct number of bytes to all of the correct places.
Anyway, if this is high priority, I might be able to finish my implementation this week. QEing it for shipping in 15.2 is another story, though.
It is high priority but it is too much of a risk right now for us to work with this change for MAX. We would like to pursue this immediately after zero-bug day for MAX. How does that work?
@nimbupani Works fine for me. I'll start (resume) implementing it now so that we have as much of a runway as possible post MAX.
Incidentally, we should lock down version numbers and start ps15.2-release branches in both repos soon, and start integrating from those into perforce (rather than from master). I'll do this soon, too. CC @iwehrman and @timothynoel regarding this fact. (I'll send an email when it's done.)
@joelrbrandt i have a pretty good understanding of what needs to happen there, if you need any engineering effort let me know.
Leaving this bug open to make sure it is actually resolved if/when we implement the suggested streaming. I have opened https://jira.corp.adobe.com/browse/PS-1327 to track that effort.
The test file is in the trello for Crema.
@rioter says:
@jhatwich says: