After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789071 - To many variable copies
To many variable copies
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
0.39.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-16 17:46 UTC by Daniel Espinosa
Modified: 2018-05-22 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: No tmp for method-calls without ref/out params returning ValueType (1.50 KB, patch)
2017-11-19 13:15 UTC, Rico Tzschichholz
needs-work Details | Review
codegen: Avoid use of temp-var to access in/ref parameters (1.07 KB, patch)
2017-11-21 20:32 UTC, Rico Tzschichholz
none Details | Review
codegen: Avoid use of temp-var to access in/ref parameters (1.07 KB, patch)
2017-11-22 21:17 UTC, Rico Tzschichholz
committed Details | Review
codegen: Avoid use of temp-var for some callables returning ValueType (1.69 KB, patch)
2017-11-22 21:17 UTC, Rico Tzschichholz
committed Details | Review

Description Daniel Espinosa 2017-10-16 17:46:13 UTC
Vala C code create lot of pointer copies, this is one reason to retro-gtk, to move away from Vala:

http://bytesgnomeschozo.blogspot.mx/2017/10/retro-gtk-renaissance.html

Vala's code generator may have a -O like switch, to produce better quality code by avoiding apparent unnecessary C code.

This new switch, will slowness C code generation and will hit general compilation time.

This switch can help Vala projects to port to C, by reducing the work on rewrite, helping to attract other C developers to use Vala for prototype their projects in Vala and then switch to C if they wish.

GXml can take advantage of this, because it can be ported to C in order to be merged in GLib.
Comment 1 Jonathan Moerman 2017-11-10 13:46:34 UTC
It would indeed indeed be great if Vala didn't make so many copies, it makes the c code much harder to read. (Which in an ideal world wouldn't be necessary but it sometimes is essential when debugging.)
Comment 2 Rico Tzschichholz 2017-11-19 13:15:31 UTC
Created attachment 364002 [details] [review]
codegen: No tmp for method-calls without ref/out params returning ValueType
Comment 3 Rico Tzschichholz 2017-11-19 13:18:09 UTC
Review of attachment 364002 [details] [review]:

Break libgee testsuite:

ERROR:testcollection.c:4273:__lambda24_: assertion failed: (iter.has_next ())
Comment 4 Rico Tzschichholz 2017-11-21 20:32:45 UTC
Created attachment 364141 [details] [review]
codegen: Avoid use of temp-var to access in/ref parameters
Comment 5 Rico Tzschichholz 2017-11-22 21:17:15 UTC
Created attachment 364234 [details] [review]
codegen: Avoid use of temp-var to access in/ref parameters
Comment 6 Rico Tzschichholz 2017-11-22 21:17:39 UTC
Created attachment 364235 [details] [review]
codegen: Avoid use of temp-var for some callables returning ValueType

It is safe to do for callables which don't have out/ref parameters without
breaking the control-flow.
Comment 7 GNOME Infrastructure Team 2018-05-22 15:55:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/599.