From 9ea78648f59f7c8b8782c8cc161a45452f6944bd Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Fri, 28 Oct 2022 07:12:58 +0200 Subject: [PATCH 1/2] Using Complied Languages rather than Interpreted Languages #132 --- docs/catalog/cloud/use-compiled-languages.md | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docs/catalog/cloud/use-compiled-languages.md diff --git a/docs/catalog/cloud/use-compiled-languages.md b/docs/catalog/cloud/use-compiled-languages.md new file mode 100644 index 00000000..2b1713c8 --- /dev/null +++ b/docs/catalog/cloud/use-compiled-languages.md @@ -0,0 +1,44 @@ +--- +version: 1.0 +submitted_by: markus-ntt-seidl +published_date: TBD +category: cloud +tags: + - cloud + - role:cloud-engineer + - size:small +--- + +# Use compiled languages + +## Description + +Interpreted languages need to be parsed, compiled and executed when the application starts or a workload arrives. This tends to be more energy heavy then when a compiled language is used. The compilation is then only done once, saving on resources. + +## Solution + +Use compiled languages whenever possible or compile interpreted languages. + +## SCI Impact + +`SCI = (E * I) + M per R` +[Software Carbon Intensity Spec](https://grnsft.org/sci) + +Concerning the SCI equation, use compiled languages will impact as follows: + +- `E`: The embodied carbon emissions will be reduced, as compiled binaries tend to be smaller then the sources they are compiled from +- `I`: Running compiled binaries is more energy efficient and uses less energy which outweighs the energy consumed in compiling it to binary upfront. + +## Assumptions + +- There is the assumption that the execution environment allows usage of compiled languages, this is not always the case (for example web browsers) +- Use benchmarks to determine if the application use case benefits from using a compiled language + +## Considerations + +- Some interpreted languages provide ways to compile these into binary (for example GraalVM for Java) + +## References + +- [One Carbon intensity benchmark](https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf) + From 22d0ce9414437b2c60ce5dc32f40cadd4fa97796 Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Tue, 8 Nov 2022 07:19:04 +0100 Subject: [PATCH 2/2] Included SME reviews --- docs/catalog/cloud/use-compiled-languages.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/catalog/cloud/use-compiled-languages.md b/docs/catalog/cloud/use-compiled-languages.md index 2b1713c8..af0392bd 100644 --- a/docs/catalog/cloud/use-compiled-languages.md +++ b/docs/catalog/cloud/use-compiled-languages.md @@ -7,6 +7,8 @@ tags: - cloud - role:cloud-engineer - size:small + - programming-language + --- # Use compiled languages @@ -17,7 +19,8 @@ Interpreted languages need to be parsed, compiled and executed when the applicat ## Solution -Use compiled languages whenever possible or compile interpreted languages. +Use compiled languages (like Go, Rust, Java or others) whenever possible or compile interpreted languages. + ## SCI Impact @@ -26,17 +29,18 @@ Use compiled languages whenever possible or compile interpreted languages. Concerning the SCI equation, use compiled languages will impact as follows: -- `E`: The embodied carbon emissions will be reduced, as compiled binaries tend to be smaller then the sources they are compiled from -- `I`: Running compiled binaries is more energy efficient and uses less energy which outweighs the energy consumed in compiling it to binary upfront. +- `E`: Running compiled binaries is more energy efficient and uses less energy which outweighs the energy consumed in compiling it to binary upfront +- `M`: The embodied carbon emissions will be reduced, as compiled binaries tend to be smaller then the sources they are compiled from ## Assumptions - There is the assumption that the execution environment allows usage of compiled languages, this is not always the case (for example web browsers) -- Use benchmarks to determine if the application use case benefits from using a compiled language +- Use benchmarks to determine if the application use case benefits from using a compiled language. ## Considerations -- Some interpreted languages provide ways to compile these into binary (for example GraalVM for Java) +- Some interpreted languages provide ways to be compiled into binary (for example GraalVM for Java, Python and more) +- Consider factoring in compile time when doing benchmarks ## References