The first lines of imagecache_textactions.module and imagecache_textrender.module include some seriously crazy code...

imagecache_textactions.module:

  cache_clear_all('imagecache_actions', 'cache');

require_once(dirname(__FILE__) .'/utility.inc'); // For simple color routines

imagecache_textrender.module:

cache_clear_all('imagecache_actions', 'cache');

// For simple color routines
module_load_include('inc', 'imagecache_textrender', 'utility');

This is actually close to being retarded!

CommentFileSizeAuthor
#6 imagecache_actions-1266864-#6.patch408 bytesjonhattan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NancyDru’s picture

Priority: Critical » Major

First, there is no need to insult the maintainer. Second "critical" means "site down;" since this is all optional, it is not "critical."

dman’s picture

Title: Serious flaw in the code » Serious flaw in understanding
Category: bug » task
Priority: Major » Minor

:-/
In what way did the original code fail to work for you? Do you fail to see what it's doing?

In Drupal4 and Drupal5 - where this modules history lies - you'll find a hundred examples of similar working code. Module_load_include() became available as an alternative comparatively recently. In fact, many modules naively used to include(sites/default/modules/modulename/lib.inc) and this method was - at the time - a vast improvement.

It is not a bad idea to replace that line with updated code, and that can be done in the normal course of events ... but as it stands it's not actually broken in any way I can see.

dman’s picture

Status: Active » Closed (cannot reproduce)

OK, I get it now, you are just trolling.
The files you mention haven't even been a part of 6.x-2.x-dev since the upgrade...

At best, you pulled up some old code from somewhere and found something that - though not wrong - looked outdated.

There is nothing to fix, as all this years code seems be using module_load_include where it should be.

erlendstromsvik’s picture

Just for reference, it is/was the cache_clear_all in global context which is/was embarrasing.

I just now grabbed the 6.x version and code is still there, so it is "is" and not "was".
As for the comment from NancyDru, at the moment of enabling that site went *BOOOM*.

Edit:
So no trolling, just exasperated because working on high performance sites makes downloading modules from Drupal a real painful lottery.

OneExtra’s picture

Issue summary: View changes

You're right - it's really not reasonable to do a cache_clear_all on each page load. I'll deactivate the module on my site.

jonhattan’s picture

Title: Serious flaw in understanding » Serious performance flaw
Version: 6.x-2.x-dev » 6.x-1.x-dev
Category: Task » Bug report
Priority: Minor » Major
Status: Closed (cannot reproduce) » Needs review
FileSize
408 bytes

Still a major problem.

When imagecache_textactions is enabled, each page load performs a cache_clear_all('imagecache_actions', 'cache');. See http://cgit.drupalcode.org/imagecache_actions/tree/imagecache_textaction...

This seems to me a debug line, introduced in 8d32af57.

About performance: this line is directly consuming 12ms and an increase of 0.75MB in the memory usage peak. Indirectly it produces more harm because this cache is always empty (worst than not using a cache at all).

dman’s picture

imagecache textactions was experimental only and terribly unstable in 6.x .
Lots of work on it stopped around the time people started using CSS3 instead.

But yeah, that is just a debug, probably left in there from just before it was ripped out entirely because it just didn't work well enough
Seriously, texteffects were pretty crappy :=}

jonhattan’s picture

@dman I'm doing a performance review to a big D6 site. Just found this bug and posted the patch. I won't discuss crappiness of texteffects :D

I've directed the dev team to apply the patch and moved onto the next task. Whatever you do is fine to me :)

dman’s picture

Yeah we should fix it up - clearly an oversight.
I was just surprised to see someone using 6.x-1.x-dev (and texteffects) today

  • dman committed 757fb1f on 6.x-1.x authored by jonhattan
    Issue #1266864 by jonhattan: Performance flaw in textactions
    
dman’s picture

Status: Needs review » Fixed

... hadn't touched that branch for three years.

dman’s picture

I also see that the reason the original issue was closed was because it had been reported against 6.x-2.x - where the problem no longer existed, and therefore could not be found or fixed.
The actual issue identified now was in the another branch - 6.x-1.x-dev - (and not even the 6.x-1.?-stable) so it could not be found back then.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.