I was just working on some theme related functions, and I see that there are quite a few large text variables which are getting passed around to a few functions. Has anyone every considered passing more of the large text varaibles by reference to speed up drupal, and lower its memory usage?

The main problem is this, when you pass by reference there is a possibility that the original text may get changed. So there would have to be some sort of comment to say if a variable is modified at all.

Comments

jonbob’s picture

Component: 0 » base system
bdragon’s picture

Version: » 4.5.0
Status: Active » Closed (works as designed)

PHP doesn't actually copy strings until they are modified.

bdragon’s picture

Status: Closed (works as designed) » Closed (fixed)