I've been bored. When that happens I program useless crap...

Discussion in 'OT Technology' started by lefty, Dec 25, 2005.

  1. lefty

    lefty I :heart: music

    Joined:
    Oct 7, 2000
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Austin, TX
    So I made a patching program and a program to rebuild stuff.

    You can try it out if you want...
    http://www.illimited.net/mpatch.zip

    I'll post the code if there's any interest. It's a little messy though (like most my code)

    The funny thing about making this was the results as I tried to make it faster. I got the functionality working and I started to improve it. I put in one thing that I thought would make it several times faster.

    Turns out that improvement made it slower....but.... it did a better job. I expected the results to be opposite.

    I had no idea how it was making it slower since the improvement removed several comparisons, all by making one comparison (the same kind it reduced). But the mind boggler was how it was making the thing patch better.

    So I rewrote a lot of it, thinking my new improvements would make it so much faster. Not really, a little bit. So then I just made levels of patching because the default way takes forever on big files (time gets exponentially larger the larger the file).

    Anyway, crazy stuff. If my boredom continues I'm going to make an entire offsite backup program. We'll see.
     
  2. lefty

    lefty I :heart: music

    Joined:
    Oct 7, 2000
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Austin, TX
    This is about the amoung of interest I expected, :)
     
  3. lefty

    lefty I :heart: music

    Joined:
    Oct 7, 2000
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Austin, TX
    It just takes 2 files and find where they are similar. Makes a list of all the places, and then adds in all the data that is not the same. So if you wanted to transfer an update, it would only contain new information.

    I tried it on some database backups, it took a 20mb and a 10mb file and made a patch that was about 12mb, then you can compress that patch to ~2.4mb. If you compressed the original it was about ~6.8mb and took twice as long. Plus I think the patchfile header data compresses pretty well.

    So if you were doing an offsite backup, you could transfer 12mb instead of 20mb. Or 2 instead of 7. It has it's uses.
     
  4. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    does it to pattern scanning or bit scanning?
     
  5. samm

    samm Next in Line

    Joined:
    Dec 22, 2000
    Messages:
    2,630
    Likes Received:
    0
    Location:
    San Jose, CA
    So you wrote gnu diff?
     
  6. lefty

    lefty I :heart: music

    Joined:
    Oct 7, 2000
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Austin, TX
    No, I'm sure it does a much better job
     
  7. lefty

    lefty I :heart: music

    Joined:
    Oct 7, 2000
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Austin, TX
    It tries to match patterns of bytes. It was a little easier that way...

    But you've given me an idea...
     

Share This Page