Unbelievely fast. Really?


Bean framework is claimed to be Unbelievely Fast. I wonder how it can be that much fast even when major portion of html is being generated using php (i.e HTML API). Can someone justify the claim of being Unbelievely Fast?


Hey Prog,

Let's look a little bit out the cicle to output a page.

  1. WordPress Core run all its root PHP processing.
  2. Plugins run their PHP processing.
  3. Theme run its PHP processing.
  4. Page is output based on all processing done.

The 3 first steps are what really matters for the DOM to be output (not yet speaking about assets loading). Let's leave WP Core and Plugins processing out of the equation for now.

Each theme run some PHP processing before loading the template, even the simplest themes with not hooks or customization possible. Beans does the same in a very intelligent manner only processing the strict minimum while providing with a tone of flexibility over everything single element on the page. So how does it do it? It users actions and filters for each element on the page (which is what makes it so flexible) and output the document based on that. Is it fast? Yes it is, really fast in fact! Why? Because all it does is storing all element in a an object (WP global filters and actions object) and render the document based on that, a bit like a document would be rendered based on a REST API response.

The second reason why Beans is so fast is the ability to load UIkit components as you need (see this article). Lot of themes using on UI framework load the entire library, Beans doesn't. Instead it let's you load only what you need, on a per page basis. Moreover, it automatically compiles the components you need into one files, keep your http requests to the strict minimum.

Last but not least, Beans has a slick Image API to allow devs to create multiple images size accroding to their needs, thus making sure that correct images sizes are loading and provide an easy tool to do repsonsive images.

I wonder how it can be that much fast even when major portion of html is being generated using php (i.e HTML API)

There is a balance between usability, productivity and performance. I bet you can have a faster site by not using PHP, create static files and write the strict minimum CSS and JS, not using WordPress at all. Will it be a nightmare to maintain? Absolutely! Is it flexible? Not at all! Is it a good idea? Maybe for a one page project! On top of that, site built with Beans using proper page caching will still equal static files loading time if not beat it πŸ˜‰

So why is Beans so good? Well it allows you to create pretty much anything due to its HTML flexibility as well as the power of UIkit without compromising on having the entire UI framework loading as explained above. To achieve what you can do with Beans, you would have to use multiple of plugins or third party libraries. If you look the the initial cycle, adding plugins will endup using PHP ressource ( a lot more that Beans HTML API) and considerable decreasing your page load in the end.

If you want to do some testing, take Tweenty Sixteen (no flexibility), Genesis and other much more ressource intensive framework such as Visual Builder and check the PHP ressource used and loading time πŸ˜‰

I hope that makes it a bit more clear, I am happy to dive deeper if you have any specific questions.

Happy coding,

Write a reply

Login or register to write a reply, it's free!