Author Topic: Compressed DLLs  (Read 3116 times)

0 Members and 1 Guest are viewing this topic.

kryton9

  • Guest
Compressed DLLs
« on: August 11, 2012, 10:45:27 PM »
I tried upx on oxygen.dll and freeglut.dll and reduced their size by a good bit. Here is a test of them.
oxygen.dll 416kb down to 135 kb
freeglut.dll 210kb down to 66kb

I put upx in the zip file too.

Open a command prompt type:
upx -9 dllNameOrExeNameWithExtention

X

Charles Pegge

  • Guest
Re: Compressed DLLs
« Reply #1 on: August 12, 2012, 02:01:24 AM »
Thanks Kent. Interesting!

standard zip compression takes Oxygen.dll down to about 180k, so it offers around 20% further compression, even with the loader overhead.

One format missing on their list though: win64.

Charles

Peter

  • Guest
Re: Compressed DLLs
« Reply #2 on: August 12, 2012, 03:41:44 AM »
Nowadays we have more than 1 Terra Byte Harddrives.
And Kent is packing 138.0 KB with UPX !

Is your Hd only 1 MB ?
Upx isn't  interesting. Maybe, some years ago. (1805-1939)   :D

jcfuller

  • Guest
Re: Compressed DLLs
« Reply #3 on: August 12, 2012, 05:14:41 AM »
Peter,
 It is not about local storage but about deployment.
I find upx very useful with statically linked wxWidget apps.

This simple ubx example comes in at 2,358,784 bytes.
after ubx -> 702,464

James

Code: [Select]
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
'Layout management in wxWidgets
'Absolute Positioning
'From http://zetcode.com/tutorials/
'Absolute example from: http://zetcode.com/tutorials/wxwidgetstutorial/layoutmanagement/
'Ported to ubx by James C. Fuller 02-13-2011
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
$WX "MyApp"

$NOMAIN
'for windows
$ONEXIT "wxgui.bat $FILE$"
'for Linux
'$EXECON
'=======================================================================

Class Absolute Inherits wxFrame
    public
        Dim Constructor Absolute(title As wxString)
    protected
        Raw As wxMenuBar* menubar
        Raw As wxMenu* xfile,edit,help
        Raw As wxTextCtrl* textctrl
End Class
'-----------------------------------------------------------------------
Constructor Absolute::Absolute(title As wxString) Using _
    wxFrame(NULL, -1, title, wxPoint(-1, -1), wxSize(250, 180))

    Raw xpanel As wxPanel Ptr
    Raw menubar As wxMenuBar Ptr
   
    xpanel = new wxPanel(this, -1)
    menubar = new wxMenuBar
    xfile = new wxMenu
    edit = new wxMenu
    help = new wxMenu
    PREPEND `menubar->Append`
        (xfile, wxT("&File"))
        (edit, wxT("&Edit"))
        (help, wxT("&Help"))
    END PREPEND   
    SetMenuBar(menubar)
    textctrl = new wxTextCtrl(xpanel, -1, wxT(""), wxPoint(-1, -1), wxSize(250, 150))

    Centre()
   
End Sub
'=======================================================================
Function MyApp::OnInit() As boolean
    Raw abso As Absolute Ptr
    abso = new Absolute(wxT("Absolute"))
    abso->Show(true)
    Function = true
End Function
'==============================================================================



X

Peter

  • Guest
Re: Compressed DLLs
« Reply #4 on: August 12, 2012, 07:59:12 AM »
Hi James,

2,358,784 bytes isn't that much.
It's only a pack rate of 3,35%  !

I have used UPX in the past very often.
I didn't say is bad, only unnecessary.

kryton9

  • Guest
Re: Compressed DLLs
« Reply #5 on: August 12, 2012, 11:53:53 AM »
I just found it interesting it worked on DLL's also and did quite a nice job.

Aurel

  • Guest
Re: Compressed DLLs
« Reply #6 on: August 13, 2012, 03:03:23 AM »
I don't prefer compressed stuff because in the past i have some
nasty security problems ...in first place with UPX... >:(