1. How to produce one ".exe" lower ?

Hello

I am using the Eu403 + Win32Lib + Windows and the line below to make the "myProg.exe"

system(getenv("EUDIR")&"\\bin\\eubind.exe myProg.exw",1) 

It's working, but the file "myprog.exe" is very large, 3,095 Kb.
The size is only 417 Kb, while "myprog.exe" is produced with the "eu311"

How can I reduce this 3,095 Kb size?
What should I do for this?

Thanks

new topic     » topic index » view message » categorize

2. Re: How to produce one ".exe" lower ?

sergelli said...

Hello

I am using the Eu403 + Win32Lib + Windows and the line below to make the "myProg.exe"

system(getenv("EUDIR")&"\\bin\\eubind.exe myProg.exw",1) 

It's working, but the file "myprog.exe" is very large, 3,095 Kb.
The size is only 417 Kb, while "myprog.exe" is produced with the "eu311"

How can I reduce this 3,095 Kb size?
What should I do for this?

Thanks

Binding creates a file that is size of euiw.exe interpreter + your program file.

You can try translating your program instead of binding.

new topic     » goto parent     » topic index » view message » categorize

3. Re: How to produce one ".exe" lower ?

BRyan said...

Binding creates a file that is size of euiw.exe interpreter + your program file. You can try translating your program instead of binding.

O. K. I'll try using the translator.

But, the way I'm calling the euiw.exe, causes a larger size?
Why using bind whit Eu311, the size is much smaller?

new topic     » goto parent     » topic index » view message » categorize

4. Re: How to produce one ".exe" lower ?

sergelli said...

O. K. I'll try using the translator.

But, the way I'm calling the euiw.exe, causes a larger size?
Why using bind whit Eu311, the size is much smaller?

The 3.11 interpreter size is 329 KB (337,408 bytes)

The 4.xx interpreter size is 1.88 MB (1,972,280 bytes)

new topic     » goto parent     » topic index » view message » categorize

5. Re: How to produce one ".exe" lower ?

Now, I used Watcom + EU4 + win32Lib to produce "myProg.exe", now the size was 2,300 Kb

euc -con myProg.exw 

So, the result is too large file, if compared with the results obtained with Eu311 (417 Kb).
That does not seem a step backwards?

new topic     » goto parent     » topic index » view message » categorize

6. Re: How to produce one ".exe" lower ?

sergelli said...

Now, I used Watcom + EU4 + win32Lib to produce "myProg.exe", now the size was 2,300 Kb

euc -con myProg.exw 

So, the result is too large file, if compared with the results obtained with Eu311 (417 Kb).
That does not seem a step backwards?

What is it translated with 3.1.1?

As for 2,300kb, that wouldn't concern me at all with todays computers. However, I wonder if some things are not being stripped properly from the executable. Something else you may wish to do is use upx if you are concerned about file size.

Is 2,300kb a problem for you? If so, why?

Jeremy

new topic     » goto parent     » topic index » view message » categorize

7. Re: How to produce one ".exe" lower ?

Eu 3.1.1 backend (IL interpreter) is compressed with the UPX therefore the result of the BIND command is much smaller. You can use UPX over your translated program as well.

new topic     » goto parent     » topic index » view message » categorize

8. Re: How to produce one ".exe" lower ?

jeremy said...

What is it translated with 3.1.1?

As for 2,300kb, that wouldn't concern me at all with todays computers. However, I wonder if some things are not being stripped properly from the executable. Something else you may wish to do is use upx if you are concerned about file size.

Is 2,300kb a problem for you? If so, why?

Jeremy

Translate with 3.1.1 ?
The size is 1.448 Kb

Problem for me ?

First, I get the feeling that something is wrong.
Then why would you choose the greatest, if the less does the same thing?

For my case, the large size cause slowness in FTP
and 417 Kb to nearly 2 Mg is a big diference. Also, do you do not think so?

In short, I want to know if I'm doing something wrong

new topic     » goto parent     » topic index » view message » categorize

9. Re: How to produce one ".exe" lower ?

sergelli said...

Translate with 3.1.1 ?
The size is 1.448 Kb

Problem for me ?

First, I get the feeling that something is wrong.
Then why would you choose the greatest, if the less does the same thing?

For my case, the large size cause slowness in FTP
and 417 Kb to nearly 2 Mg is a big diference. Also, do you do not think so?

In short, I want to know if I'm doing something wrong

I don't think you are doing anything wrong. You can use upx as Insolor has suggested. Also, size (to me) isn't a big factor in deciding if something is better. Today's computers (and networks) should have no problem with a file of this size. What I consider a big factor in deciding if something is better is how long did it take me to make the program and how does that program perform? 4.x is faster than 3.x in many areas and is easier to program in. The size is a bit larger but the other benefits are worth it.

I did a test of translating a simple program:

? 1 
3.1 4.0.3 3.1 upx 4.0.3 upx
107,008 207,360 90,112 50,712

I do not use Win32Lib and do not even have it installed. A similar table would be interesting with the Win32 lib compiled in.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

10. Re: How to produce one ".exe" lower ?

jeremy said...

Also, size (to me) isn't a big factor in deciding if something is better.
What I consider a big factor in deciding if something is better is how long did it take me to make the program and how does that program perform?
The size is a bit larger but the other benefits are worth it. Jeremy

Really, using the "Eu403," many problems that existed with the "Eu311" no longer exist.

I used "UPX" and the size has dropped from more than 3 Mg to 1.8 Mg
So I'll follow, using the "Eu403"

Thanks Jeremy

Sergio

new topic     » goto parent     » topic index » view message » categorize

11. Re: How to produce one ".exe" lower ?

I wonder if we can use more agressive flags for stripping binaries during compilation? Would that help on size any?

Jeremy

new topic     » goto parent     » topic index » view message » categorize

12. Re: How to produce one ".exe" lower ?

jeremy said...

I wonder if we can use more agressive flags for stripping binaries during compilation? Would that help on size any?

Jeremy

Please explain more, the Google translator did not understand smile

new topic     » goto parent     » topic index » view message » categorize

13. Re: How to produce one ".exe" lower ?

sergelli said...
jeremy said...

I wonder if we can use more agressive flags for stripping binaries during compilation? Would that help on size any?

Jeremy

Please explain more, the Google translator did not understand smile

I wonder if we can use more conditional indicators for removing code that is not needed during compilation to make smaller files?

new topic     » goto parent     » topic index » view message » categorize

14. Re: How to produce one ".exe" lower ?

BRyan said...

I wonder if we can use more conditional indicators for removing code that is not needed during compilation to make smaller files?

Matt can correct me if I am wrong but methods not used are not translated to the C files. So it's not a matter of not including Euphoria code, it has to do with the C library that we are linking to. Thus the C compiler would have to do a better job of stripping unused items.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

15. Re: How to produce one ".exe" lower ?

Removal of code that is not required at compile time, to make files smaller will always be a good thing.
Sergio

new topic     » goto parent     » topic index » view message » categorize

16. Re: How to produce one ".exe" lower ?

jeremy said...
BRyan said...

I wonder if we can use more conditional indicators for removing code that is not needed during compilation to make smaller files?

Matt can correct me if I am wrong but methods not used are not translated to the C files. So it's not a matter of not including Euphoria code, it has to do with the C library that we are linking to. Thus the C compiler would have to do a better job of stripping unused items.

After code is parsed, the translator makes several passes over the resulting code. If you've ever translated, you'll have noticed that the translator prints out numbers. These numbers represent the number of passes made through the code.

Each time through, the translator tracks the values of variables as best it can, and notices which routines are called and which variables are used. When it can definitely say that a routine or variable is never used, that routine or variable is ignored from there after.

Also, if it can prove that a particular variable only ever takes certain values, it tries to use that knowledge to eliminate code branches. So if a variable is always greater than zero, and you had something like the following:

if foo then 
    -- code 
else 
   -- code 
end if 

The translator will not even bother emitting the else block. No doubt, the C compiler does even more. And I'm sure there are more opportunities to improve the translator optimizations. The difficulty is in finding them. Also, there is a trade off between the optimizations and the time and memory used by the translator itself.

You could additionally strip the resulting binaries of any symbols that are kept after linking. I'm not sure if this is possible with Watcom. I generally wouldn't bother with this sort of thing.

The euphoria code itself has grown a bit (not huge amounts). We now have more functionality, including PCRE. I don't think this difference is very large, though. Certainly not as big as the difference made by compressing with UPX.

Matt

new topic     » goto parent     » topic index » view message » categorize

17. Re: How to produce one ".exe" lower ?

mattlewis said...

there is a trade off between the optimizations and the time and memory used by the translator itself.

I don't think we should care too much in the translator. Interpreter for sure. Maybe in a future version we can have an optimize flag that controls how many loops it'll take looking for optimizations, just like gcc. -O1, -O2, ...

Jeremy

new topic     » goto parent     » topic index » view message » categorize

18. Re: How to produce one ".exe" lower ?

jeremy said...
mattlewis said...

there is a trade off between the optimizations and the time and memory used by the translator itself.

I don't think we should care too much in the translator. Interpreter for sure. Maybe in a future version we can have an optimize flag that controls how many loops it'll take looking for optimizations, just like gcc. -O1, -O2, ...

Well, there are still practical limitations, but in general I agree, so long as it doesn't get too ridiculous.

Matt

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu