April 25th, 2005

Struggling to optimize php/mysql performance

News — After numerous trials and errors meant to increase the sucky performance of this web site, I installed wp-cache and I am testing a semi-static plugin based on Jerome's new version of preformatted.

I understand the end result is tons times faster than LightPress currently allows at present.

Nonetheless, I expect LightPress will be faster when Ludo starts adding caching. I'll likely make the switch at that moment, if it is compatible with my plugins. Unless Michel Fortin persuades me to make the switch to Reflex.

Filed under Blog, WordPress by

Print

Comments on Struggling to optimize php/mysql performance

April 25th, 2005

jerome @ 9:51 pm

Denis, thanks for all your help with PreFormatted!

Your plugins will be compatible with LightPress if they are back-end only (or can be made so through PreFormatted). The WP filter/action system, while clever, is also monstrously inefficient. Ludo has done a great job with the LP plugin architecture and is continuing to expand on it.

You'll find that writing frontend plugins for LP is a easy and uses far less code thanks to the template system. I've already written five so far.

Denis de Bernardy @ 10:17 pm

Yeah, I reckon WordPress is not the most efficient code I've seen in my life. I find cruft and overhead everywhere each time I look under the hood. But it is a neat tool nevertheless.

Can you introduce template tags via plugins using LightPress? If so, I think there might be excellent synergie between Ludo's (and your) work on LightPress with the work I am doing on my template.

Slowly but steadily, I'm recreating a set of template tags for WordPress that are XML-based rather than HTML-based. They feature built-in caching a bit like preformatted, but take the logic a step further.

for instance, you would call them like:

`< ?php display_post('xslt=post_template.xsl'); ?>`

Each tile would then make 2 versions of the results: one for the priviledged user (may edit), and one for the end user (may not). And store a cached, fully formatted version of the end result rather than just the `post_content`.

In the next major version of the theme, for instance, this page would feature the following tiles:

- In the header area:
- `display_tagline()`
- `display_header_nav()`
- `display_search_form()`
- In the footer area:
- `display_copyright()`
- `display_footer_nav()`
- In the main area:
- `display_post()`
- `display_comment()`
- `display_comment_form()`
- In sidebar area:
- `display_recent_posts()`
- `display_recent_updates()`
- `display_recent_comments()`

This would work a bit like staticize. But localized to a tile rather than to a page.

jerome @ 11:09 pm

(this "subscribe to comments" feature is quite handy)

Plugins can assign template tags or override tags set by the frontend engine. You can also set blocks (a repeatable construct, can be nested too) and replace tags with the content of another template file if you wish.

For example, you could put a tag in your main template `{PLUGIN_SEMIOLOGIC_CONTENT}`. A plugin could then replace this with the contents another template file (i.e. a "tile") or hide it if it's not required in the current context.

Does that make sense?

Denis de Bernardy @ 11:54 pm

Yeah, a blog without a subscribe to comments is like a forum where people stop by, drop a line and never return for the answer. It just makes no sense.

I'd have readily added the rss feed to the comments of individual posts as well, if I hadn't noticed the behaviors on my log files: Some users ping every 15 minutes, and many more do not unsubscribe from dead feeds — for instance, I've still two dozen subscribers to /cats/columns/feed/, which I dissolved when I decided to use static pages for my resources section.

The nested blocks make perfect sense. Odds are he already did something similar to what I'd like my tiles to do in the future.

April 26th, 2005

jerome @ 12:16 am

What plugin are you using for this? I don't see it in your list…

The templates are pretty neat and have greatly improved since the first release. The experimental CVS branch shows the direction that LightPress is taking towards very a modular, plugin-driven architecture.

Denis de Bernardy @ 12:25 am

the tiles are in my theme's bundled plugin. :)

my current unstable version is ~30k.

jerome @ 12:30 am

Oh, I meant for the comments subscription.

Denis de Bernardy @ 12:42 am

Oh, it's the subscribe to comments plugin from wp-plugins.net. I've yet to redo my comment form to take advantage of the subscribe without commenting feature it introduces.

Denis de Bernardy @ 1:08 am

Sweet! I got wp-cache working with bad behavior and referral karma. Though I'm not sure referral karma will stay around very long… It looks as if the black list is going to stay disturbingly empty.

May 2nd, 2005

jerome @ 6:55 pm

LightPress 1.0.0 has just been released.