this post was submitted on 10 Aug 2023
344 points (100.0% liked)

Programmer Humor

421 readers
5 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] odium@programming.dev 2 points 1 year ago* (last edited 1 year ago)

Also a lay person. Maybe it's because of the time complexity. Let's say you have data of size 10 (any unit) which becomes size 8 after compression.

If you encrypt first: Encrypt size 10 of data -> Conpress size 10 of data

If you compress first: Compress size 10 of data -> Encrypt size 8 of data

So second way is faster as the compression still takes the same size of input but the encryption takes a smaller input.