Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Remove unused languages
Remove unused languages [message #41624] Mon, 06 January 2014 12:00 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

When I browse through my executable in the disassembler I see a lot of unused languages being compiled into the application. English is sufficient for me, Dutch, Polish, Swedish, etc. are not necessary and in my situation only waste space in the application.

Is there a way to disable or remove them in a way that they are not linked anymore?

Regards,
crydev
Re: Remove unused languages [message #41626 is a reply to message #41624] Mon, 06 January 2014 15:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
crydev wrote on Mon, 06 January 2014 06:00

Hello,

When I browse through my executable in the disassembler I see a lot of unused languages being compiled into the application. English is sufficient for me, Dutch, Polish, Swedish, etc. are not necessary and in my situation only waste space in the application.

Is there a way to disable or remove them in a way that they are not linked anymore?

Regards,
crydev


That is an interesting request... Smile

Is it worth it? (Can you check?). If it accounts for more than 50KB for console application, I guess we could consider option or compilation flag to leave only EN-US translations...

Mirek
Re: Remove unused languages [message #41628 is a reply to message #41624] Mon, 06 January 2014 16:20 Go to previous messageGo to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
I did some basic calculations, based on the information I found in the disassembler and what I found in files: Core.t and LangInfo.cpp.

The image below shows a few example strings. They are located in Core.t and I assume they are translations for an error or information message in multiple languages. However, in the disassembler you can see that they are all compiled into the executable. I did not measure this, but an educated guess on Core.t, which is 44 kb (~ 40 kb with margins of non-trivial information) is linked into the executable. If just the english translations are linked into the executable, the size could be reduced by roughly: average string length divided by the number of languages built into U++.

index.php?t=getfile&id=4398&private=0

The image below shows the language array in LangInfo.cpp. The big rectangle shows the strings that are linked, which are a hell of a lot and they shouldn't be necessary.

The small rectangle shows the fact that some strings even indicate only very small differences. The compilation loaded into IDA Pro is built in VC10 Optimal with String Pooling enabled. Even if these strings could not be eliminated, it would be nice if they could be concatenated in order to remove the redundancy that is generated.

index.php?t=getfile&id=4399&private=0

If you need any more information, please tell me. Smile

Regards,
crydev
Re: Remove unused languages [message #41630 is a reply to message #41628] Mon, 06 January 2014 17:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, IMO it makes sense to at least add RM issue about this. Alternatively, we could consider also consider compression (zlib) - but that might be hard(er) to achieve.
Re: Remove unused languages [message #41640 is a reply to message #41630] Mon, 06 January 2014 23:24 Go to previous messageGo to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
mirek wrote on Mon, 06 January 2014 17:45

OK, IMO it makes sense to at least add RM issue about this. Alternatively, we could consider also consider compression (zlib) - but that might be hard(er) to achieve.


That would be very nice. I have been trying to get my hands on the whereabouts of zlib in U++ GUI applications and why it is being used. I am not sure but I think it has something to do with the iml compression? If so, it has to be researched / tested whether removing zlib actually results in a decrease of image size when images are not compressed anymore and in situations of how many images you should have in order to gain size improvements.

Could you enlighten the purpose of zlib in U++ GUI applications a bit more?

Thanks,
crydev
Re: Remove unused languages [message #41642 is a reply to message #41640] Tue, 07 January 2014 09:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
crydev wrote on Mon, 06 January 2014 17:24

mirek wrote on Mon, 06 January 2014 17:45

OK, IMO it makes sense to at least add RM issue about this. Alternatively, we could consider also consider compression (zlib) - but that might be hard(er) to achieve.


That would be very nice. I have been trying to get my hands on the whereabouts of zlib in U++ GUI applications and why it is being used. I am not sure but I think it has something to do with the iml compression? If so, it has to be researched / tested whether removing zlib actually results in a decrease of image size when images are not compressed anymore and in situations of how many images you should have in order to gain size improvements.

Could you enlighten the purpose of zlib in U++ GUI applications a bit more?



Well, zlib is quite universally used about everywhere fast moderate compression is required. I do not think I will recall all of them, but

.imls are indeed compressed
.brc files can be compressed as well
.tpp files are compressed
HttpRequest has to use zlib to decompress responses
plugin/png is using zlib; png is format of choice for X11 clipboard
Some of RichObject formats use zlib compression
RichEdit spellchecker is using zlib compression
....

Mirek

[Updated on: Tue, 07 January 2014 10:07]

Report message to a moderator

Re: Remove unused languages [message #57885 is a reply to message #41642] Mon, 27 December 2021 02:44 Go to previous message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
A extremely simply solution to this particular problem is find all *.t that's used by the program, either comment out each of them, or if you don't see any chance you will use them in the future, just delete the content (but not any of the *.t files) of each of them. This works for English only. The saving is not very significant.
Previous Topic: How to detect available OpenGL memory?
Next Topic: HelloWorld example fails building
Goto Forum:
  


Current Time: Thu Mar 28 19:45:21 CET 2024

Total time taken to generate the page: 0.01152 seconds