Re: [Vala] Questions about vapi generation and testing





El 05/10/11 22:07, bsquared escribió:
Luca Bruno<lethalman88 gmail com>  writes:

On Wed, Oct 5, 2011 at 6:30 PM, bsquared<bwcode4u gmail com>  wrote:

1.  Is it necessary/recommended to specialize a generic?
    The generated vapi has lists without specialization, and these work
    fine in the tests.
    public GLib.SList list_databases ();
    public GLib.SList<string>  list_databases ();


The latter obviously.

I ask because in the gir the elements are generic, and the compiler does
not issue warnings.


2. What can I do to optimize the generated c code in my tests?
   The generated code is 4x the size of original test code
   (test-couchdb-glib.c) as is the executable.


For the C code, nothing. About the executable, optimize with -O3 (or -Os).

I was thinking there may be some kind of best practice to minimize the
number of temp vars in the generated code.

No, I don't think so, those temp variables appear because the manner in which the Vala generate the code, the way to generate less code is to modify the Vala compiler but not to optimizing your Vapi.

You should not need to expect that Vala compiler generates a C code as if you had written by hand as you should not expect the C compiler do the same with the assembly code generated.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]