Compiler Optimization

Author: semorri_ Sep 27, 2004 1:18 PM
One "feature" of the Java compiler is the lack of optimization. For example, this code:
int x = 10;
int y = 20;
int z = x + y;
compiles into bytecodes that execute literally, meaning 10 is pushed on the stack, stored in local var 0, etc. A good C compiler would optimize this code (assuming x and y are not used elsewhere in the method) to simply store 30 in local var z.
I have been told that the compiler does not optimize such code because then the JIT compiler can most efficiently optimize depending on the hardware platform.
My question is: is there a way to get the standard compiler to do a more efficient job of optimizing the bytecodes? Are there compilers out there that will?

Don't you just hate it when people assume that a
simplified example to illustrate a point is taken
directly from actual code?Please point to where anyone says the example appears to be taken from actual code...
Anyway, that is beside the point and does not change the fact that your post seems to imply that the compiler ought to compensate for poor design / coding skills
(because you failed to tell us why you wanted "full" optimization).
I have been told that the compiler does not optimize
such code because then the JIT compiler can most
efficiently optimize depending on the hardware
platform.The JIT compiler might very well become bloatware if it had to cater for every imaginable bytecode sequence.
It is quite possible that "hand optimized" bytecode would leave the JIT compiler clueless.
Unless you planned to run with the JIT compiler disabled (for whatever reason) this is not going to help performance.
If you plan to make a hardware implementation, similar considerations to those that apply to the JIT compiler will most likely apply to your pipeline prediction logic.
My question is: is there a way to get the standard
compiler to do a more efficient job of optimizing the
bytecodes? Are there compilers out there that will?There are other Java compilers. There are also Java bytecode assemblers. Google is your friend.
It is possible that you could get ideas from C optimizer logic and implement post-processing of class files (or pre-processing of bytecode).

Similar Messages

  • In-Place Element Structures, References and Pointers, Compiler Optimization, and General Stupidity

    [The title of this forum is "Labview Ideas". Although this is NOT a direct suggestion for a change or addition to Labview, it seems appropriate to me to post it in this forum.]
    In-Place Element Structures, References and Pointers, Compiler Optimization, and General Stupidity
    I'd like to see NI actually start a round-table discussion about VI references, Data Value references, local variables, compiler optimizations, etc. I'm a C programmer; I'm used to pointers. They are simple, functional, and well defined. If you know the data type of an object and have a pointer to it, you have the object. I am used to compilers that optimize without the user having to go to weird lengths to arrange it. 
    The 'reference' you get when you right click and "Create Reference" on a control or indicator seems to be merely a shorthand read/write version of the Value property that can't be wired into a flow-of-control (like the error wire) and so causes synchronization issues and race conditions. I try not to use local variables.
    I use references a lot like C pointers; I pass items to SubVIs using references. But the use of references (as compared to C pointers) is really limited, and the implementation is insconsistent, not factorial in capabilites, and buggy. For instance, why can you pass an array by reference and NOT be able to determine the size of the array EXCEPT by dereferencing it and using the "Size Array" VI? I can even get references for all array elements; but I don't know how many there are...! Since arrays are represented internally in Labview as handles, and consist of basically a C-style pointer to the data, and array sizing information, why is the array handle opaque? Why doesn't the reference include operators to look at the referenced handle without instantiating a copy of the array? Why isn't there a "Size Array From Reference" VI in the library that doesn't instantiate a copy of the array locally, but just looks at the array handle?
    Data Value references seem to have been invented solely for the "In-Place Element Structure". Having to write the code to obtain the Data Value Reference before using the In-Place Element Structure simply points out how different a Labview reference is from a C pointer. The Labview help page for Data Value References simply says "Creates a reference to data that you can use to transfer and access the data in a serialized way.".  I've had programmers ask me if this means that the data must be accessed sequentially (serially)...!!!  What exactly does that mean? For those of use who can read between the lines, it means that Labview obtains a semaphore protecting the data references so that only one thread can modify it at a time. Is that the only reason for Data Value References? To provide something that implements the semaphore???
    The In-Place Element Structure talks about minimizing copying of data and compiler optimization. Those kind of optimizations are built in to the compiler in virtually every other language... with no special 'construct' needing to be placed around the code to identify that it can be performed without a local copy. Are you telling me that the Labview compiler is so stupid that it can't identify certain code threads as needing to be single-threaded when optimizing? That the USER has to wrap the code in semaphores before the compiler can figure out it should optimize??? That the compiler cannot implement single threading of parts of the user's code to improve execution efficiency?
    Instead of depending on the user base to send in suggestions one-at-a-time it would be nice if NI would actually host discussions aimed at coming up with a coherent and comprehensive way to handle pointers/references/optimization etc. One of the reasons Labview is so scattered is because individual ideas are evaluated and included without any group discussion about the total environment. How about a MODERATED group, available by invitation only (based on NI interactions with users in person, via support, and on the web) to try and get discussions about Labview evolution going?
    Based solely on the number of Labview bugs I've encountered and reported, I'd guess this has never been done, with the user community, or within NI itself.....

    Here are some articles that can help provide some insights into LabVIEW programming and the LabVIEW compiler. They are both interesting and recommended reading for all intermediate-to-advanced LabVIEW programmers.
    NI LabVIEW Compiler: Under the Hood
    VI Memory Usage
    The second article is a little out-of-date, as it doesn't discuss some of the newer technologies available such as the In-Place Element Structure you were referring to. However, many of the general concepts still apply. Some general notes from your post:
    1. I think part of your confusion is that you are trying to use control references and local variables like you would use variables in a C program. This is not a good analogy. Control references are references to user interface controls, and should almost always be used to control the behavior and appearance of those controls, not to store or transmit data like a pointer. LabVIEW is a dataflow language. Data is intended to be stored or transmitted through wires in most cases, not in references. It is admittedly difficult to make this transition for some text-based programmers. Programming efficiently in LabVIEW sometimes requires a different mindset.
    2. The LabVIEW compiler, while by no means perfect, is a complicated, feature-rich set of machinery that includes a large and growing set of optimizations. Many of these are described in the first link I posted. This includes optimizations you'd find in many programming environments, such as dead code elimination, inlining, and constant folding. One optimization in particular is called inplaceness, which is where LabVIEW determines when buffers can be reused. Contrary to your statement, the In-Place Element Structure is not always required for this optimization to take place. There are many circumstances (dating back years before the IPE structure) where LabVIEW can determine inplaceness and reuse buffers. The IPE structure simply helps users enforce inplaceness in some situations where it's not clear enough on the diagram for the LabVIEW compiler to make that determination.
    The more you learn about programming in LabVIEW, the more you realize that inplaceness itself is the closest analogy to pointers in C, not control references or data references or other such things. Those features have their place, but core, fundamental LabVIEW programming does not require them.
    Jarrod S.
    National Instruments

  • Intel Core Duo 1.83GHz compiler optimization / makefile help

    Hi,
    I have a C listing which was originally written with unix or Windows in mind, I wonder if anyone could help me to compile it on my Intel iMac 17inch. It's a small benchmarking program so compiler optimization is important - is this possible on an Intel Core Duo (I don't expect to include threading) using XCode or gcc?
    I'm not a programmer, the original programmer does not know anything about Macs or OS X, however I would like to use this program to effectively benchmark my machine. Currently the program will not compile using the makefile I have, I can run code compiled on a G4 but it runs slow and gives a false result.
    Here's my makefile:
    obj = c-ray-f.o
    bin = c-ray-f
    CC = gcc
    CFLAGS = -O3 -ffast-math
    $(bin): $(obj)
    $(CC) -o $@ $(obj) -lm
    .PHONY: clean
    clean:
    rm -f $(obj) $(bin)
    I do not really understand what any of that lot does, nor can I get my head around compiler options (I tried looking, but found nothing that made any sense to me!)
    Any help would really really be appreciated!

    Change all the -
    #include <GL/glut.h>
    to
    #include <GLUT/glut.h>
    and
    if ( (!((*x)>=min)) || _isnan(*x) ) { // Other compilers may use "isnan" instead of "_isnan"
    to
    if ( (!((*x)>=min)) || isnan(*x) ) { // Other compilers may use "isnan" instead of "_isnan"
    Then run this script in directory RayTraceKd to build RayTraceKd -
    [dranta:~/RayTrace/RayTrace_3.2/RayTraceKd] dir% cat build
    cd ../VrMath
    g++ -O2 -fpermissive -c *.cpp
    cd ../DataStructs
    g++ -O2 -fpermissive -c *.cpp
    cd ../Graphics
    g++ -O2 -fpermissive -c *.cpp
    cd ../OpenglRender
    g++ -O2 -fpermissive -c *.cpp
    cd ../RaytraceMgr
    g++ -O2 -fpermissive -c *.cpp
    cd ../RayTraceKd
    g++ -O2 -fpermissive -c *.cpp
    g++ -o RayTraceKd -bindatload -framework GLUT -fpermissive *.o ../VrMath/*.o ../DataStructs/*.o ../Graphics/*.o ../OpenglRender/*.o ../RaytraceMgr/*.o -L/usr/X11R6/lib -lgl -lglu

  • Compiler optimization in C++ much worse than in C on x86

    Hello everybody!
    I noticed something really ugly.
    If you have a small code fragment like this:
    #define MATRIX_SIZE 1000
    int Mat_x_Mat_transposed_C( double **c, double **a, double **b ) {
      int i, j, k;
      memset( *c, 0, MATRIX_SIZE*MATRIX_SIZE*sizeof(double) );
      for( i=0; i<MATRIX_SIZE; i++ )
        for( j=0; j<MATRIX_SIZE; j++ )
          for( k=0; k<MATRIX_SIZE; k++ )
            c[i][j]   += a[i][k] * b[j][k];
      return 0;
    }and compile it under CC and cc, you get completely different execution times!!!
    Using for both tests:
    CC -fast
    cc -fast
    you get for the innermost loop from the C compiler:
            movsd      (%ebx),%xmm1                         ;/ line : 138
            mulsd      (%edx),%xmm1                         ;/ line : 138
            addsd      %xmm1,%xmm0                          ;/ line : 138
            movsd      %xmm0,(%esi)                         ;/ line : 138
            movsd      8(%ebx),%xmm1                                ;/ line : 138
            mulsd      8(%edx),%xmm1                                ;/ line : 138
            addsd      %xmm1,%xmm0                          ;/ line : 138
            movsd      %xmm0,(%esi)                         ;/ line : 138
            movsd      16(%ebx),%xmm1                               ;/ line : 138
            mulsd      16(%edx),%xmm1                               ;/ line : 138
            addsd      %xmm1,%xmm0                          ;/ line : 138
            movsd      %xmm0,(%esi)                         ;/ line : 138
            movsd      24(%ebx),%xmm1                               ;/ line : 138
            mulsd      24(%edx),%xmm1                               ;/ line : 138
            addsd      %xmm1,%xmm0                          ;/ line : 138
            movsd      %xmm0,(%esi)                         ;/ line : 138
            movsd      32(%ebx),%xmm1                               ;/ line : 138
            mulsd      32(%edx),%xmm1                               ;/ line : 138
            addsd      %xmm1,%xmm0                          ;/ line : 138
            movsd      %xmm0,(%esi)                         ;/ line : 138
            movsd      40(%ebx),%xmm1                               ;/ line : 138
            mulsd      40(%edx),%xmm1                               ;/ line : 138
            addsd      %xmm1,%xmm0                          ;/ line : 138
            movsd      %xmm0,(%esi)                         ;/ line : 138
            addl       $48,%ebx                             ;/ line : 137
            addl       $48,%edx                             ;/ line : 137
            addl       $6,%eax                              ;/ line : 137
    .LU24.444:
            cmpl       $994,%eax                            ;/ line : 137
            jle        .CG28.52                             ;/ line : 137which is quite nice in loop unrolling and eliminating all references to local variables, no references to
    %ebp etc.
    (safing %xmm0 every time is another thing, but g++ is doing this also ;)
    If you use C++ you get something like this:
            movl       -28(%ebp),%eax                               ;/ line : 110
            movl       (%eax),%eax                          ;/ line : 110
            addl       %ebx,%eax                            ;/ line : 110
            movl       (%edx),%edi                          ;/ line : 110
            movsd      (%edi,%esi),%xmm0                            ;/ line : 110
            movl       (%ecx),%edi                          ;/ line : 110
            mulsd      (%edi,%esi),%xmm0                            ;/ line : 110
            addsd      (%eax),%xmm0                         ;/ line : 110
            movsd      %xmm0,(%eax)                         ;/ line : 110
            movl       -28(%ebp),%eax                               ;/ line : 110
            movl       (%eax),%eax                          ;/ line : 110
            addl       %ebx,%eax                            ;/ line : 110
            movl       (%edx),%edi                          ;/ line : 110
            movsd      8(%edi,%esi),%xmm0                           ;/ line : 110
            movl       (%ecx),%edi                          ;/ line : 110
            mulsd      8(%edi,%esi),%xmm0                           ;/ line : 110
            addsd      (%eax),%xmm0                         ;/ line : 110
            movsd      %xmm0,(%eax)                         ;/ line : 110
            movl       -28(%ebp),%eax                               ;/ line : 110
            movl       (%eax),%eax                          ;/ line : 110
            addl       %ebx,%eax                            ;/ line : 110
            movl       (%edx),%edi                          ;/ line : 110
            movsd      16(%edi,%esi),%xmm0                          ;/ line : 110
            movl       (%ecx),%edi                          ;/ line : 110
            mulsd      16(%edi,%esi),%xmm0                          ;/ line : 110
            addsd      (%eax),%xmm0                         ;/ line : 110
            movsd      %xmm0,(%eax)                         ;/ line : 110
            movl       -28(%ebp),%eax                               ;/ line : 110
            movl       (%eax),%eax                          ;/ line : 110
            addl       %ebx,%eax                            ;/ line : 110
            movl       (%edx),%edi                          ;/ line : 110
            movsd      24(%edi,%esi),%xmm0                          ;/ line : 110
            movl       (%ecx),%edi                          ;/ line : 110
            mulsd      24(%edi,%esi),%xmm0                          ;/ line : 110
            addsd      (%eax),%xmm0                         ;/ line : 110
            movsd      %xmm0,(%eax)                         ;/ line : 110
            movl       -28(%ebp),%eax                               ;/ line : 110
            movl       (%eax),%eax                          ;/ line : 110
            addl       %ebx,%eax                            ;/ line : 110
            movl       (%edx),%edi                          ;/ line : 110
            movsd      32(%edi,%esi),%xmm0                          ;/ line : 110
            movl       (%ecx),%edi                          ;/ line : 110
            mulsd      32(%edi,%esi),%xmm0                          ;/ line : 110
            addsd      (%eax),%xmm0                         ;/ line : 110
            movsd      %xmm0,(%eax)                         ;/ line : 110
            movl       -28(%ebp),%eax                               ;/ line : 110
            movl       (%eax),%eax                          ;/ line : 110
            addl       %ebx,%eax                            ;/ line : 110
            movl       (%edx),%edi                          ;/ line : 110
            movsd      40(%edi,%esi),%xmm0                          ;/ line : 110
            movl       (%ecx),%edi                          ;/ line : 110
            mulsd      40(%edi,%esi),%xmm0                          ;/ line : 110
            addsd      (%eax),%xmm0                         ;/ line : 110
            movsd      %xmm0,(%eax)                         ;/ line : 110
            addl       $48,%esi                             ;/ line : 110
            movl       -32(%ebp),%eax                               ;/ line : 110
            addl       $6,%eax                              ;/ line : 110
            movl       %eax,-32(%ebp)
    .LU4.715:
            cmpl       $994,%eax                            ;/ line : 110
            jle        .CG44.86                             ;/ line : 110Here all references are still using %ebp and there are lots of memory accesses
    to local variables in the innermost loop!
    The examples were generated using the DevPreview 01/08:
    CC: Sun C++ 5.9 SunOS_i386 2007/11/15
    cc: Sun C 5.9 SunOS_i386 2007/11/15
    Is there a way to raise the optimization level in C++ to get something comparable to the C output?
    Cheers,
    bugchucker

    Ah, yes, I think I can see your problem....
    It does not depend on either the compiler flags or the platform (as long as it can use sse2).
    I tried it on P4 and opteron.
    For the compiler flags: My favourite there is
    -fast -xtarget=opteron -m64 -xdepend -xprefetch=auto -xprefetch_level=3 -xprefetch_auto_type=indirect_array_access -xvector=lib,simd -xalias_level=simple -xrestrict=%all -g0 -xpagesize=2M
    but it does not matter in this case. You get the same with -fast.
    But first, here is the example code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <string.h>
    #include <time.h>
    #define MATRIX_SIZE 1000
    double** NewMatrix(int r, int c)
    { int i;
      double **p;
      long int mem;
      mem = (long int) r * (long int) c;
      p    = (double**)malloc(r*sizeof(double*));
      p[0] = (double*)calloc(mem, sizeof(double));
      for (i=1;i<r;i++)
        p= p[i-1] + c;
    return p;
    int DelMatrix(double** p)
    if (p!=0){
    free(p[0]);
    free(p);
    return 0;
    int InitMatrix(double **a)
    memset( a, 0, MATRIX_SIZEMATRIX_SIZE*sizeof(double) );
    return 0;
    int CopyMatrix(double **d, double **s)
    memcpy( d, s, MATRIX_SIZE*MATRIX_SIZE*sizeof(double) );
    return 0;
    int RandomizeMatrix(double **a) {
    int i, j;
    for( i=0; i<MATRIX_SIZE; i++ )
    for( j=0; j<MATRIX_SIZE; j++ )
    a[i][j] = 100.0 * random()/RAND_MAX;
    return 0;
    int Mat_x_Mat_transposed( double **c, double **a, double **b ) {
    int i, j, k;
    InitMatrix( c );
    for( i=0; i<MATRIX_SIZE; i++ )
    for( j=0; j<MATRIX_SIZE; j++ )
    for( k=0; k<MATRIX_SIZE; k++ )
    c[i][j] += a[i][k] * b[j][k];
    return 0;
    int main() {
    clock_t t0, t1;
    double t;
    double **a, **b, **c;
    printf("Initializing Matrices...\n");
    t0 = clock();
    a = NewMatrix( MATRIX_SIZE, MATRIX_SIZE);
    b = NewMatrix( MATRIX_SIZE, MATRIX_SIZE);
    c = NewMatrix( MATRIX_SIZE, MATRIX_SIZE);
    t1 = clock();
    t = (double)( t1 - t0 ) / CLOCKS_PER_SEC;
    printf("Time for setup/s: %lf\n", t/3.0);
    RandomizeMatrix( a );
    RandomizeMatrix( b );
    printf("Starting Multiplication transposed... ( %i x %i )\n", MATRIX_SIZE, MATRIX_SIZE );
    t0 = clock();
    Mat_x_Mat_transposed( c, a, b );
    t1 = clock();
    t = (double)( t1 - t0 ) / CLOCKS_PER_SEC;
    printf("Time difference: %lf\n", t );
    And now comes the strange stuff:
    When I try this one with cc and CC the timings are ok!
    BUT: If you generate the output via CC -fast -S
    you will see, that the CC compiler generates the code for the function as I have shown
    above, BUT *inlines* the fast version as in C !!!
    It looks like this:__1cUMat_x_Mat_transposed6Fppd11_i_:
         push %ebp                    ;/ line : 70
         movl %esp,%ebp                    ;/ line : 70
         push %ebx                    ;/ line : 70
         push %esi                    ;/ line : 70
         push %edi                    ;/ line : 70
         subl $44,%esp                    ;/ line : 70
    .CG15.33:
         movl 8(%ebp),%eax                    ;/ line : 41
         movl (%eax),%eax                    ;/ line : 41
         push $8000000                    ;/ line : 41
         push $0                    ;/ line : 41
         push %eax                    ;/ line : 41
         call _memset                    ;/ line : 41
         addl $12,%esp                    ;/ line : 41
         movl 8(%ebp),%eax                    ;/ line : 77
         movl %eax,-28(%ebp)                    ;/ line : 77
         movl 12(%ebp),%edx                    ;/ line : 77
         xorl %eax,%eax                    ;/ line : 78
         movl 16(%ebp),%ecx                    ;/ line : 78
         movl %ecx,-44(%ebp)
         movl %eax,-40(%ebp)
    .CG16.34:
         xorl %eax,%eax                    ;/ line : 80
         movl -44(%ebp),%ecx                    ;/ line : 80
         xorl %ebx,%ebx                    ;/ line : 80
         movl %eax,-36(%ebp)
    .CG17.35:
    .CG2.266:
         xorl %esi,%esi                    ;/ line : 80
         xorl %eax,%eax                    ;/ line : 80
         movl %esi,-32(%ebp)
         movl %eax,%esi
    .CG1A.38:
         movl -28(%ebp),%eax                    ;/ line : 80
         movl (%eax),%eax                    ;/ line : 80
         addl %ebx,%eax                    ;/ line : 80
         movl (%edx),%edi                    ;/ line : 80
         movsd (%edi,%esi),%xmm0                    ;/ line : 80
         movl (%ecx),%edi                    ;/ line : 80
         mulsd (%edi,%esi),%xmm0                    ;/ line : 80
         addsd (%eax),%xmm0                    ;/ line : 80
         movsd %xmm0,(%eax)                    ;/ line : 80
         movl -28(%ebp),%eax                    ;/ line : 80
         movl (%eax),%eax                    ;/ line : 80
         addl %ebx,%eax                    ;/ line : 80
         movl (%edx),%edi                    ;/ line : 80
         movsd 8(%edi,%esi),%xmm0                    ;/ line : 80
         movl (%ecx),%edi                    ;/ line : 80
         mulsd 8(%edi,%esi),%xmm0                    ;/ line : 80
         addsd (%eax),%xmm0                    ;/ line : 80
         movsd %xmm0,(%eax)                    ;/ line : 80
         movl -28(%ebp),%eax                    ;/ line : 80
         movl (%eax),%eax                    ;/ line : 80
         addl %ebx,%eax                    ;/ line : 80
         movl (%edx),%edi                    ;/ line : 80
         movsd 16(%edi,%esi),%xmm0                    ;/ line : 80
         movl (%ecx),%edi                    ;/ line : 80
         mulsd 16(%edi,%esi),%xmm0                    ;/ line : 80
         addsd (%eax),%xmm0                    ;/ line : 80
         movsd %xmm0,(%eax)                    ;/ line : 80
         movl -28(%ebp),%eax                    ;/ line : 80
         movl (%eax),%eax                    ;/ line : 80
         addl %ebx,%eax                    ;/ line : 80
         movl (%edx),%edi                    ;/ line : 80
         movsd 24(%edi,%esi),%xmm0                    ;/ line : 80
         movl (%ecx),%edi                    ;/ line : 80
         mulsd 24(%edi,%esi),%xmm0                    ;/ line : 80
         addsd (%eax),%xmm0                    ;/ line : 80
         movsd %xmm0,(%eax)                    ;/ line : 80
         movl -28(%ebp),%eax                    ;/ line : 80
         movl (%eax),%eax                    ;/ line : 80
         addl %ebx,%eax                    ;/ line : 80
         movl (%edx),%edi                    ;/ line : 80
         movsd 32(%edi,%esi),%xmm0                    ;/ line : 80
         movl (%ecx),%edi                    ;/ line : 80
         mulsd 32(%edi,%esi),%xmm0                    ;/ line : 80
         addsd (%eax),%xmm0                    ;/ line : 80
         movsd %xmm0,(%eax)                    ;/ line : 80
         movl -28(%ebp),%eax                    ;/ line : 80
         movl (%eax),%eax                    ;/ line : 80
         addl %ebx,%eax                    ;/ line : 80
         movl (%edx),%edi                    ;/ line : 80
         movsd 40(%edi,%esi),%xmm0                    ;/ line : 80
         movl (%ecx),%edi                    ;/ line : 80
         mulsd 40(%edi,%esi),%xmm0                    ;/ line : 80
         addsd (%eax),%xmm0                    ;/ line : 80
         movsd %xmm0,(%eax)                    ;/ line : 80
         addl $48,%esi                    ;/ line : 80
         movl -32(%ebp),%eax                    ;/ line : 80
         addl $6,%eax                    ;/ line : 80
         movl %eax,-32(%ebp)
    .LU19.271:
         cmpl $994,%eax                    ;/ line : 80
         jle .CG1A.38                    ;/ line : 80
    but the code acually executed in main() is:.CG2B.55:
         movsd (%edi),%xmm1                    ;/ line : 80
         mulsd (%ebx),%xmm1                    ;/ line : 80
         addsd %xmm1,%xmm0                    ;/ line : 80
         movsd 8(%edi),%xmm1                    ;/ line : 80
         mulsd 8(%ebx),%xmm1                    ;/ line : 80
         addsd %xmm1,%xmm0                    ;/ line : 80
         movsd 16(%edi),%xmm1                    ;/ line : 80
         mulsd 16(%ebx),%xmm1                    ;/ line : 80
         addsd %xmm1,%xmm0                    ;/ line : 80
         movsd 24(%edi),%xmm1                    ;/ line : 80
         mulsd 24(%ebx),%xmm1                    ;/ line : 80
         addsd %xmm1,%xmm0                    ;/ line : 80
         movsd 32(%edi),%xmm1                    ;/ line : 80
         mulsd 32(%ebx),%xmm1                    ;/ line : 80
         addsd %xmm1,%xmm0                    ;/ line : 80
         movsd 40(%edi),%xmm1                    ;/ line : 80
         mulsd 40(%ebx),%xmm1                    ;/ line : 80
         addsd %xmm1,%xmm0                    ;/ line : 80
         movsd %xmm0,(%ecx)                    ;/ line : 80
         addl $48,%edi                    ;/ line : 80
         addl $48,%ebx                    ;/ line : 80
         addl $6,%esi                    ;/ line : 80
    .LU65.419:
         cmpl $994,%esi                    ;/ line : 80
         jle .CG2B.55                    ;/ line : 80
    in the body of main().
    But believe me, if your program gets larger, the function code is as shown
    in the function body, not the fast version implemented here in main()
    That is why I got interested in this in the first place, because the timings
    were so bad!
    In contrast to this, the cc compiler generates also for the function code the fast version.
    Uh, by the way, why are only two sse registers used?
    bugchucker                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Compiler optimization for CPU familes

    Fortunately or unfortunately, we have various CPU families used in the build, test, and production families. They include UltraSparc II's, UltraSparc III's, and UltraSparc IV+'s.
    In this scenario, can I use -fast option for optimization of my sources? If not, which would be the best options that I can go for it?
    I appreciate your efforts in advance...
    -Saravanan Kannan

    The -fast option generates code tor the exact processor that runs the compilation. The resulting code might not run on an earlier processor, and in might not run as well on other processors compared to just using the generat -xO4 flag.
    The combination
    -xO4 -xarch=v8plusa -xtarget=ultra3
    will generate well-optimized code that runs best on Ultra III, but will also run on Ultra II and IV.
    It would be a good idea to build with and without the -xtarget option, and compare performance on all systems. You cannot predict in advance whether overall performance across systems will be better with or without the option.
    You should also experiment with -xO5. It often gives better performance, but leads to larger code size. Sometimes the larger code size results in more paging at run time, destroying the benefits of micro-optimization.
    See also this forum article:
    http://forum.sun.com/jive/thread.jspa?threadID=108492

  • Private / final / compiler optimization

    i have read that:
    defining methods / properties to be final helps that compiler to optimize performance.
    however:
    it does not make logical sense to declare private or protected methods as final .
    and so the compiler ignores it, right?

    kappa9h wrote:
    i have read that:
    defining methods / properties to be final helps that compiler to optimize performance.by properties, if you're talking about getter / setter methods that's one thing. If you're just talking about member/class data structures, then definitely not. Even in the first case, I do see why that would result in any performance gain.
    Long and the short of this is that you should use final when you don't want the method / class to be overridden. Performance gains from making a method final are going to be minimal or zero
    >
    however:
    it does not make logical sense to declare private or protected methods as final .
    and so the compiler ignores it, right?

  • Is it possible to disable the optimized compiler in LabVIEW 2010

    Hello,
    I have a project that take 3 minutes in LabVIEW 8.6 to build and now with LabVIEW 2010 it take 10.5 minutes. 3x more longer.
    In fact my project as 61 .lvproj for a total of 4300 vi's that take 1 hour to build. If I interpolate, the entire build process will take 3 hours in LabVIEW 2010. This is not acceptable
    I know that the new compiler optimize the code for better performance, but if I don't need better performance.
    Is it possible to disable the optimized compiler in LabVIEW 2010 with an INI key in LabVIEW.ini.
    Dany Allard
    Dany Allard
    Solved!
    Go to Solution.

    Jarrod S. wrote:
    One Application Builder setting you might try out to make builds go much more quickly is the Remove Unused Members of Project Libraries checkbox and the Modify Project Library File after Removi....
    This can drastically cut down the build times. Note, however, that this option does not work well if your application will load external plug-in VIs when it runs, because the libraries of those plug-in VIs may conflict with the modified libraries in the executable file. If you don't have a plug-in architecture, this will not affect you.
    The "Remove unused members of project libraries" was already selected but not the "Modify project library file after removing unused members" and selecting this cut the build time from 10.5 min to 4 min.
    Thank you Jarrod for this tips
    Dany
    Dany Allard

  • Kernel26-icc compiled with Intel's compiler instead of gcc

    I'm working on kernel26-icc, it's the kernel26 but compiled with Intel's compiler. Can't seem to upload it to AUR ("Invalid name: only lowercase letters are allowed.")
    http://www.linuxdna.com/
    So far I've this:
    PKGBUILD
    # Maintainer: Mathias Burén <[email protected]>
    pkgname=('kernel26-icc' 'kernel26-icc-firmware' 'kernel26-icc-headers') # Build icc kernel
    _kernelname=${pkgname#kernel26-icc}
    _basekernel=2.6.33
    pkgver=${_basekernel}
    pkgrel=1
    arch=(x86_64)
    license=('GPL2')
    url="http://www.linuxdna.com/"
    source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
    # the main kernel config files
    config.x86_64
    # standard config files for mkinitcpio ramdisk
    kernel26-icc.preset
    http://www.linuxdna.com/dna-2.6.33-intel64.patch)
    makedepends=('icc')
    md5sums=('c3883760b18d50e8d78819c54d579b00'
    '5c91374d56f115ba4324978d5b002711'
    'a4fd3c59751194bc118c70d1348436ab'
    'a307beb562eb7e68a6f3e2fb5fc216a3')
    build() {
    cd ${srcdir}/linux-$_basekernel
    cat ../config.x86_64 >./.config
    patch -p1 < ../dna-2.6.33-intel64.patch || return 1
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    fi
    # get kernel version
    make prepare
    # load configuration
    # Configure the kernel. Replace the line below with one of your choice.
    make menuconfig # CLI menu for configuration
    #make xconfig # X-based configuration
    #make oldconfig # using old config from previous kernel version
    # ... or manually edit .config
    # stop here
    # this is useful to configure the kernel
    #msg "Stopping build"
    #return 1
    yes "" | make config
    # build!
    make bzImage modules || return 1
    package_kernel26-icc() {
    pkgdesc="The Linux Kernel and modules built with ICC"
    backup=(etc/mkinitcpio.d/${pkgname}.preset)
    depends=('coreutils' 'kernel26-icc-firmware>=2.6.33' 'module-init-tools' 'mkinitcpio>=0.5.20')
    install=kernel26-icc.install
    optdepends=('crda: to set the correct wireless channels of your country')
    KARCH=x86
    cd ${srcdir}/linux-$_basekernel
    # get kernel version
    _kernver="$(make kernelrelease)"
    mkdir -p ${pkgdir}/{lib/modules,boot}
    make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
    cp System.map ${pkgdir}/boot/System.map26${_kernelname}
    cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
    # # add vmlinux
    install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
    # install fallback mkinitcpio.conf file and preset file for kernel
    install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
    # set correct depmod command for install
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
    -i $startdir/kernel26.install
    sed \
    -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
    -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
    -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
    echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
    # remove build and source links
    rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf ${pkgdir}/lib/firmware
    package_kernel26-icc-headers() {
    pkgdesc="Header files and scripts for building modules for kernel26-icc"
    mkdir -p ${pkgdir}/lib/modules/${_kernver}
    cd ${pkgdir}/lib/modules/${_kernver}
    ln -sf ../../../usr/src/linux-${_kernver} build
    cd ${srcdir}/linux-$_basekernel
    install -D -m644 Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Makefile
    install -D -m644 kernel/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
    install -D -m644 .config \
    ${pkgdir}/usr/src/linux-${_kernver}/.config
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
    for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
    cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
    done
    # copy arch includes for external modules
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
    cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
    cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
    # fix permissions on scripts dir
    chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
    cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    if [ "$CARCH" = "i686" ]; then
    cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    fi
    cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
    # add headers for lirc package
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
    cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
    for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    done
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
    # add dm headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    # add inotify.h
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
    cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
    # add wireless headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
    cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/11194
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    # add xfs and shmem for aufs building
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
    cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
    # add headers vor virtualbox
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
    # add headers for broadcom wl
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
    done
    cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
    # add header for aufs2-util
    cp -a ${srcdir}/linux-$_basekernel/include/asm-generic/bitsperlong.h ${pkgdir}/usr/src/linux-${_kernver}/include/asm/
    chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
    find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    # remove unneeded architectures
    rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
    package_kernel26-icc-firmware() {
    pkgdesc="The included firmware files of kernel26-icc"
    cd ${srcdir}/linux-$_basekernel
    make firmware || return 1
    make INSTALL_MOD_PATH=${pkgdir} firmware_install || return 1
    kernel26-icc.preset
    # mkinitcpio preset file for kernel26-icc
    # DO NOT EDIT THIS LINE:
    source /etc/mkinitcpio.d/kernel26-icc.kver
    ALL_config="/etc/mkinitcpio.conf"
    PRESETS=('default' 'fallback')
    #default_config="/etc/mkinitcpio.conf"
    default_image="/boot/kernel26-icc.img"
    #default_options=""
    #fallback_config="/etc/mkinitcpio.conf"
    fallback_image="/boot/kernel26-icc-fallback.img"
    fallback_options="-S autodetect"
    kernel26-icc.install
    # arg 1: the new package version
    # arg 2: the old package version
    KERNEL_NAME=-icc
    KERNEL_VERSION=2.6.33-icc
    post_install () {
    # updating module dependencies
    echo ">>> Updating module dependencies. Please wait ..."
    depmod $KERNEL_VERSION
    # generate init ramdisks
    echo ">>> MKINITCPIO SETUP"
    echo ">>> ----------------"
    echo ">>> If you use LVM2, Encrypted root or software RAID,"
    echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
    echo ">>> More information about mkinitcpio setup can be found here:"
    echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
    echo ""
    echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
    /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
    post_upgrade() {
    pacman -Q grub &>/dev/null
    hasgrub=$?
    pacman -Q grub2 &>/dev/null
    hasgrub2=$?
    pacman -Q lilo &>/dev/null
    haslilo=$?
    # reminder notices
    if [ $haslilo -eq 0 ]; then
    echo ">>>"
    if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
    echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
    else
    echo ">>> You appear to be using the LILO bootloader. You should run"
    echo ">>> 'lilo' before rebooting."
    fi
    echo ">>>"
    fi
    if grep "^[^#]*/boot" /etc/fstab 2>&1 >/dev/null; then
    if ! grep "/boot" /etc/mtab 2>&1 >/dev/null; then
    echo "WARNING: /boot appears to be a seperate partition but is not mounted"
    echo " This is most likely not what you want. Please mount your /boot"
    echo " partition and reinstall the kernel unless you are sure this is OK"
    fi
    fi
    if [ "`vercmp $2 2.6.13`" -lt 0 ]; then
    # important upgrade notice
    echo ">>>"
    echo ">>> IMPORTANT KERNEL UPGRADE NOTICE"
    echo ">>> -------------------------------"
    echo ">>> As of kernel 2.6.13, DevFS is NO LONGER AVAILABLE!"
    echo ">>> If you still use DevFS, please make the transition to uDev before"
    echo ">>> rebooting. If you really need to stay with DevFS for some reason,"
    echo ">>> then you can manually downgrade to an older version:"
    echo ">>>"
    echo ">>> # pacman -U http://archlinux.org/~judd/kernel/kernel26-scsi-2.6.12.2-1.pkg.tar.gz"
    echo ">>>"
    echo ">>> If you choose to downgrade, don't forget to add kernel26-scsi to your"
    echo ">>> IgnorePkg list in /etc/pacman.conf"
    echo ">>>"
    echo ">>> (NOTE: The following portion applies to uDev users as well!)"
    echo ">>>"
    echo ">>> If you use any DevFS paths in your GRUB menu.lst, then you will not"
    echo ">>> be able to boot! Change your root= parameter to use the classic"
    echo ">>> naming scheme."
    echo ">>>"
    echo ">>> EXAMPLES:"
    echo ">>> - change root=/dev/discs/disc0/part3 to root=/dev/sda3"
    echo ">>> - change root=/dev/md/0 to root=/dev/md0"
    echo ">>>"
    fi
    # generate new init ramdisk
    if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
    echo ">>> --------------------------------------------------------------"
    echo ">>> | WARNING: |"
    echo ">>> |mkinitrd is not supported anymore in kernel >=2.6.18 series!|"
    echo ">>> | Please change to Mkinitcpio setup. |"
    echo ">>> --------------------------------------------------------------"
    echo ">>>"
    fi
    # updating module dependencies
    echo ">>> Updating module dependencies. Please wait ..."
    depmod $KERNEL_VERSION
    echo ">>> MKINITCPIO SETUP"
    echo ">>> ----------------"
    if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
    echo ">>> Please change your bootloader config files:"
    echo ">>> Grub: /boot/grub/menu.lst | Lilo: /etc/lilo.conf"
    echo "------------------------------------------------"
    echo "| - initrd26.img to kernel26${KERNEL_NAME}.img |"
    echo "| - initrd26-full.img to kernel26${KERNEL_NAME}-fallback.img |"
    echo "------------------------------------------------"
    fi
    if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
    echo ""
    echo ">>> New PATA/IDE subsystem - EXPERIMENTAL"
    echo ">>> ----------"
    echo ">>> To use the new pata drivers, change the 'ide' hook "
    echo ">>> to 'pata' in /etc/mkinicpio.conf HOOKS="
    echo ">>> The new system changes: /dev/hd? to /dev/sd?"
    echo ">>> Don't forget to modify GRUB, LILO and fstab to the"
    echo ">>> new naming system. "
    echo ">>> eg: hda3 --> sda3, hdc8 --> sdc8"
    echo ""
    echo ">>> piix/ata_piix (Intel chipsets) - IMPORTANT"
    echo "----------"
    echo ">>> If you have enabled ide/pata/sata HOOKs in /etc/mkinitcpio.conf"
    echo ">>> the 'ata_piix' module will be used."
    echo ">>> This may cause your devices to shift names, eg:"
    echo ">>> - IDE: devices from hd? to sd?"
    echo ">>> - SATA: sda might shift to sdc if you have 2 other disks on a PIIX IDE port."
    echo ">>> To check if this will affect you, check 'mkinitcpio -M' for piix/ata_piix"
    echo ""
    fi
    echo ">>> If you use LVM2, Encrypted root or software RAID,"
    echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
    echo ">>> More information about mkinitcpio setup can be found here:"
    echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
    echo ""
    echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
    if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
    /sbin/mkinitcpio -p kernel26${KERNEL_NAME} -m "ATTENTION:\nIf you get a kernel panic below
    and are using an Intel chipset, append 'earlymodules=piix' to the
    kernel commandline"
    else
    /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
    fi
    if [ "`vercmp $2 2.6.21`" -lt 0 ]; then
    echo ""
    echo "Important ACPI Information:"
    echo ">>> Since 2.6.20.7 all possible ACPI parts are modularized."
    echo ">>> The modules are located at:"
    echo ">>> /lib/modules/$(uname -r)/kernel/drivers/acpi"
    echo ">>> For more information about ACPI modules check this wiki page:"
    echo ">>> 'http://wiki.archlinux.org/index.php/ACPI_modules'"
    fi
    post_remove() {
    rm -f /boot/kernel26${KERNEL_NAME}.img
    rm -f /boot/kernel26${KERNEL_NAME}-fallback.img
    Then there's of course the config, it's based on kernel26 at the moment,.
    I'm building it now, to test. I had to install icc manually because the AUR package for icc didn't work for me. I had to install icc manually (run the installer), but that wasn't enough. Before makepkg, you have to add the icc to $PATH e.g.
    PATH=$PATH:/opt/intel/Compiler/11.1/064/bin/intel64
    and execute iccvars_intel64.sh which is in that folder.
    Last edited by Fackamato (2010-02-25 23:43:38)

    Ashren wrote:So there is a significant performance gain with ICC? Compilation time wise or?
    icc kernel compiles in similar time as gcc kernel, or if there any differences these may be negligible. To be honest I was not really interested in compiling times (was doing somethig else as it takes ~12 min on my system to finish kernel compilation), but rather with overall kernel performance. This is not the same as OS performance, but I am planning to compile firefox with icc and maybe some other stuff (if I am bored enough).
    If you have 32-bit OS (I have no idea how it will work on 64-bit), try it. I can't post PKGBUILD for 32-bit icc kernel because I don't use PKGBUILD for kernels or nvidia as I have found it limiting/cumbersome/unnecessary (while PKGBUILDs work great for anything else on Arch).
    The only part really annoying is intel server speed. Downloading icc sources (710MB for 32-bit only) tahes two hours. If you try to get 32/64bit sources even longer (1GB download).
    32-bit icc PKGBUILD package requires only one modification related to Release Notes otherwise makepkg will fail. Once installed export icc path, edit kernel Makefile and change one line related to compiler: change gcc to icc. You can also add some compiling optimizations.
    Pretty easy if you did compile kernel before.
    note added:
    actually combination of icc and zen seems to have nice effect on desktop responsiveness (this is 2.6.33)
    Last edited by broch (2010-02-26 19:54:57)

  • Inline functions in C, gcc optimization and floating point arithmetic issues

    For several days I really have become a fan of Alchemy. But after intensive testing I have found several issues which I'd like to solve but I can't without any help.
    So...I'm porting an old game console emulator written by me in ANSI C. The code is working on both gcc and VisualStudio without any modification or crosscompile macros. The only platform code is the audio and video output which is out of scope, because I have ported audio and video witin AS3.
    Here are the issues:
    1. Inline functions - Having only a single inline function makes the code working incorrectly (although not crashing) even if any optimization is enabled or not (-O0 or O3). My current workarround is converting the inline functions to macros which achieves the same effect. Any ideas why inline functions break the code?
    2. Compiler optimizations - well, my project consists of many C files one of which is called flash.c and it contains the main and exported functions. I build the project as follows:
    gcc -c flash.c -O0 -o flash.o     //Please note the -O0 option!!!
    gcc -c file1.c -O3 -o file1.o
    gcc -c file2.c -O3 -o file2.o
    ... and so on
    gcc *.o -swc -O0 -o emu.swc   //Please note the -O0 option again!!!
    mxmlc.exe -library-path+=emu.swc --target-player=10.0.0 Emu.as
    or file in $( ls *.o ) //Removes the obj files
        do
            rm $file
        done
    If I define any option different from -O0 in gcc -c flash.c -O0 -o flash.o the program stops working correctly exactly as in the inline funtions code (but still does not crash or prints any errors in debug). flash has 4 static functions to be exported to AS3 and the main function. Do you know why?
    If I define any option different from -O0 in gcc *.o -swc -O0 -o emu.swc  the program stops working correctly exactly as above, but if I specify -O1, -O2 or O3 the SWC file gets smaller up to 2x for O3. Why? Is there a method to optimize all the obj files except flash.o because I suspect a similar issue as when compilling it?
    3. Flating point issues - this is the worst one. My code is mainly based on integer arithmetic but on 1-2 places it requires flating point arithmetic. One of them is the conversion of 16-bit 44.1 Khz sound buffer to a float buffer with same sample rate but with samples in the range from -1.0 to 1.0.
    My code:
    void audio_prepare_as()
        uint32 i;
        for(i=0;i<audioSamples;i+=2)
            audiobuffer[i] = (float)snd.buffer[i]/32768;
            audiobuffer[i+1] = (float)snd.buffer[i+1]/32768;
    My audio playback is working perfectly. But not if using the above conversion and I have inspected the float numbers - all incorrect and invalid. I tried other code with simple floats - same story. As if alchemy refuses to work with floats. What is wrong? I have another lace whre I must resize the framebuffer and there I have a float involved - same crap. Please help me?
    Found the floating point problem: audiobuffer is written to a ByteArray and then used in AS. But C floats are obviously not the same as those in AS3. Now the floating point is resolved.
    The optimization issues remain! I really need to speed up my code.
    Thank you in advice!

    Dear Bernd,
    I am still unable to run the optimizations and turn on the inline functions. None of the inline functions contain any stdli function just pure asignments, reads, simple arithmetic and bitwise operations.
    In fact, the file containing the main function and those functions for export in AS3 did have memset and memcpy. I tried your suggestion and put the code above the functions calling memset and memcpy. It did not work soe I put the code in a header which is included topmost in each C file. The only system header I use is malloc.h and it is included topmost. In other C file I use pow, sin and log10 from math.h but I removed it and made the same thing:
    //shared.h
    #ifndef _SHARED_H_
    #define _SHARED_H_
    #include <malloc.h>
    static void * custom_memmove( void * destination, const void * source, unsigned int num ) {
      void *result; 
      __asm__("%0 memmove(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); 
      return result; 
    static void * custom_memcpy ( void * destination, const void * source, unsigned int num ) { 
      void *result; 
      __asm__("%0 memcpy(%1, %2, %3)\n" : "=r"(result) : "r"(destination), "r"(source), "r"(num)); 
      return result; 
    static void * custom_memset ( void * ptr, int value, unsigned int num ) { 
      void *result; 
      __asm__("%0 memset(%1, %2, %3)\n" : "=r"(result) : "r"(ptr), "r"(value), "r"(num)); 
      return result; 
    static float custom_pow(float x, int y) {
        float result;
      __asm__("%0 pow(%1, %2)\n" : "=r"(result) : "r"(x), "r"(y));
      return result;
    static double custom_sin(double x) {
        double result;
      __asm__("%0 sin(%1)\n" : "=r"(result) : "r"(x));
      return result;
    static double custom_log10(double x) {
        double result;
      __asm__("%0 log10(%1)\n" : "=r"(result) : "r"(x));
      return result;
    #define memmove custom_memmove
    #define memcpy custom_memcpy
    #define memset custom_memset
    #define pow custom_pow
    #define sin custom_sin
    #define log10 custom_log10 
    #include "types.h"
    #include "macros.h"
    #include "m68k.h"
    #include "z80.h"
    #include "genesis.h"
    #include "vdp.h"
    #include "render.h"
    #include "mem68k.h"
    #include "memz80.h"
    #include "membnk.h"
    #include "memvdp.h"
    #include "system.h"
    #include "loadrom.h"
    #include "input.h"
    #include "io.h"
    #include "sound.h"
    #include "fm.h"
    #include "sn76496.h" 
    #endif /* _SHARED_H_ */ 
    It still behave the same way as if nothing was changed (works incorrectly - displays jerk which does not move, whereby the image is supposed to move)
    As I am porting an emulator (Sega Mega Drive) I use manu arrays of function pointers for implementing the opcodes of the CPU's. Could this be an issue?
    I did a workaround for the floating point problem but processing is very slow so I hear only bzzt bzzt but this is for now out of scope. The emulator compiled with gcc runs at 300 fps on a 1.3 GHz machine, whereby my non optimized AVM2 code compiled by alchemy produces 14 fps. The pure rendering is super fast and the problem lies in the computational power of AVM. The frame buffer and the enulation are generated in the C code and only the pixels are copied to AS3, where they are plotted in a BitmapData. On 2.0 GHz Dual core I achieved only 21 fps. Goal is 60 fps to have smooth audio and video. But this is offtopic. After all everything works (slow) without optimization, and I would somehow turn it on. Suggestions?
    Here is the file with the main function:
    #include "shared.h"
    #include "AS3.h"
    #define FRAMEBUFFER_LENGTH    (320*240*4)
    static uint8* framebuffer;
    static uint32  audioSamples;
    AS3_Val sega_rom(void* self, AS3_Val args)
        int size, offset, i;
        uint8 hardware;
        uint8 country;
        uint8 header[0x200];
        uint8 *ptr;
        AS3_Val length;
        AS3_Val ba;
        AS3_ArrayValue(args, "AS3ValType", &ba);
        country = 0;
        offset = 0;
        length = AS3_GetS(ba, "length");
        size = AS3_IntValue(length);
        ptr = (uint8*)malloc(size);
        AS3_SetS(ba, "position", AS3_Int(0));
        AS3_ByteArray_readBytes(ptr, ba, size);
        //FILE* f = fopen("boris_dump.bin", "wb");
        //fwrite(ptr, size, 1, f);
        //fclose(f);
        if((size / 512) & 1)
            size -= 512;
            offset += 512;
            memcpy(header, ptr, 512);
            for(i = 0; i < (size / 0x4000); i += 1)
                deinterleave_block(ptr + offset + (i * 0x4000));
        memset(cart_rom, 0, 0x400000);
        if(size > 0x400000) size = 0x400000;
        memcpy(cart_rom, ptr + offset, size);
        /* Free allocated file data */
        free(ptr);
        hardware = 0;
        for (i = 0x1f0; i < 0x1ff; i++)
            switch (cart_rom[i]) {
         case 'U':
             hardware |= 4;
             break;
         case 'J':
             hardware |= 1;
             break;
         case 'E':
             hardware |= 8;
             break;
        if (cart_rom[0x1f0] >= '1' && cart_rom[0x1f0] <= '9') {
            hardware = cart_rom[0x1f0] - '0';
        } else if (cart_rom[0x1f0] >= 'A' && cart_rom[0x1f0] <= 'F') {
            hardware = cart_rom[0x1f0] - 'A' + 10;
        if (country) hardware=country; //simple autodetect override
        //From PicoDrive
        if (hardware&8)        
            hw=0xc0; vdp_pal=1;
        } // Europe
        else if (hardware&4)    
            hw=0x80; vdp_pal=0;
        } // USA
        else if (hardware&2)    
            hw=0x40; vdp_pal=1;
        } // Japan PAL
        else if (hardware&1)      
            hw=0x00; vdp_pal=0;
        } // Japan NTSC
        else
            hw=0x80; // USA
        if (vdp_pal) {
            vdp_rate = 50;
            lines_per_frame = 312;
        } else {
            vdp_rate = 60;
            lines_per_frame = 262;
        /*SRAM*/   
        if(cart_rom[0x1b1] == 'A' && cart_rom[0x1b0] == 'R')
            save_start = cart_rom[0x1b4] << 24 | cart_rom[0x1b5] << 16 |
                cart_rom[0x1b6] << 8  | cart_rom[0x1b7] << 0;
            save_len = cart_rom[0x1b8] << 24 | cart_rom[0x1b9] << 16 |
                cart_rom[0x1ba] << 8  | cart_rom[0x1bb] << 0;
            // Make sure start is even, end is odd, for alignment
            // A ROM that I came across had the start and end bytes of
            // the save ram the same and wouldn't work.  Fix this as seen
            // fit, I know it could probably use some work. [PKH]
            if(save_start != save_len)
                if(save_start & 1) --save_start;
                if(!(save_len & 1)) ++save_len;
                save_len -= (save_start - 1);
                saveram = (unsigned char*)malloc(save_len);
                // If save RAM does not overlap main ROM, set it active by default since
                // a few games can't manage to properly switch it on/off.
                if(save_start >= (unsigned)size)
                    save_active = 1;
            else
                save_start = save_len = 0;
                saveram = NULL;
        else
            save_start = save_len = 0;
            saveram = NULL;
        return AS3_Int(0);
    AS3_Val sega_init(void* self, AS3_Val args)
        system_init();
        audioSamples = (44100 / vdp_rate)*2;
        framebuffer = (uint8*)malloc(FRAMEBUFFER_LENGTH);
        return AS3_Int(vdp_rate);
    AS3_Val sega_reset(void* self, AS3_Val args)
        system_reset();
        return AS3_Int(0);
    AS3_Val sega_frame(void* self, AS3_Val args)
        uint32 width;
        uint32 height;
        uint32 x, y;
        uint32 di, si, r;
        uint16 p;
        AS3_Val fb_ba;
        AS3_ArrayValue(args, "AS3ValType", &fb_ba);
        system_frame(0);
        AS3_SetS(fb_ba, "position", AS3_Int(0));
        width = (reg[12] & 1) ? 320 : 256;
        height = (reg[1] & 8) ? 240 : 224;
        for(y=0;y<240;y++)
            for(x=0;x<320;x++)
                di = 1280*y + x<<2;
                si = (y << 10) + ((x + bitmap.viewport.x) << 1);
                p = *((uint16*)(bitmap.data + si));
                framebuffer[di + 3] = (uint8)((p & 0x1f) << 3);
                framebuffer[di + 2] = (uint8)(((p >> 5) & 0x1f) << 3);
                framebuffer[di + 1] = (uint8)(((p >> 10) & 0x1f) << 3);
        AS3_ByteArray_writeBytes(fb_ba, framebuffer, FRAMEBUFFER_LENGTH);
        AS3_SetS(fb_ba, "position", AS3_Int(0));
        r = (width << 16) | height;
        return AS3_Int(r);
    AS3_Val sega_audio(void* self, AS3_Val args)
        AS3_Val ab_ba;
        AS3_ArrayValue(args, "AS3ValType", &ab_ba);
        AS3_SetS(ab_ba, "position", AS3_Int(0));
        AS3_ByteArray_writeBytes(ab_ba, snd.buffer, audioSamples*sizeof(int16));
        AS3_SetS(ab_ba, "position", AS3_Int(0));
        return AS3_Int(0);
    int main()
        AS3_Val romMethod = AS3_Function(NULL, sega_rom);
        AS3_Val initMethod = AS3_Function(NULL, sega_init);
        AS3_Val resetMethod = AS3_Function(NULL, sega_reset);
        AS3_Val frameMethod = AS3_Function(NULL, sega_frame);
        AS3_Val audioMethod = AS3_Function(NULL, sega_audio);
        // construct an object that holds references to the functions
        AS3_Val result = AS3_Object("sega_rom: AS3ValType, sega_init: AS3ValType, sega_reset: AS3ValType, sega_frame: AS3ValType, sega_audio: AS3ValType",
            romMethod, initMethod, resetMethod, frameMethod, audioMethod);
        // Release
        AS3_Release(romMethod);
        AS3_Release(initMethod);
        AS3_Release(resetMethod);
        AS3_Release(frameMethod);
        AS3_Release(audioMethod);
        // notify that we initialized -- THIS DOES NOT RETURN!
        AS3_LibInit(result);
        // should never get here!
        return 0;

  • Compiling with debug info

    Hi!
    I get a question about PL/SQl, How can I compile a Block PL/SQL with debug information, in SQL*Plus?
    Thanks in Advance
    - Pablo

    From the symptoms you describe, it is possible that the shared library contains a bug, but it is more likely that the problem is in your code, passing bad data to the shared library.
    The problem might be a compiler bug, but I think an error in your code is more likely.
    For example, your code as written might have undefined behavior that works by accident when compiling without optimizing, but fails when the compiler improves the runtime code.
    Some examples:
    1. A classic MT programming error is failing to declare a variable volatile when it is shared by more than one thread. In each thread, the compiler assumes it can remember the value of the variable and not reload it between references.
    2. "x = ++x + b;" Modifying a variable twice in an expression withtout sequence points has undefined behavior -- compiler optimization can affect the result.
    3." foo(x, x+=3);" the order of evaluation of function arguments is unspecified, so the actual values passed to foo could depend on optimization.
    With C++ 5.5, you get some warnings from system headers that you can't do anything about, which I suspect is why you have disabled some warnings. Unfortunately, you might be disabling warnings that you need to see. That is, some of the disabled warnings could point to invalid code that results in the program crash.
    I suggest using w instead of w2 (to avoid uninteresting warnings), and fix your code to eliminate the warnings you get.
    In the current compiler, C++ 5.7 in Sun Studio 10, we have made some adjustments to warnings to make w and w2 more useful. You should consider upgrading.You can get a 60-day free trial version here:
    http://www.sun.com/software/products/studio/index.xml
    Also get the current patches for it here:
    http://developers.sun.com/prodtech/cc/downloads/patches/index.html

  • JIT compiler "jitc" not found

    Hi,
    I've just installed JVM 1.4.2 for Unix Systems Services on z/OS 1.4 mainframe.
    When I issue the command java -version I get the following:
    # java -version
    Could not load dll : /usr/lpp/java/IBM/J1.4/bin/libjitc.so
    : EDC5157I An internal error has occurred.
    Warning: JIT compiler "jitc" not found. Will use interpreter.
    java version "1.4.2"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
    Classic VM (build 1.4.2, J2RE 1.4.2 IBM z/OS Persistent Reusable VM build cm142-
    20070329 (SR8) (JIT disabled))
    I have check for libjitc.so in the java directory and it is there. Java compiles and runs fine. Can anyone help?

    OS/400 interprets Java methods until reaching the threshold specified by the os400.jit.mmi.threshold Java system property. After reaching the threshold, OS/400 uses the JIT compiler to compile methods into native machine instructions.
    To use the Just-In-Time compiler, you need to set the compiler value to jitc (default it isn't). You can set the value by adding an environment variable or setting the java.compiler system property. Select one method from the list below to set the compiler value:
    * From a command line prompt on your iSeries server, add the environment variable by using the Add Environment Variable (ADDENVVAR) command. Then, run your Java program using the Run Java (RUNJVA) command or JAVA command. For example, use:
    ADDENVVAR ENVVAR (JAVA_COMPILER) VALUE(jitc)
    JAVA CLASS(Test)
    * Set the java.compiler system property on the iSeries command line. For example, enter JAVA CLASS(Test) PROP((java.compiler jitc))
    * Set the java.compiler system property on the Qshell Interpreter command line. For example, enter java -Djava.compiler=jitc Test
    Once you set this value, the JIT compiler optimizes all of the Java code before running it.

  • EA1 - Optimization level not being respected.

    It seems that no matter what I define under Preferences->Database->PL/SQL Compiler->Optimization Level, everything is always compiled against optimization level 2.

    Cant reproduce. Steps:
    CREATE OR REPLACE PROCEDURE OPTIM_LEVEL0 AS
    BEGIN
      NULL;
    END OPTIM_LEVEL0;
    Set Tools->Preferences->PL/SQLCompiler->Optimization Level=0
    Press  Compile cogwheel toolbutton.
    Go to Details tab, witness PLSQL_OPTIMIZE_LEVEL=0
    Repeat these steps for level = 1 and 2.

  • Hasmap.put,get infinite loop, 27.6 optimizer problem

    Helo,
    We have a very busy (3000 users) Weblogic Portal and Weblogic Integration instance.
    We found that some times (once a week) weblogic server threads go to infinite loop doing hasmap.get, hashmap put or hashmap remove operations.
    Our developers found that there are synchronization problems with hashmap operations in the portal and wli code, (in 5 classes until today) they patched (synchronized) it and now the instances are stable.
    We contacted oracle support, but they only recommended us some wlw.. setting, none of them worked.
    The strange thing that the code that we patched is existed in weblogic server for years, so I tried to exclude the hasmap class from the optimizer in jrockit.opt file. Now the instances are also stable without the inhouse patches.
    So I suspect theh the jrockit optimizer optimize the hasmap class after some time in a wrong way; how can I find some evidence about it?
    The thead dumps showing only the hasmap operations and very high cpu usage.
    We are on Jrockit 27.6, JVM 1.5, Portal and WLI 9.2MP3
    Regards,
    LJ

    Not sure if it is relevant to the issues you describe in this thread, but a common problem with HashMaps is incorrect (missing) synchronization on concurrent operations. If you do have several threads concurrently accessing a HashMap without synchronization, it might mess up the internal data structures in the HashMap object. This can lead to infiinite loops when trying to iterate through the HashMap at some later time. This problem is not JVM-specific but changes in timing due to different JVM versions, JIT compilation/optimization or different HW etc can cause a previous "stable" program to become "unstable".
    I've seen a number of JRockit support issues related to this problem over the years, and in almost all cases it's been a problem in the Java code (which could be WLS, or the user application).
    Unfortunately it's far from trivial to troubleshoot concurrency issues. One (slow) way of checking your own code is to wrap all HashMaps in a SynchronizedMap. This will slow down your application but if the problem goes away then it's a good indication of the root cause. Not very useful if the problem is in 3rd party code that you don't have the source for, of course. In that case you have to open a ticket with the vendor (Oracle or other 3rd party).
    Cheers,
    Henrik

  • Compiling via XML file with Xlint:unchecked, JDK 1.5.0_05

    compiling 1.4.2_04 code with 1.5.0_05 using an Ant/Tomcat environment and get the following Notes:
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    added this to my XML file to try to compile with unchecked:
    <property name="compile.unchecked" value="true"/> <!-- added -->
    <target name="compile">
    <javac srcdir="${source.home}"
    destdir="${deploy.home}"
    debug="${compile.debug}"
    deprecation="${compile.deprecation}"
    unchecked="${compile.unchecked}" ><!-- added-->
    optimize="${compile.optimize}"/>
    </target>
    Now I get this build error:
    BUILD FAILED
    file:C:/.../my_Build.xml:71: The <javac> task doesn't support the "unchecked" attribute.
    This seems strange. Am I using unchecked incorrectly? This same code has <property name="compile.deprecation" value="true"/>, which functions and gives me more info on a few deprecated methods in the code, so I followed the same syntax.
    Any suggestions would be appreciated. Thanks

    Thank you - that did it.
    I am new to Java and am wondering if you can give me any clue as to what an "unchecked call" means? How do I go about making it a "checked call"? If it is a warning and not an error, does it really matter? Can you point me to a good reference (online or book)?
    This is the info I got on the xml file when I compiled with unchecked:
    warning: [unchecked] unchecked call to addElement(E) as a member of the raw type java.util.Vector
    [javac]                searchThreads.addElement(temp);
    This is the code it is looking at (mostly comments, but didn't want to strip them out):
    // Create a vector to hold all of the search threads. 1000 should be more than enough.
    Vector searchThreads = new Vector(1000);
    // Start spawning search threads until the server socket is found, or until 1000 threads have been created.
    while ((searchThreads.size() < 1000) && !found)
    // We need to check to see if we've connected to the right server by reading what the server sent back to us.
    //If it sent back the string "TM Server", then we're in the right place. If we get anything else, or we get nothing, then we need to keep looking.
    // We spawn a thread for each socket to save time, and as soon as one of the threads finds the right socket, it sets a flag telling us to stop looking.
    // Create and start the search thread
    PortFinder temp = new PortFinder(tmHostName, startPort);
    temp.start();
    // Add the search thread to the vector THIS IS THE UNCHECKED CALL
    searchThreads.addElement(temp);
    // Increment to the next port before looping
    startPort++;
    Thanks

  • Optimization of using text constants

    Does Forms compiler optimize using text constants when it make *.fmx
    file, if yes then how?
    What I mean. In many cases Forms programmers use text constants to do
    any actions, for sample:
    - do_key('EXECUTE_QUERY');
    - if (:system.mode = 'ENTER-QUERY') then /* ... */ end if;
    - execute_trigger('ON-POPULATE-DETAILS');
    - show_alert('ASK_SAVE');
    - go_block('ORDERS') or go_item('ORDERS.NAME');
    - set_block_property(bid,DEFAULT_WHERE,':orders.pay > '||:r.pay_rate);
    As I have undestood myself, Forms divide such constant on types:
    - standart text constants('EXECUTE_QUERY','ENTER-QUERY' ...);
    - user's text constants ('ASK_SAVE','ORDERS.NAME');
    And Forms do any optimization with standart text constants: in *.fmx file
    I found only one enter for every from such constants.
    But for user's text constants Forms does not optimization: in *.fmx file
    I found more then one enter for such constants.
    If above is right then is there benefit from creating a package in form
    module and creating constants in the package, that contain frequently used
    user's text constants(block and items names, e.t.c.) and then writing down
    in program these package constants instead of user's text constants?

    I get to answer my own question. I found a workaround should you ever what to be sure a certain font is used and not replaced. Granted, this will add my download time but you at least can preserve the look.
    Simply make any text with a shadow. But make the offset 0 and the transparency to 1 (you can't make it 0). You won't even notice the "shafow" and the text will be made into a graphic every time.
    Stephen

Maybe you are looking for

  • Radio Buttons in Design Studio

    Hi Experts,     Am new to Design Studio, I am middle of creating dashboard. here i have to use radio button which shows Value and Quantity. where as if i select value as  a radio button then my dash board should show only respective Graph and Cross T

  • Installing Windows XP Pro on Promise 133 RAID

    After much playing about heres the outcome. The crux seemed to be that I couldn't make the array active. FDISK on a boot disk told me that I couldn't make a disk active that was not the first. I looked at the the first and I found a 100Mb ATAPI ZIP d

  • I can't install flash player on MAC

    I can't install flash player on MAC give me error after program download on MAC as me to put my user ID and password I try to put but always give me error

  • HT1349 I want to buy a mac book air

    I want to buy a mac book air, currently I have a mac  book pro I bought applications for it. The question is ca I transfer to the mbair or do I have to buy them again? Even if I erase them from it?

  • Logged in as admin - still pw prompted

    I thought that if I am logged in to admin account I would be able to trash things w/o having to type in my admin password? Since I use quite a sophisticated pw this is really VERY annoying, to say the least. Is there a solution to this issue?