Tricks of the trade - Optimisation

Dan <none@no.spam> wrote in message news:8usiv0$l28$1@inn.qnx.com

I’d like to, but we do not have QNX4. We started working QNX products
(Neutrino) in February this year. We took a certain amount of risk by
plunging straight into a new OS, but we never looked back. It’s perfect
for
our application.
There will aways be issues to sort out, new drivers to port etc, but full
credit to people at QNX, they’ve started with a great kernel and built it
into a very good platform for real-time apps.

Of course some of us have known this for many years.


I think it’s a little unfair to compare gcc with MS VisualC++ because gcc
is
much more generic compiler. MS target only one class of processors and can
afford using wider range of instructions including the specialised
instructions found in MMX etc.

{

/*
Unfair? Maybe.
But if I am developing for platform X I want to use whatever
runs best on platform X.
*/
platform X = Intel( QNX );
}

Just to add my 0.02$ cdn.

Watcom is in the process of becoming OpenWatcom (free - see the newsgroups
hosted on news.scitechsoft.com) and the maintainers seem to be an eager
bunch. One mentioned that they would like to see a version 11 for QNX4 (but
they can’t do it alone they need QSSL support). I bet they would also be
willing to produce a x86 NTO compiler with some QSSL support.

“Bill at Sierra Design” <BC@SierraDesign.com> wrote in message
news:8uudh8$hac$1@inn.qnx.com

Dan <> none@no.spam> > wrote in message news:8usiv0$l28$> 1@inn.qnx.com> …
I’d like to, but we do not have QNX4. We started working QNX products
(Neutrino) in February this year. We took a certain amount of risk by
plunging straight into a new OS, but we never looked back. It’s perfect
for
our application.
There will aways be issues to sort out, new drivers to port etc, but
full
credit to people at QNX, they’ve started with a great kernel and built
it
into a very good platform for real-time apps.

Of course some of us have known this for many years.


I think it’s a little unfair to compare gcc with MS VisualC++ because
gcc
is
much more generic compiler. MS target only one class of processors and
can
afford using wider range of instructions including the specialised
instructions found in MMX etc.

{

/*
Unfair? Maybe.
But if I am developing for platform X I want to use whatever
runs best on platform X.
*/
platform X = Intel( QNX );
}

I would like to see both QNX4 & Neutrino versions on Watcom V11. My only
commercial products so far are QNX4 products, but all of my future plans are
with Neutrino.

If QNX knows what is good for them, they will do everything possible to
facilitate this. In the past, QNX has made some decisions based on politics
and not on technical issues. (Hell, so does my company!) This is
unfortunate (in both cases). The divorce with Watcom was very messy. But
Watcom isn’t Watcom any more. It’s just a legacy name.

QSSL, please grab the new Watcom compiler by the for() loops and run with
it.


Brown, Richard <brownr@aecl.ca> wrote in message
news:8uui3a$lpp$1@inn.qnx.com

Just to add my 0.02$ cdn.

Watcom is in the process of becoming OpenWatcom (free - see the newsgroups
hosted on news.scitechsoft.com) and the maintainers seem to be an eager
bunch. One mentioned that they would like to see a version 11 for QNX4
(but
they can’t do it alone they need QSSL support). I bet they would also be
willing to produce a x86 NTO compiler with some QSSL support.

Previously, Brown, Richard wrote in comp.os.qnx, qdn.public.porting, qdn.public.qnxrtp.applications, qdn.public.qnxrtp.devtools:

Just to add my 0.02$ cdn.

Watcom is in the process of becoming OpenWatcom (free - see the newsgroups
hosted on news.scitechsoft.com) and the maintainers seem to be an eager
bunch. One mentioned that they would like to see a version 11 for QNX4 (but
they can’t do it alone they need QSSL support). I bet they would also be
willing to produce a x86 NTO compiler with some QSSL support.

Ok, here’s my US$0.02: As of a year ago, both ISI (pSOS) and Accelerated Technology (Nucleus) were using CAD-UL (http://www.cadul.de) compilers for their x86 offerings. Maybe QSSL should check them out? It should just be a matter of calling Germany and saying “Make me a compiler!”, right? :wink:

  • PDM

In article <8uui3a$lpp$1@inn.qnx.com>, Brown, Richard <brownr@aecl.ca> wrote:

Just to add my 0.02$ cdn.

Watcom is in the process of becoming OpenWatcom (free - see the newsgroups
hosted on news.scitechsoft.com) and the maintainers seem to be an eager
bunch. One mentioned that they would like to see a version 11 for QNX4 (but
they can’t do it alone they need QSSL support). I bet they would also be
willing to produce a x86 NTO compiler with some QSSL support.

This keeps being raised, but I doubt if anyone has considered the complexity
of such an undertaking, and whether there are the resources available for
it or a substantial demand for it.

First and foremost, the Watcom compiler itself is unable to generate
ELF objects, while the linker is only capable of producing ELF executables
and can’t deal with ELF libraries, or ELF AR archives, to the best of
my knowledge.

Couple this with the difficulty of dealing with shared objects. Now,
the linker would have to know about dealing with UNIX ELF shared objects
and relocations. In addition, the code generator must be capable of
generating position independent code, including an alteration in the
register allocations available and the calling conventions assumed.

This is a lot of work, and I would be less pessimistic if I believed a
serious undertaking to port to Linux were underway.

Given the above, one has to wonder what driving reason there would be
for doing so, given that C9X is on the way, which would have a major
impact on the demands for the C compiler, the C++ compiler is way
out of date, and floating point, for example, while IEEE754 compliant
isn’t compliant with newer specifications or with the arithmetic
aspects of C9X.

To give you a hint, there are a number of compiler issues that would
negatively impact open source ports to the Watcom compiler. An alarming
amount of code of UNIX origin assumes one or more of the following nasties:

  1. Stack parameter passing is always used, and it’s safe to
    call a fixed argument function with variable numbers of arguments
  2. void returns from non-void functions are okay
  3. Variable argument lists use the pointer model (as opposed to arrays),
    AND
    It’s okay to do an assignment to or from a va_list
  4. Floating point unordered results always return false for any
    binary arithmetic operation
  • This is really nasty to find, giving unpredictable incorrect results

I’ve hit all of these and more too many times to count.

“Bill at Sierra Design” <> BC@SierraDesign.com> > wrote in message
news:8uudh8$hac$> 1@inn.qnx.com> …
Dan <> none@no.spam> > wrote in message news:8usiv0$l28$> 1@inn.qnx.com> …
I’d like to, but we do not have QNX4. We started working QNX products
(Neutrino) in February this year. We took a certain amount of risk by
plunging straight into a new OS, but we never looked back. It’s perfect
for
our application.
There will aways be issues to sort out, new drivers to port etc, but
full
credit to people at QNX, they’ve started with a great kernel and built
it
into a very good platform for real-time apps.

Of course some of us have known this for many years.


I think it’s a little unfair to compare gcc with MS VisualC++ because
gcc
is
much more generic compiler. MS target only one class of processors and
can
afford using wider range of instructions including the specialised
instructions found in MMX etc.

{

/*
Unfair? Maybe.
But if I am developing for platform X I want to use whatever
runs best on platform X.
*/
platform X = Intel( QNX );
}

\

Steve Furr email: furr@qnx.com
QNX Software Systems, Ltd.

I have to add my $0.02 as well… GNU is absolutely awesome in C++ and
template support. I don’t know about the latest version, but the Watcom on
QNX4 was very limited in C++ support.

Markus


“Steve Furr” <furr@qnx.com> wrote in message
news:8uurfm$9c6$1@nntp.qnx.com

In article <8uui3a$lpp$> 1@inn.qnx.com> >, Brown, Richard <> brownr@aecl.ca
wrote:
Just to add my 0.02$ cdn.

Watcom is in the process of becoming OpenWatcom (free - see the
newsgroups
hosted on news.scitechsoft.com) and the maintainers seem to be an eager
bunch. One mentioned that they would like to see a version 11 for QNX4
(but
they can’t do it alone they need QSSL support). I bet they would also be
willing to produce a x86 NTO compiler with some QSSL support.

This keeps being raised, but I doubt if anyone has considered the
complexity
of such an undertaking, and whether there are the resources available for
it or a substantial demand for it.

First and foremost, the Watcom compiler itself is unable to generate
ELF objects, while the linker is only capable of producing ELF executables
and can’t deal with ELF libraries, or ELF AR archives, to the best of
my knowledge.

Couple this with the difficulty of dealing with shared objects. Now,
the linker would have to know about dealing with UNIX ELF shared objects
and relocations. In addition, the code generator must be capable of
generating position independent code, including an alteration in the
register allocations available and the calling conventions assumed.

This is a lot of work, and I would be less pessimistic if I believed a
serious undertaking to port to Linux were underway.

Given the above, one has to wonder what driving reason there would be
for doing so, given that C9X is on the way, which would have a major
impact on the demands for the C compiler, the C++ compiler is way
out of date, and floating point, for example, while IEEE754 compliant
isn’t compliant with newer specifications or with the arithmetic
aspects of C9X.

To give you a hint, there are a number of compiler issues that would
negatively impact open source ports to the Watcom compiler. An alarming
amount of code of UNIX origin assumes one or more of the following
nasties:

  1. Stack parameter passing is always used, and it’s safe to
    call a fixed argument function with variable numbers of arguments
  2. void returns from non-void functions are okay
  3. Variable argument lists use the pointer model (as opposed to arrays),
    AND
    It’s okay to do an assignment to or from a va_list
  4. Floating point unordered results always return false for any
    binary arithmetic operation
  • This is really nasty to find, giving unpredictable incorrect
    results

I’ve hit all of these and more too many times to count.


“Bill at Sierra Design” <> BC@SierraDesign.com> > wrote in message
news:8uudh8$hac$> 1@inn.qnx.com> …
Dan <> none@no.spam> > wrote in message news:8usiv0$l28$> 1@inn.qnx.com> …
I’d like to, but we do not have QNX4. We started working QNX products
(Neutrino) in February this year. We took a certain amount of risk by
plunging straight into a new OS, but we never looked back. It’s
perfect
for
our application.
There will aways be issues to sort out, new drivers to port etc, but
full
credit to people at QNX, they’ve started with a great kernel and
built
it
into a very good platform for real-time apps.

Of course some of us have known this for many years.


I think it’s a little unfair to compare gcc with MS VisualC++ because
gcc
is
much more generic compiler. MS target only one class of processors
and
can
afford using wider range of instructions including the specialised
instructions found in MMX etc.

{

/*
Unfair? Maybe.
But if I am developing for platform X I want to use whatever
runs best on platform X.
*/
platform X = Intel( QNX );
}





\


Steve Furr email: > furr@qnx.com
QNX Software Systems, Ltd.

V 10.6 - yes
V 11.0 - no

Markus Loffler <loffler@ces.clemson.edu> wrote in message
news:8uus5a$1qs$1@inn.qnx.com

I have to add my $0.02 as well… GNU is absolutely awesome in C++ and
template support. I don’t know about the latest version, but the Watcom on
QNX4 was very limited in C++ support.

Markus

Mario Charest wrote:

“Armin Steinhoff” <A-Steinhoff@web_.de> wrote in message
news:3A12734A.34B5D851@web_.de…


Mario Charest wrote:

[ clip … ]
I agree that it maybe unfair, but it’s a fact, then end result is there.
Compiler on QRTP will generate slower code at the expense of supporting
multiple
architechure.

I wonder wether the performance issues are realy
related to the generated code or to the maturity
and performance of the QNX6 system libraries.


What I can tell you is that the code I’v seen didn’t
even use libraries call, it was all data crushing.
GCC was 10-20% behind VC++ on the same machine.

I would be extremely suprise (but i guess it’s possible)
that the 10-20% comes from the operating system
overhead.

I got the surprise … David wrote in the tread
‘Performance of GCC’:

Linux and Neutrino versions was compiled with GCC and flag -O3.

QNX version was compiled with Watcom. Then I run simple script to compare
execution time of two python command.
The result for the 3 cases shows execution time in seconds.

Linux, Suse 6.4:
1.86 - map with lambda
3.22 - new syntax

[ clip .. ]

Neutrino:
2.43 - map with lambda
200.05 - new syntax

So we have the same machine and the same
application … differenct
are just the linked libraries.

My conclusion: there must something deadly wrong
with the QNX6 libraries!

Armin

In comp.os.qnx Armin Steinhoff <A-Steinhoff@web_.de> wrote:

Neutrino:
2.43 - map with lambda
200.05 - new syntax

So we have the same machine and the same
application … differenct
are just the linked libraries.

My conclusion: there must something deadly wrong
with the QNX6 libraries!

That is possible. However, it is also true that Python makes a HUGE
assumption about how memory is allocated in the system and that realloc()ing
a single element @ a time is “okay”. Sometimes the system specific libs
will try to cover up brain-dead programing like this, sometimes they
will not. Python should be fixed. Allocating and free()ing memory is
should be used sparingly - I just consider that good software design.

chris

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Chris McKillop wrote:

In comp.os.qnx Armin Steinhoff <A-Steinhoff@web_.de> wrote:
Neutrino:
2.43 - map with lambda
200.05 - new syntax

So we have the same machine and the same
application … differenct
are just the linked libraries.

My conclusion: there must something deadly wrong
with the QNX6 libraries!


That is possible.

In that case I would say it is obvious.

However, it is also true that Python makes a HUGE
assumption about how memory is allocated in the system and that realloc()ing
a single element @ a time is “okay”.

That was also my first thought … but the same
code works fine with QNX4.25.

QNX 4.25:
1.87 - map with lambda
2.52 - new syntax

I can only confirm these results. The QNX4 version
of Python was linked with the
malloc lib from QSSL … so the different ‘malloc’
strategies seems not to be the
point. (At least with QNX4 … )

Sometimes the system specific libs
will try to cover up brain-dead programing like this, sometimes they
will not.

The point is that this ‘brain-dead programing’ is
well supported by the libs of QNX4 and LINUX.

Python should be fixed.

With some respect to the human logic … there is
nothing to fix in Python as the results of QNX4
and LINUX are showing. QSSL should look deeply
into the details in order to fix the problems of
the QNX6 libraries!

IMHO … there is also no remarkable differences
of performance visible between GCC and Watcom.
Compare the LINUX/QNX4 results …

Linux, Suse 6.4/GCC:
1.86 - map with lambda
3.22 - new syntax

QNX 4.25/Watcom:
1.87 - map with lambda
2.52 - new syntax

Allocating and free()ing memory is
should be used sparingly - I just consider that good software design.

The QNX4 results are showing that this is not the
issue.

Armin