Skip to content

Conversation

friday
Copy link
Member

@friday friday commented Jun 15, 2023

I've been pushing underlying PRs and commits to enable this change recently: #1221, #1230, 6706467, ee73262 #1237 d8f65e2 a23ff49

It's working well for me, although pickle is apparently more compact, so the result is the messages are actually much longer now (sometimes more than twice as big).

I tested with ulauncher-clipboard and sending 200 items (not that my window is big enough to render them all). The result size is 54196 bytes instead of 22773 before this PR.

But that still wasn't noticably slow. JSON is much faster to serialize and parse (more than 10x) and it is generally better and a step towards supporting extensions in other languages #283

I'm not sure how much the PickleFramer class (now renamed) still makes sense though. It looks to me like it's more about the socket communication and switching from pickle to json doesn't really change anything there?

@troycurtisjr
Copy link
Member

It looks good to me and seems to run fine on my machine. I'll keep running with it to see if I notice any issues.

Yes, the PickleFramer (now JsonFramer) is just responsible for taking the object and putting it into a form that can be sent over a byte stream and reconstructed on the other side. The only thing that makes it Json or Pickle specific is the encode/decode functionality which was correctly updated in the PR. If a message based system is used in the future, like what I think dbus is, then message framing is no longer needed, since the system will keep track of which bytes go to which messages natively.

@friday friday merged commit 32dc199 into v6 Jun 23, 2023
@friday friday deleted the feat/json branch June 23, 2023 21:30
@friday
Copy link
Member Author

friday commented Jun 23, 2023

Merged so I can get started on the DBUS POC. We can always revert changes if they lead to regression.

Edit by future me: I went another direction (no Dbus).

@friday friday mentioned this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants