Coding Standards and Performance Optimization

This group is dedicated to optimizing performance of Drupal with coding standards. As such it deals with particular coding guidelines, sharing knowledge and benchmarks that might be integrated into Coder module.

If you are seeking help on high performance/scalability Drupal sites and how to gain a better performance for them, you might have a look at the High Performance group.

Guidelines
  • Each performance optimization coding standard gets its own Wiki page including
    • a one line synopsis in the format XY is faster than YX
    • a proper description of how it improves performance
    • benchmarks from different platforms and PHP versions
    • web links to references and additional resources
  • You may
    • suggest new optimizations by posting a story
    • comment on new optimization proposals with insightful input
    • perform benchmarks on your platform(s) for existing and new optimizations

"elseif" vs "else if"

stella's picture
public
stella - Fri, 2008-07-18 20:31

In the latest code review done by chx and Morbus at http://www.drupaltoughlove.com, one of the items commented on was the usage of "else if" instead of "elseif". There's nothing in the Coding Standards doc that specifically states that one should be used over the other, however it is "implied" from the first example on indentation that "elseif" should be used. Can the Coding Standards doc be updated so that it states one way or the other? Personally I don't mind which, but I would prefer if there was consistency. Core itself has a mixture, but with a higher number of "elseif".


Doxygen @file directives

stella's picture
public
stella - Fri, 2008-07-18 12:33

In the Doxygen formatting conventions doc, it says that files should be documented with the @file directive and gives the following example:

<?php
// $Id: theme.inc,v 1.202 2004/07/08 16:08:21 dries Exp $

/**
* @file
* The theme system, which controls the output of Drupal.
*
* The theme system allows for nearly all output of the Drupal system to be
* customized by user themes.
*/

Note the @file line in particular.


Javascript Coding Standards

stella's picture
public
stella - Fri, 2008-07-18 12:02

More and more contrib modules are including JavaScript files, so I want to add the ability to review JavaScript files to the Coder module. However, step 1 is we need to agree on what coding standards we should be using for JavaScript.


Performance Profiling System

public
echoditto_tom - Sat, 2008-03-22 03:55

Moved to official ideas list

Develop an xss and sql injection scanner based on SimpleTest

ingo86's picture
public
ingo86 - Fri, 2008-03-14 15:02

What I wanna develop for SOC 2008 is a module called security (or add security function to simpletest existing module) to enable users checking their drupal installation against xss and sql injection vulnerabilities.
It will be also good for module developers, in fact they can check their module before submitting them to drupal website. Users could be more protected against vulnerabilities that became from third part modules.
The objective of this work is to realize automated penetration test on drupal installation.

It will be based upon SimpleTest, already used by Rasmus (php core developer) to develop his own closed source xss scanner. SimpleTest is a jUnit similar library written for php.

My module could easily been extended to add more functionalities about security, but basically I think that this two are the most important.
If someone has functionality ideas to improve my project and make it better I'm here, listening for more proposal.


Improving Drupal's page loading performance

public
Wim Leers@drupal.org - Wed, 2008-01-30 22:51

This article I wrote should appeal to people interested in high performance Drupal sites. Most of the performance gains are achieved by doing things with the Javascript and Drupal's File API.

http://wimleers.com/article/improving-drupals-page-loading-performance

You can expect another article soon, about the same topic, but then putting it to practice. I'll use the CDN integration module (of which I'm also the maintainer) and the included core patches to do it in just a few simple steps.

GHOP #127: Benchmark results table

public
Corni - Fri, 2008-01-18 16:57

Hi,
I need a table for #127, so it will go here :)
This table is now fully complete :)

<

table>

Test Page Caching Drupal 5 requests/sec Drupal 5 overalltime Drupal 6 requests/sec

Drupal 6 overalltime % differences for Drupal 6(based on requests/s)

Index with 30 nodes No 3.64 55.13 3.42

58.46 -06%

normal 136.62

Coder format! or: Make everything Drupal.

sun's picture
public
sun - Fri, 2008-01-18 12:43

In case you don't know, Edward Z. Yang (ezyang) is squashing a lot of bugs in coder_format in the scope of a GHOP task currently.
In case you don't know coder_format, it's a script I wrote some time ago which re-formats one PHP file, or recursively all files in a directory according to Drupal's Coding Standards. Doug Green has been so kind to add it to the Coder module, so if you are a Drupal developer, you probably have (an out-dated version of) it already. Unfortunately, it did not receive that much attention yet.

I do not yet want to promote coder_format with this post. Today, I just want to show you the results of an experiment, which in turn will show you, what you can expect from coder_format.

Guess, what this ugly code snippet is:


GHOP #136: Improve coder_format checklist

public
ezyang - Wed, 2008-01-16 21:44

This page is for tracking the findings of GHOP #136 in coder_format of the coder module.

Performance Profile of D6 (3 pages)

public
Corni - Tue, 2007-12-11 20:45

This is my GHOP task, for further information look at http://drupal.org/node/196907

The Text from there ;)
For GHOP Drupal-Issue 4 I did a profiling of D6.
The Comp Specs are:
Core2Duo E6320 (overclocked, both Cores 2,24Ghz)
4GB Mem
HDD - don't know :P should be 72000rpm, 8MB Cache or so
Gentoo Linux, Kernel 2.6.21-tuxonice-gentoo-r6 running X
1. Analysis of a fresh installed D6-HEAD (12.09.07) start page after installing (runned cron 1 time manually, please note that the standard page IS NOT saved into db)

Overall stats:

candidate node, user, and system functions for module splt

pwolanin's picture
public
pwolanin - Fri, 2007-07-20 17:35

Draft list from chx:


function node_node_operations() {
function node_operations_publish($nodes) {
function node_operations_unpublish($nodes) {
function node_operations_promote($nodes) {
function node_operations_demote($nodes) {
function node_operations_sticky($nodes) {
function node_operations_unsticky($nodes) {
function node_filters() {
function node_build_filter_query() {
function node_filter_form() {
function theme_node_filter_form($form) {
function theme_node_filters($form) {
function node_filter_form_submit($form, &$form_state) {


Break up core page handlers to include files

public
Crell@drupal.org - Wed, 2007-05-23 03:54

http://drupal.org/node/140218 now makes this possible: http://drupal.org/node/146172

So let's do it. :-)

Core still needs to be factored out to separate page include files. If you're interested in helping out, grab a module below. Please follow the guidelines listed in the documentation page above. If you feel the documentation page should be changed, comment on the book page so we can keep that all together in one place.

A starting list of functions in node, user, and system: http://groups.drupal.org/node/5239. Note, however, that some of this (especially node) may be touched by the actions patch.

Performance review of object translation required

Gábor Hojtsy's picture
public
Gábor Hojtsy - Tue, 2007-05-08 11:25

We have posted a patch to support object translation of certain Drupal objects (content types, user profile fields and categories, site settings, and so on) to multiple human languages. While we have clear concepts and very good ideas for the user interface (which we though before that would not be easy), performance-wise we are at crossroads. We would welcome beginner as well as expert reviewers to come and share their performance ideas about Drupal object translation, so Drupal 6 can include a mature translation infrastructure, advancing ahead of the competition. ;) We need your input!

"Introduce dynamic object translation API (optimize this!)" http://drupal.org/node/141461


Random ID Generation Write up

public
Souvent22@drupal.org - Tue, 2007-04-24 02:58

So, I've had a few inquiries over the last few months about random node generation as I have implemented it successfully for a client. I have posted a full write up of it on my blog. Feel free to comment on it here or on my blog; I will post a patch when I have a chance and if there is interest.

Article link: http://earnestberry.com/node/13

Module "Black-Hole" revival

public
Souvent22@drupal.org - Tue, 2007-04-17 20:55

There are a "LOT" of contrib modules out there. Even more so, there are a great deal of good modules that have been neglected. Lets be honest, a developers time is precious, and we all get spread thin and a bit scattered sometimes, and we leave our children (modules) to the way side for other things (like "bill-paying" modules/development so we can eat from time to time :) ).

Use lowercase constants

sun's picture
public
sun - Sat, 2007-03-24 15:26

Status: not approved

Synopsis

true is faster than TRUE, also applies to FALSE and NULL


Syndicate content