Skip to content

Instantly share code, notes, and snippets.

@salty-ivy
Last active August 26, 2023 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salty-ivy/fe8616a28bf7d4a577d84b646141e8a9 to your computer and use it in GitHub Desktop.
Save salty-ivy/fe8616a28bf7d4a577d84b646141e8a9 to your computer and use it in GitHub Desktop.
GSoC 23 Greener coding: Back-end development.

Google summer of code 2023 final project report

Contributor: Aman Pandey

Mentor: Chris Adams

Project: Greener coding 💚: Backend development

Organization: Wagtail

Original idea discussion by chris adams: Greener coding:Making a 'gold' reference configuration with the Wagtail bakery app

Contributor proposal: Wagtail: Greener coding (GSoC 2023 Proposal)

Description

The project aims to integrate green coding practices into Wagtail’s direction and make concrete improvements to reduce related carbon emissions also ensuring that the websites we build are environmentally friendly. We plan to do so by improving different parts of wagtail architecture like improving project templates, adopting internal template caching, extending image support and lazy loading, lighter embeds, job scheduling interface for asynchronous task processing, eco-friendly themes, and other processing-related optimisations.

Technologies used: django, wagtail, python

Execution

Original Greener Coding was divided into 2 parts namely 1.Greener coding: Frontend development 2.Greener coding: Backedn development. This report consist the progress for 2. Backend development.

We along with organization maintainers priortized certain tasks over the others that can be rolled out into wagtial's new release.

Our sustainable coding initiative diverged from conventional developmental trajectories, diverging significantly in its approach. The crux of its impact resides in pioneering research directed towards the reduction of carbon emissions. Our preliminary research during the coding phase unveiled several pathways for exploration, each meticulously prioritized based on complexity and feasibility for integration into forthcoming releases. These pathways encompass:

Integration of AVIF support into Willow: AVIF, a lightweight image format, demonstrates superior efficiency compared to its counterparts. Static site pages enriched with AVIF-encoded images exhibit substantially reduced load times and resource consumption compared to those incorporating alternative formats.

Extension of AVIF support to Wagtail: Building upon the successful integration of AVIF within Willow, we seamlessly extended this support to Wagtail. Concurrently, a concerted effort was made to foster adoption amongst fellow developers, encouraging the incorporation of this technology into their projects.

Implementation of "scale to zero" configurations for Wagtail sites: Leveraging serverless architectures such as neon.tech, we explored the concept of "scale to zero" configurations for Wagtail sites. This endeavor aimed to enhance resource efficiency by dynamically adapting server capacity to match traffic demands, thereby minimizing carbon footprint and operational costs.

Development of a Green Wagtail-specific debug toolbar: Addressing the need for developers to gauge the optimization levels and resource intensity of their sites and pages during the development phase, this debug toolbar emerges as a crucial tool. By providing insights into the optimization status of their projects, developers are empowered to make informed decisions that lead to more streamlined and resource-efficient outcomes.

Work done

  1. AVIF support for willow PR wagtail/Willow#115
  2. AVIF support for Wagtail PR wagtail/wagtail#10657

What's next

While we can still venture on many imporvements related to our sustaninable development but its really important for us to measure those in action to show if it actually makes any difference or not, so our next step would be to benchmark these changes on a project using Green Metric Tool.

  1. Original benchmarking on wagtial bakerydemo by Thibaud colas: bakerydemo GOLD benchmarking

  2. Benchmarking the impact of AIVF over other image formats: AVIF GOLD benchmarking on demo project

Blogs

  1. Wagtail's sustainability consideration page
  2. Wagtail gets bit leaner and greener
  3. Green Web Foundation helping us make wagtail greener
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment