如果放弃对JS / AJAX引擎的支持,CakePHP的性能是否会受益? [英] Would there be benefit in CakePHP performance if it dropped support for JS/AJAX engines?

查看:55
本文介绍了如果放弃对JS / AJAX引擎的支持,CakePHP的性能是否会受益?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主要问题:

如果从JS帮助器中删除了对CakePHP性能的影响(即更快的视图渲染),是否有实际影响?

我的推理:

现在,CakePHP具有一些允许程序员使用PHP创建基本的客户端代码,用于效果和AJAX请求。

Right now CakePHP has a few classes that allow a programmer to create basic client-side code using PHP, both for things like effects and AJAX requests.

与View对象存在一些耦合,这可能会降低性能

There is some coupling with the View object, which could be degrading to performance.

考虑到许多框架都在朝着RESTful模型迁移,因此通常很难跟上客户端框架的变化,而又将它们耦合在一起

Considering that a lot of frameworks are moving to a RESTful model and in general it is hard to keep up with the changes of the client-side frameworks, while coupling them with the server-side framework, like CakePHP.

我想知道是否值得放弃对JS / AJAX的支持并专注于PHP框架模式。当然,我们失去了通过助手编写一些JS代码的能力,但我认为最好还是留给JS框架。

I am wondering if it's worthwhile to drop support for JS/AJAX and focus on PHP framework patterns. Of course we lose the ability to write some JS code through the helpers, but in my opinion it is still best left to a JS framework.

好处是减少了耦合,减轻了重量并可能改善了性能。

The benefits are reduced coupling, lighter weight, and possibly improved performance.

推荐答案

无论如何,JsHelper都将从3.0的核心中删除:)我怀疑是否会在性能方面进行重大改进。该决定背后的主要原因是生成的js代码的php包装函数功能非常有限,您迟早会发现它妨碍了您的工作,而不是加快开发速度。因此,决定删除JsHelper并减少要维护的代码。

JsHelper is going to be removed from core in 3.0 anyway :) I doubt there be any major performance enhancement. The main reason behind the decision is the php wrapper functions to generated js code have very limited functionality and sooner or later you will find out its gets in your way rather than speeding up development. So it's decided to remove the JsHelper and reduce the code to maintain.

这篇关于如果放弃对JS / AJAX引擎的支持,CakePHP的性能是否会受益?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆