Is the WindowLib splitted !?

Everything else that doesn't fall into one of the other PB categories.
Ralf
Enthusiast
Enthusiast
Posts: 203
Joined: Fri May 30, 2003 1:29 pm
Location: Germany

Is the WindowLib splitted !?

Post by Ralf »

Hi Fred!
Today i noticed when using just only WaitWindowEvent(), this will add about 7 KB to an exe! Why is it so big? Possible the lib isnt spiltted yet? Will there be any other way to reduce the exe size? I know its not so important and its just only a question i would like to know. thanks and keep on your work!
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

The window library is splitted but it does includes some workaround which adds some kb.. i bet it's the little price to paid for having correct event handling, especially size one.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

is 7kb that much now adays?
I mean.. Come on!

PB exes are already WAY too small and I love it, even that they might be getting bigger and bigger on newer versions :shock:
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

dagcrack wrote:is 7kb that much now adays?
Of course. 1 bit is too much if it is a surplus :!:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

There is no surplus, i can assure you.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Psychophanta wrote:
dagcrack wrote:is 7kb that much now adays?
Of course. 1 bit is too much if it is a surplus :!:
If 7kb is too much for your liking, don't use OpenWindow() but use the API
commands instead. Of course you'll have to take care for proper event-handling
on your own then. This will save you quite some kilobytes.
(BTW: Same goes for MessageRequester() / 3.5kb vs. MessageBox_() / 2.5kb)
Good programmers don't comment their code. It was hard to write, should be hard to read.
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

7kb is the price to pay for M$ having a quite weird way of handling their event messages :D
quidquid Latine dictum sit altum videtur
Ralf
Enthusiast
Enthusiast
Posts: 203
Joined: Fri May 30, 2003 1:29 pm
Location: Germany

Post by Ralf »

even if some libs will always be splitted, i dont understand that those commands link more to the exe as using just the plain api, like:

MessageRequester() ./. MessageBox_()
Delay() ./. Sleep_()

and some other things. can someone explain this, maybe fred? would be nice to know... (i still think some debugger routines could be linked to the final version and so it will add some more KB as using plane api functions!?
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Come on, this is paranoid. There are 250gb drives in even the cheapest computers today, so who will a few kb hurt :?:

Well, but since you ask:

Sleep and delay are the same. Did you try this? I get the exact same size, no matter which i use.

MessageRequester()
There is extra code, yes. It is because on windows, while a requester is open,
all windows except the foreground one are still able to receive events.
(That's because it is designed that you handle events for these windows in a callback)
Well, in PB, you don't have to use a callback, which is good, and btw also how
it is on all other platforms.
To do this, there is a routine to disable/enable these windows while the requester
is open.

I am not going to explain the reasons why we added some extra code
to some of the 700+ pb commands.. i hope you understand that.

We add extra code wherever it is neccesary to make live easier. That's
the whole concept of PB. If you don't like that, don't use the PB commands.
There is always the api way.

> (i still think some debugger routines could be linked to the final version and so it will add some more KB as using plane api functions!?

We're not dumb btw. :wink:
quidquid Latine dictum sit altum videtur
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Agreeing with PB Developers, this guys ARE Paranoid, go work in assembler if you don't want those 7kb or 1kb or 1byte more or less.

THATS ALL ! jesus
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Search for gui toolkits on the web and find one that is smaller than purebasic's.
dagcrack wrote: Agreeing with PB Developers, this guys ARE Paranoid, go work in assembler if you don't want those 7kb or 1kb or 1byte more or less.
I second that.
.
BTW
You could go with c--, use wxcmm as gui-toolkit, it can create pretty small exe's too.
But it's not a Basic style language, it's a mixture of c and asm.
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Hey, there is of course no debug routines left in the final executable, come on ! About the extra size, Fr34k explained it, PB doesn't do only API wrapping, there is some extra code sometimes ;)..
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Well, traumatic and others, I (we) don't say not to more final .exe sizes, but not to more .exe sizes if it is a surplus, am i correct explain now?
Fred and Timo understand it perfectly, because it is one of the PB policies. Fred and Timo assure there is not a surplus size if we want to use the weird (incoherent i'd call it) MS stablished event handler. And of course, i strongly trust and believe on Fred and Freak (Timo), :)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

he he, these posts seem to crop up once in a while and they always make me chuckle. :) Only PB developers have this new condition that Fred & Co. has created called 'No-Bloat Addiction' or 'Kilobyte Anorexia'. :lol: :wink:
--Kale

Image
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

:lol:
Post Reply