by Mahn · 13y ago · 0 comments
The library is used about once every 3.5 lines, which feels less dense than most jQuery code I see, but that whole function runs 3 times slower than the plain MB-aware equivalent.
Some of the library functions might be implemented inefficiently but from a quick glance they're nearly all very thin wrappers.
Overhead from libraries like Symfony and ZF is quite acceptable since they offer much higher level features which you'd have to code yourself otherwise.
However making all your code (excluding I/O) run up to 3 times slower, just to add some syntactic sugar, is insane.
$len = mb_strlen("wtf");
# call function mb_strlen
$len = s("wtf")->len();
# call function s
# allocate string object
# instantiate string object
# call string ctor
# set property
# call method len
# get property
# call function mb_strlen
# destroy object
There's no way to use a syntax like this without either massive overhead, or massive changes in the engine.There is a somewhat similar experimental project - https://github.com/nikic/scalar_objects - but that's not meant for real world use either.
Personally I think the language, despite its flaws, does its job fine. I don't think it needs turning into Javascript-with-sigils.
This project is just replacing a function call with a method call -- it's all overhead.