Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Optimize the Binaries #96

Open
mertyildiran opened this issue Jan 4, 2021 · 0 comments
Open

[RFC] Optimize the Binaries #96

mertyildiran opened this issue Jan 4, 2021 · 0 comments
Assignees
Labels
performance Performance issues or improvements
Projects

Comments

@mertyildiran
Copy link
Member

The chaos binary and the binaries produced by the Chaos compiler requires certain optimizations:

GCC Common Function Attributes

Using the Common Function Attributes like cold, hot, flatten, always_inline, used, unused etc. the functions in Chaos language's source needs to be optimized. These attributes can also be used in the generated intermediate C code if they are applicable.

GCC Optimize Options

Using the Optimize Options like -O3 the binaries produced by the project needs to be optimized. The Chaos compiler GCC commands supports extra flags using -e flag. For example: -e "-ggdb" So it's open to discussion that should -O3 included to the GCC commands by default or let the users decide.

Unused Functions

Move unused functions (if there are any) or global declarations to other files if they are not used by the compiled Chaos programs.

Strip

Should we strip the binaries with -s flag to reduce the binary size?

Structs & Allocations

Remove the unused members of structs in the language's source or disable them using macros according to the related case. Determine not freed or freed with an unnecessary delay memory allocations and fix them.

More optimization ideas can be extracted from Extensions to the C Language Family documentation page.

@mertyildiran mertyildiran added the performance Performance issues or improvements label Jan 4, 2021
@mertyildiran mertyildiran self-assigned this Jan 4, 2021
@mertyildiran mertyildiran added this to To do in Chaos via automation Jan 4, 2021
@mertyildiran mertyildiran moved this from To do to In progress in Chaos Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issues or improvements
Projects
Chaos
  
In progress
Development

No branches or pull requests

1 participant