Page 1 of 1

Improve optimized ASM output !!!

Posted: Mon Aug 08, 2005 8:13 pm
by va!n
As long as i know PureBasic, people discused again and again about some speed/optimizing improvements! I visited the very active german forum (great guys there!) and noticed that a lot people are discussing about speed and more optimisations!!!

On the german forum is one very talented guy named "remi_meier" from switzerland and he showed a lot of speed optimisations and at least he coded a small fantastic tool called "optimizer"! This great tool will check the PureBasic generated ASM output and try to replace some ASM parts by a lot faster and optimized routines!! There are some very strange speed compasion results between the original PB output and converted by the tool optimizer! (in some cases the OPTIMIZED output as double fast as the original output - still impressive and my biggest respect!!!

I see remi_meier as a very talented coder; even he know a lot about ASM speed optimisations! So i would like to see remi_meier as a member of the official pure_team to help fred and at least to help us... for having a really intelligent and gooood compiler that produces very optimized and fast executeables!!! (i dont need a fast compiler... i still need fast executeables ;-)

Fred, would be nice if you can get in contact with remi_meier and maybe other very talented coders on the pure comunity to improve purebasic!

Here are some interested links/stuff for optimizing...

http://www.azillionmonkeys.com/qed/amultl1.html
http://www.wasm.ru/tools/22/magicnumber.zip
http://www.xyzw.de/c190.html <<< high optimized math routines
http://mypage.bluewin.ch/remimeier/zip/Optimierer.zip << for PureBasic
http://www.iseran.com/Win32/CodeForSpeed/
http://www.deinmeister.de/asmopt.htm#b

----------------------------------------------------------------

Please vote... do you want a better compiler producing fast optimized asm output? (fred, this should be no critic and i dont want blame you!!! ;-)

Posted: Mon Aug 08, 2005 9:30 pm
by remi_meier
First: :oops:

> he showed a lot of speed optimisations and at least he coded a small
> fantastic tool called "optimizer"!
A lot of the optimization ideas don't come from me, the forum members
helped a lot! (just look into the Credits.txt)

> So i would like to see remi_meier as a member of the official pure_team
> to help fred and at least to help us...
Fred knows enough about optimizing, he just should implement it!

I voted yes (cause I have a lot of time consuming algorithms working here),
but I would also like to see PB 4.0 before :wink:

But nice to hear, that my tool works for you!

greetz
Remi

Posted: Mon Aug 08, 2005 10:01 pm
by va!n
remi_meier wrote:First: :oops: Remi
:wink:
remi_meier wrote: A lot of the optimization ideas don't come from me, the forum members
helped a lot! (just look into the Credits.txt)
yes i know. but you have started the big project with the great help of some very talented guys from the comunity!
va!n wrote: ...with remi_meier and maybe other very talented coders on the pure comunity... :wink:
va!n wrote: Fred knows enough about optimizing, he just should implement it!
Yes i agree about the implentation but it would be cool if some very talented people may help fred. ok, i know about much postings that some people contacted fred and only getting an answer "nice stuff. maybe i will implent it" but nothing happens... (sorry fred, i dont want blame you but this is what you can often read in many german/english postings by the comunity :roll:)

so i dont want blame someone and hope fred and his team will keep on their great work (maybe with a better optimized compiler) :wink:

Posted: Tue Aug 09, 2005 12:10 am
by Fred
I've already took a look some month ago to the remi tools and it's a great one, you can use it, no problem. For now we concentrate on the next PureBasic version which an higher priority than all specific optimisations we could add (to have a code a bit faster in real life program).

Posted: Wed Aug 10, 2005 11:42 pm
by Rescator
Hmm! A pre-processor and a (post) optimizer could be seperate,
even 3rd party or open source projects.

Infact, no changes to the compiler is needed.
Just add two configuration options to the IDE.

That way users could spesify a pre-processor,
and a post-processor.

Example: (if user is using both pre and post processing)

1. User hit compile!
2. IDE runs the source thru the pre-processor
3. IDE runs the pre-processed code thru the compiler, which outputs the assembled code.
4. IDE runs the asm code thru the post-processor
5. IDE runs the post-process code thru the compiler again for final execution compiling.

This would allow those with existing tools to use those,
those that do not wish pre or post procerssing to turn it off,
and later official tools (if any) can easily be added.
(by a checmark "Use Default" in the IDE maybe?)

This would also avoid the issue with replacing/renaming the fasm.exe right?

Or am I talking total gibberish here? :)

Hmm! Did I just describe how a 3 pass compiler worked just now? *laughs*

Posted: Thu Aug 11, 2005 12:14 am
by Dare2
Rescator wrote:Just add two configuration options to the IDE.
That is a really good idea!

Re: Improve optimized ASM output !!!

Posted: Thu Aug 11, 2005 12:31 am
by fsw
va!n wrote:On the german forum is one very talented guy named "remi_meier" from switzerland and he showed a lot of speed optimisations and at least he coded a small fantastic tool called "optimizer"! This great tool will check the PureBasic generated ASM output and try to replace some ASM parts by a lot faster and optimized routines!!
A so called "peephole" optimizer?

Have to look at the german forum...

Posted: Thu Aug 11, 2005 4:38 am
by PB
> Infact, no changes to the compiler is needed.
> Just add two configuration options to the IDE.
> That way users could spesify a pre-processor,
> and a post-processor.

I've wanted PureBasic to have something like this for a long time. :)
Basically, it would be great if the compiler could ShellExecute something
before and after compilation. So, for example, pressing F5 to compile
would do something like this:

(1) User selects "Create executable" or presses F5 to compile/run.
(2) Compiler ShellExecutes Option 1, which is a command line in Options.
(3) Compiler then compiles as normal.
(4) After compilation, Compiler ShellExecutes Option 2, which also is a commandline.

If Option 1 or 2 aren't defined, then they are ignored. One immediate
example of this use is for Option 2 to be something like "upx.exe app.exe"
to automatically compress an exe after creation. Option 1 could be any
pre-processor to work on the source before compilation starts. If PureBasic
had these options, it'd be fantastic -- and extremely easy for it to be added! :)

Posted: Thu Aug 11, 2005 11:40 am
by Fred
PB: look at the Beta 5 doc about triggers and external tools ;)

Posted: Thu Aug 11, 2005 12:08 pm
by PB
> PB: look at the Beta 5 doc about triggers and external tools ;)

Ohhhhhhhhhhh... man, this is FANTASTIC! :D

You've just made my day with the editor now... everything that I mentioned
that I missed from jaPBe is now here... markers being saved in the source,
jumping back to the previous line after double-clicking a procedure name,
the status bar highlighting the current procedure parameter, the bug of the
cursor slowing down when up/down arrowing past "Procedure"... it's all good!

Image

Posted: Thu Aug 11, 2005 12:12 pm
by Fred
Glad to hear that :D

Posted: Thu Aug 11, 2005 12:34 pm
by Dare2
This is really potent! Many thanks!

Edit: BTW, that part of the ref manual is looking pretty good as well! Easy to read and full of info. Thanks again.