[support] views' block or custom block ?

Jamie Holly hovercrafter at earthlink.net
Wed May 26 15:04:55 UTC 2010


Adding additional modules also adds some overhead though. You got the 
PHP parsing having to run through that file (helped some with op-code 
caching), as well as another hook_block to call and process in this 
case. So I would say the performance difference between the two 
scenarios would be hardly noticeable. In this case, where views is 
already used, sticking with views would give the added benefit of less 
code to maintain also.

Basically if they weren't already using views, I would suggest going the 
custom module route; Views would be overkill for such a simple purpose. 
Since they are already using views though, go ahead and utilize it and 
make life a little simpler.

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net


On 5/26/2010 10:28 AM, Amit Vyas wrote:
> In a performance context, custom module block will be the best 
> solution as per my understanding. Because you are not storing your 
> block code in the database in that case. It is always good not to 
> store code in the database so if you are creating a view [which is 
> easy to implement but not recommended for performance point of view] 
> then it will store the code in the database.
>
> On Wed, May 26, 2010 at 7:45 PM, Michel Morelli 
> <michel at ziobuddalabs.it <mailto:michel at ziobuddalabs.it>> wrote:
>
>     Hi all, I have a big site on a not so good server machine.
>
>     Now I need to create (and display) a block with the last entry of a
>     particular node type (call it "foo").
>
>     I can do this in 2 ways:
>     - views (with template files)
>     - custom module with costum block section
>
>     In a performance context which is the best solution ?
>     I use views in the site so this will not be the only view, and I use
>     other custom modules so the block section will be part of one of them.
>
>     Tnx.
>
>     M.
>
>     --
>     Michel 'ZioBudda' Morelli michel at ziobuddalabs.it
>     <mailto:michel at ziobuddalabs.it>
>     Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax)
>     Telefono: 0200619074
>     Telefono Cell: +39-3939890025 --  Fax: +39-0291390660
>
>     http://www.ziobudda.net                         ICQ: 58351764
>     http://www.ziobuddalabs.it                      Skype: zio_budda
>     http://www.ziodrupal.net                        MSN:
>     michel at ziobuddalabs.it <mailto:michel at ziobuddalabs.it>
>                                                    JABBER:
>     michel at ziobuddalabs.it <mailto:michel at ziobuddalabs.it>
>
>     --
>     [ Drupal support list | http://lists.drupal.org/ ]
>
>
>
>
> -- 
> Regards,
> Amit Vyas
>
> Email  : amit.vyas at blisstering.com <mailto:amit.vyas at blisstering.com>
> Mobile : +91 993-040-1490
> Skype : vyasamit2004
> Twitter : amit_vyas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100526/4a7676fd/attachment.html 


More information about the support mailing list