PHP Classes
PHP Classes
elePHPant
Icontem

Compiling PHP into Optimized Machine Code - Lately in PHP podcast episode 52

Recommend this page to a friend!
  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Compiling PHP into Op...   Post a comment Post a comment   See comments See comments (2)   Trackbacks (0)  

Author:

Updated on: 2014-10-18

Posted on:

Categories: PHP Performance, Lately in PHP Podcast

The recent release of a new PHP compiler written in PHP by a Google PHP developer, as well other solutions to compile PHP into optimized native machine code, is one of the main topics discussed by Manuel Lemos and Arturs Sosins on the episode 52 of the Lately in PHP podcast.

They also discussed the latest proposals for new features of PHP 7, as well the new MySQL plugin that allows accessing MySQL servers directly with HTTP exchanging data in JSON format.

Now listen to the podcast, or watch the hangout video, or read the transcript to learn about the details of these interesting PHP related discussions.




Contents

Introduction (0:20)

PHP 5.4.33 and 5.5.17, PHP 5.6.1 releases (1:44)

RFC: Removing Alternative PHP tags (4:49)

RFC: Conditional Loops (6:41)

Proposal: Faster Data Type Serialization with msgpack (8:29)

RFC: Null Coalesce Proposal (13:45)

RFC: Fail on Number Operations Overflow (16:25)

PHP Developer working for Google Launches New PHP Compiler (20:04)

MySQL HTTP plugin (36:19)

JavaScript Innovation Award of July 2014 (42:27)

JavaScript Innovation Award Rankings of 2014 (46:37)

PHP Innovation Award Winners of July 2014 (49:44)

PHP Innovation Award Rankings of 2014 (59:23)

Conclusion (1:06:51)


Contents

Listen or download the podcast, RSS feed and subscribe in iTunes

Watch the podcast video, subscribe to the podcast YouTube channel

Read the podcast transcript


Click on the Play button to listen now.


Download Size: 56MB Listeners: 1796

Introduction music Harbour used with explicit permission from the author Danilo Ercole, from Curitiba, Brazil

View Podcast in iTunes

RSS 2.0 feed compliant with iTunes:

http://www.phpclasses.org/blog/category/podcast/post/latest.rss

In iTunes, use the Subscribe to Podcast... item of the Advanced menu, and then enter the URL above to subscribe to this podcast.

Watch the podcast video

Note that the timestamps below in the transcript may not match the same positions in the video because they were based on the audio timestamps and the audio was compacted to truncate silence periods.

See the Lately in PHP podcast play list on YouTube and Subscribe to this channel there.

Show notes

Introduction (0:20)

[Music]

Manuel Lemos: Hello. Welcome to the Lately (very delayed) In PHP podcast hangout. After yet another long struggle with Google to be able to record this hangout, we finally made it. I think at least, we were able to finally start it. We still have many interesting PHP topics to comment about.

This time again, I have here with me, Arturs Sosins, from Latvia. Hello, Arturs. How are you doing?

Arturs Sosins: Hello. I'm actually quite nice, comfortable sitting, waiting for an hour to start the hangout.

Manuel Lemos: Oh, more than an hour, actually.

Arturs Sosins: Yeah, probably more than that.

Manuel Lemos: Very long struggle. This is like fighting the boss monster at the end of the level.

Arturs Sosins: Hope it's worth it.

Manuel Lemos: Let's see if we can defeat it. At least for now, my webcam is working. It is not being disabled by some stupid bug as in the previous months. I also hope my microphone is working better than the other in the other computer, which was not very good. Because there are some people complaining, so I hope now it's better.

PHP 5.4.33 and 5.5.17, PHP 5.6.1 releases (1:44)

Manuel Lemos: Now, back to the actual topics of this hangout, we are going comment on several interesting events and proposals for upcoming versions of PHP. But first, we start with the latest releases of PHP. As usual, we had several releases of PHP 5.4 and also 5.5, and then, there is already 5.6.1.

Regarding the 5.4 and 5.5, I don't see much in terms of relevant things that are worth mentioning because these are mostly bug fixes. For 5.5, it is almost same set of bugs that was fixed. OK, that is it.

Actually, I think 5.4 is already in security fixes mode, if I'm not mistaken. So these means that the fixes that are same are actually security fixes. But they are now bugs fixes that are not security-related, if I got this right.

As for 5.6.1, I was trying to look what could be new, other than the usual set of bugs being fixed. Yeah, there is some functionality improvement, but I don't think there are much, much to comment about.

Arturs Sosins: Nothing much specific.

Manuel Lemos: Yeah, because this is yet another maintenance release. Once the main PHP 5.6.0 was released, it starts getting the usual updates in terms of bug fixes and few future improvements here and there. But at least in my point of view, I don't see nothing really worth mentioning.

Arturs, what do you think? Have you been trying this PHP latest version, 5.6? Or you are in another wave?

Arturs Sosins: Yeah, fortunately, or unfortunately, I'm starting to move a little more far away from PHP. So still using it for some projects, but now my work is now related more to Node.js.

Manuel Lemos: You are a traitor.

Arturs Sosins: Well, it's not Java. It's not that bad.

Manuel Lemos: Yeah, it could be worse. It could be worse.

Arturs Sosins: Yeah.

RFC: Removing Alternative PHP tags (4:49)

Manuel Lemos: Given that, we're now going to move on and comment about the usual set of proposals that are being made lately, mostly in September. So there was a proposal to remove alternative PHP tags, and this is made for PHP 5.7. These tags are something that are sort of influence of the ASP world, namely these ones with percentage (%) values. Personally, I've never used these tags, or at least as I remember.

Arturs Sosins: Me neither.

Manuel Lemos: Well...

Arturs Sosins: That basically extends it.

Manuel Lemos: ...but I don't know if other people use it. Probably people that came from the Windows world. I don't know.

Arturs Sosins: Maybe.

Manuel Lemos: Well, you said you've never seen these tags.

Arturs Sosins: No.

Manuel Lemos: Well, at least, I have never seen them in PHP code, in my PHP code. Even in PHPClasses that are submitted, I do not remember having seen this. But OK, maybe some people like to use them because, at least, these ones with % signs are shorter to type.

Well, OK, I do not miss them. So this proposal, which is by now already approved with the vast majority of the votes in favor, probably will not be a big deal to almost anybody in the PHP world.

RFC: Conditional Loops (6:41)

Manuel Lemos: So moving on the next proposal that was submitted last month. There is one here called "loop + or control structure", which is... Personally, I'm not sure if this is really, really important, because it's just syntactic sugar I think.

The idea is to have an alternate section of code that would be executed if a loop is never started because the condition is never true, I mean a while loop. So instead of this, it would be like this for... Is it for or is it... Oh, I think it's for any of these for, while and foreach. I don't know if this is that important.

Arturs Sosins: It's one of those nice-to-have features that could improve because otherwise you need to prove the surrounding 'if' statement with the same condition, writing the same condition twice. Maybe not so more if you change it right away, if you change it in two places. So from that starting point, it could be usable. But as it is nice to have the feature, as I already anticipated, it was voted down No. Right?

Manuel Lemos: I was trying to figure if this is the final result, but most of the people that voted, voted against it, because it really, really does not have anything. Probably will make the parser more complex.

Arturs Sosins: Complicated.

Manuel Lemos: The benefit of it is not a big deal, I think.

Proposal: Faster Data Type Serialization with msgpack (8:29)

Manuel Lemos: OK, moving on to another feature. Actually, this is a proposal. I didn't even see really...

Arturs Sosins: Voting?

Manuel Lemos: No. Is there a RFC for this? Maybe there is one later. But, basically, I think this proposal is not really new, for years people have been trying to propose faster methods to serialize data types, usually use the serialize function.

Some people claim it is slow. When you use the serialize function, probably, you are not using performance critical code. That is more to store a data type in some storage, and the process of storing the data is actually slower than the serialization method.

But there might be some cases on which the serialization method has to impact in a greater way the performance of the whole process. So the proposal here is to, instead of using the regular serialize format, to use the msgpack format which is more compact. Actually, it'd be faster to serialize and unserialize.

Arturs, did you know this msgpack format?

Arturs Sosins: No, I'm not really much familiar with serialization libraries but my stand of point, if it would really faster and compress it with less size, it should be added. The problem is if it is backward compatible to what is already used, maybe internally, on some libraries. And I understand, the email rate is huge too and maybe that's why it was not yet officially proposed for voting.

Manuel Lemos: Yeah, they are just discussing it. There is actually a site here that tells more about the format and they're just specification. It seems to use more binary data to represent certain values. So, it would take less space also.

And this probably is more interesting for applications on which people are doing crazy things like serializing a large nested of arrays with lots of data. Well, maybe, in those cases, it will be more to ask, do you really need to serialize that much data in a string? Or should you move on to more efficient methods to deal with large amount of data?

Arturs Sosins: Like database.

Manuel Lemos: Well, maybe. I don't know. Database could be also a storage format. But I think people should question what they are doing if that is really a solution for what they are doing, rather than changing the method of the things they are doing.

Manuel Lemos: OK, let's move on here. I was talking about this improvement serialization for PHP 7. I think these discussions are still going on, or maybe they stopped. But if nothing was decided, I think this topic will return again and again until somebody finally decides to implement this, because it has happened with several other topics. And not just with serialization, but many other topics are going to return because people are persistent.

Things like named parameters, they are going to return, despite they were denied over and over again. I think people have seen it in Python and also want to use it in PHP. Although they are very similar to associative arrays with less quotes. Anyway, in this case, this proposal for serialization is more oriented to achieve better performance, more space efficiency. Let's wait and see if there is any new evolution on this topic.

RFC: Null Coalesce Proposal (13:45)

Manuel Lemos: And the next topic is a proposal that I think it was being proposed over and over again, and finally it was approved somehow for PHP 7. They call it Null Coalesce Operator, which is basically to create an expression to have two possible values. If one value is false or null or zero, or whatever, it picks the other. The expression will be more less like this.

Arturs Sosins: And that is actually something that was missing quite a lot in PHP compared to other languages because many times you need to validate user data and provide a default the value if it's not set.

Manuel Lemos: Yeah.

Arturs Sosins: That is really an awesome thing to do. But in my opinion, they could choose more comprehending operator like OR statement or something like that.

Manuel Lemos: They probably had some reason to match with the OR operator.

Arturs Sosins: Probably.

Manuel Lemos: Anyway, this way, it will become a bit more unreadable in my opinion. Probably, people will find it odd to have this in PHP, but OK. It will be one less excuse to defend other languages. No... PHP, they also has this feature.

Actually, I have not been missing it. I would like to make my code more verbose, more like this, so I understand what I'm doing. It's not just like this for me. It looks like an accident. Maybe that's because I'm not used to this syntax, so the problem...

OK, well, anyway, this was voted and was approved. So it will be...

Arturs Sosins: You may not use this if you don't want to.

Manuel Lemos: Yes, I have that option. Like everything else. But given that logic why certain things are approved, the others don't, just because. Even better, users in the end will have an option. So there is always a discussion here and there but this one was finally approved. I think they are now collecting new features to talk about in PHP 7, or else it will not be really, really new.

RFC: Fail on Number Operations Overflow (16:25)

Manuel Lemos: OK, then moving on, there is another proposal here. I think this is related with implicit typecast values that are done with type hinting, when you pass values to a function.

Now, that type hinting will be supported for integers, I mean scalar values in general, so for some reason, you pass a value that is superior or inferior to the range that is allowed for integer values... you are passing, for instance, a double or maybe a big integer... I think the idea is throw an exception. I was trying to confirm it but I could not figure. Implementation... Proposal.

Well anyway, if you try to do it and there is an overflow, something bad will happen. I was trying to see if it was an exception or a fatal error, or whatever.

Arturs Sosins: I think there was another proposal we covered in some previous PHP podcast, that proposed to have different types, like a big integer to read from a database ID. I remember something like that, so maybe it's something related.

Manuel Lemos: Well, I'm trying to find.... OK, I was looking in the wrong window, because previously, I tried to enable this question-and-answer feature of Google Hangout. Because there seems to be people trying to interact, but they are not able to.

So, I tried to send invitations but they were not able to join, so unfortunately, those that are trying to participate, their Google+ is not collaborating. It is not allowing other people to interact. So I'm sorry but this is really, really bad. Every month there is a new bug. I don't know why it failed to enable the chat with the people.

Although, I don't know if you can see differently, Arturs.

Arturs Sosins: Differently from what?

Manuel Lemos: Yeah, you don't see anything in the chat, because supposedly people that are watching, they could comment on the hangout event. And we would see on the chat sidebar, but it is not working.

Arturs Sosins: Says "Q&A is disabled".

Manuel Lemos: Yes, Q&A is also the chat. So we need to move on. We're talking about the Null Coalesce Operator which was approved. And then, we moved on to the overflow.

So the idea here is to detect eventual bugs that will happen when implicit conversion within integers and floats are happening. Actually, they are mentioning passing through internal functions, so it may not be just the type hinting implicit conversions.

PHP Developer working for Google Launches New PHP Compiler (20:04)

Manuel Lemos: Then, moving on, now, we are going to comment about an article, that actually I posted but it is related with a new PHP compiler that was developed by Anthony Ferrara. Recently, he started working for Google, but...

Arturs Sosins: PHP developer for Google, wow.

Manuel Lemos: He's working for Google as developer advocate, and it was not really clear if this was a Google project or not. So I contacted him and he clarified that in reality, it is not really a Google project because it is his own initiative.

But since he's using his 20% of the work time that Google allows employees to work on projects of their choice, all the copyright notices and contributor and license agreements that have to be signed mention Google. So, it's his project but in reality Google owns it, because he's building it on Google's time.

Anyway...

Arturs Sosins: Google pays for it, yeah.

Manuel Lemos: It doesn't affect the fact that it is very interesting, this project. As a matter of fact, I've been noticing that Anthony Ferrara has been making very interesting contributions.

Actually, he tried to participate somehow in the PHP Internals in the past, and he was not really happy with the way things flow. Which is not a new thing, because since ever, many people just go there don't like the cinic environment that goes on the PHP Internals. Sort of some people are dedicated to boycott each other.

Arturs Sosins: Yeah.

Manuel Lemos: And some people are not really very patient with that, and they move on.

I think Anthony wrote an article about that, so unfortunately, he's not contributing there as he could. But now, he's working for Google. I'm not sure what his exact role that he plays in practice. It is said to be developer advocate. Maybe he participates in some events representing Google interests on supporting PHP somehow.

But this is not really related to this topic of the compiler tool that was developed named Recki Compiler.

So what it this project? In practice, it is able to compile PHP code. Not necessary all your applications code. You can just compile parts of your code. It uses a process of building an Abstract Syntax Tree. It actually he used a PHP-Parser that is totally written in PHP.

Actually, the whole project is written in PHP, although it depends on an extension called JIT-FU for emitting native code using library called libjit.

So, apart from those steps of generating native code, it is all completely written in PHP, and it uses this PHP-Parser library by Nikita Popov. And Nikita Popov has actually proposed and submitted code for implementing an Abstract Syntax Tree that would be built in PHP 7. So this is sort of the PHP version of that Abstract Syntax Tree library.

The result of that step, of building an Abstract Syntax Tree allows to apply some optimizations in the code. The result is code represented in an intermediary format, which is not the final native code. And that intermediary format is passed to the JIT-FU extension somehow to finally generate optimized native code.

This process is not really fast, especially if you have lots of PHP code that you want to optimize. So, the idea is to use a caching layer that once it is compiled, you don't have to go through it again. It will be ready to be executed from your PHP code.

So you can compile parts of your PHP code and then it compile in their native format. And you can call it like you'd call it a closure function in PHP. You get a closure handle, if you can call it that, and then you call it as you call any closure functions in PHP. And that's how the code that is in regular PHP can call native code, compiled this way.

Arturs, have you been following this project? What are your opinions about it? Do you think it's useful? Interesting?

Arturs Sosins: I actually only heard of it from your blog post, so thank you for making it. I probably would have missed it. Well, I was actually quite fascinated by the result, if the result that was provided on the code are true, then it outperforms old, currently known optimizationd of PHP.

And it is done in such a simple way that you basically don't need much else to accomplish it. You can do it with existing tools, existing libraries in basically any PHP installation that you have. And you can pre-compile the code, and then deliver already compiled code, so skipping this step. So that's how you can do to differentiate between development server and production server. So, it has great advantage to it.

Manuel Lemos: Right. Well, the results that he published in the blog article that Anthony wrote were actually pasted without change in the article that I wrote about it. As you may see, you can see lots of cases on which the results of the Recki-CT compiler are faster than other solutions, including HHVM and other less know solutions like Hippy Compiler, Hippy-VM Compiler and this qb. I do not recall what it would be.

Anyway, there are several things that are worth mentioning. First, this FAIL notices that appear here mean that the code could not be compiled for some reason, for some limitation of the current compiler that is not yet ready to support some code that was calling these tests.

These tests, I'm not sure, but I think these are some, a simple test suite that comes with PHP to evaluate performance. I'm not sure about that.

Anyway, there are several function code that were called. And as you may see, these ones in green means that the Recki-CT provided better results. The others that fail means that it is not yet ready to handle the code, because the project itself is very early in its development.

It was actually released in August, but since not many people was talking about it, I thought it would be worth commenting because it's different. It's not the same as HipHop VM or even the latest developments for PHP 7 that aim to bring faster code, greater performance to PHP.

I think it's something that you can use without excluding the others, so exclude the Recki-CT with the HipHop in theory, because it relies on a library, an extension that I think HipHop does not support, which is JIT-FU extension.

But if that extension is supported, it probably would also be supported. I think in this case, Facebook will study what exactly Recki-CT is doing and try to incorporate the optimizations that Recki-CT is bringing and try to make them appear built-in in HipHop VM.

Anyway, this is a solution that in theory, you could use it right now apart from these cases that fail, types of codes that fail for now. You can use it in your projects as long as you have the JIT-FU extension installed in your PHP environment.

Another aspect, most of these... or even all of these tests... that are being done here are basically tests that were done with code that is mostly CPU-intensive. So that's not the typical...

Arturs Sosins: PHP application?

Manuel Lemos: Yes. Most PHP applications access databases' files, network, and those are asynchronous that depend on external systems. For instance if you access the database. If you run your code, PHP code, faster, you'll hardly notice the improvements because the actual database queries will be running on the server and your PHP code will not make the server run faster.

You can benefit from some improvements when pulling results and maybe assembling queries and send data to the server, but it will not benefit much from that.

Anyway, I think this is an interesting development. Since nobody was noticing it much, I thought it was worth writing an article. Many, many people enjoyed it and were very happy, re-tweeted and shared it on Facebook and Google+ because they were very happy with this development.

Other than that, I think this 2014 has been a great year for PHP in terms of new possibilities to improve its performance. First, we had the HipHop VM, and then the Facebook Hack language that sort of bringing new life to PHP, although the Hack language is not exactly PHP. It's something backwards compatible, but if you want to move your code to the Hack language, you probably will not be able to switch back without some conversion efforts.

Anyway, it was an interesting development. And then, there was the development of Zend that wanted to bring also substantial performance improvements to the next PHP version... I mean, the next major PHP version, which will be PHP 7.

Other than that, there's also Hippy-VM. I did not talk much about it because that was not the focus of the article but it's basically a sort of similar project to HHVM, except that it relies on the PyPy technology, which is basically very similar but was meant mainly for the Python world. I don't know enough about that project, so I better not comment more than this.

And then, there are other projects that are less important but they also focus on performance. Anyway, I think this is interesting. I don't know if you wanted to add any other comment, Arturs.

Arturs Sosins: Well, I mostly already said what I thought about it. The only thing I could mention that was also in your article, that it would also obfuscate the source, the precompiled code, which here I think is one of the type of business models in PHP code. Once knowing the sources, you need to somehow obfuscate it and it could...

Manuel Lemos: Well, it was not really, really meant for that purpose but I think there's a possibility because once the code is compiled, it can certainly how it would be distributed that way, because it would be ready to run. I don't know if it is portable, the compiled code... the native code that is compiled. Because there is that challenge that once you compiled to a certain CPU, you probably have done some CPU-specific optimization that you'll not be able to use in other CPUs.

And even when we are talking mostly about x86 CPUs, although the code for one CPU eventually will work for another, maybe there are optimizations that take advantage of more modern CPUs. It probably will make the code not as portable as it could be.

Anyway, that's just a possibility, since it was not really meant for that purpose, maybe it was not really important to think of that possibility as a feature.

MySQL HTTP plugin (36:19)

Manuel Lemos: Anyway, moving on to another topic. This one is not exactly about PHP but I think it interest most PHP developer. And not just PHP, because it is related with MySQL. Recently, it was announced, a new plugin for MySQL server that lets you connect to it using a regular HTTP connection.

You can use a browser, but you can also use socket connection. You can use HTTP client to connect to it and execute queries just like you would with any Web server. But, in this case, you could send SQL queries.

It uses JSON as format to communicate with the server. JSON may not be the fastest format, more complex format to use, but it is portable. For applications that are not performance-intensive, the overhead of using JSON as communication format, it is not a...

Anyway, I thought it was interesting. Arturs, I don't know if you follow this development. Do you think it is interesting for the PHP world? Or maybe not that much?

Arturs Sosins: I would say it could be more interesting for JavaScript world, because previously, if you would want to access MySQL database from JavaScript, you would need to setup a server side... REST API, for example... and programming it to be that way or where PHP for example.

Manuel Lemos: You mean communicating from the browser directly?

Arturs Sosins: You couldn't do it, I think, from the browser directly. There is no MySQL driver for JavaScript, as far as I know, so it would be through server side either way. But now, it basically behaves as a REST API and simply can send HTTP requests directly to the database without programming the backend PHP, skipping the Web server part.

So it would be probably also locally on the same machine. And it communicates in familiar manner, that you could also execute SQL queries. The only thing that I'm kind of concerned of is security.

Manuel Lemos: I think it's not really meant to be called from the browsers.

Arturs Sosins: Yeah.

Manuel Lemos: It's more like be called from Node.js or something on the server side because authentication will always exist. So if you want to connect to a database from a browser, even if you can make it, you have to have the username and password. And if you put the username and password in the browser, that probably causes some security concerns. I don't think that is the use they are thinking for this project.

I think this is more to say like, now, you can do as CouchDB that uses JavaScript and JSON to exchange data with the server.

I think that's more to become on par with that because, personally, I don't see an application for this. Even because it's less, it's less efficient to have exchange data. So for queries that exchange lots of data, probably it will make it slower.

Arturs Sosins: Recently, as I started to learn Node.js...

Manuel Lemos: Well...

Arturs Sosins: I was working at some examples, and it was awesomely easy to create REST API with Node.js because with using MongoDB, like NoSQL on the server side because you simply take JSON, you put it in, and then you take JSON out and then you output it. So there is no modification, you can create a REST API that manipulates whole documents.

Manuel Lemos: So you don't have to call that complicated function that is named json_encode.

[Laughter]

Arturs Sosins: It's really a little code to do it. So you can basically put all JSON documents and it would automatically put in database and things and mount when you need it. So this is something similar, only you don't need any code at all.

Manuel Lemos: Yeah, you don't need that extra function, json_encode, to do that.

Yeah, well, anyway, this is just a curiosity. I don't see many people using this on the PHP world. It's interesting. And even in other worlds, I don't think so.

MySQL also implement memcache interface to perform simple queries to the server. So you could also use it like you use memcache servers. But in this case, you still use your MySQL. So I think Oracle is committed to give you no excuse to use anything else other than MySQL servers.

[Laughter]

Arturs Sosins: Yeah.

Manuel Lemos: This is just an interesting topic. So we're moving on to other topics.

JavaScript Innovation Award of July 2014 (42:27)

Manuel Lemos: Now, it's time to talk about a regular section on which we comment the Innovation Award winners of, in this case, July. Actually, those were voted in August; then, in September, the results come out. So we can start talking about them.

First we're going to talk about the winners of the JSClasses. Arturs, which ones would you like to comment? There's actually two, so just pick one.

Arturs Sosins: I would comment about a really interesting component. So, when you execute your code, sometimes there are bottlenecks. It's working slowly and you don't know why, and you need a way to identify where is the bottleneck, which function is the one that slows the code down.

This package does exactly that. It profiles the function and measures its execution time, so you can the divide your code in this component and measure, trying to find out where is the bottleneck.

There is a simple example provided with the class. There are functions. We simply provide them to the profiler with the parameters we want to pass to the function. In Demo, we could see how it performs.

So it started at specific times, the times it started, and how long did it take for this function to execute. So this kind of component really eases the task to identify the bottlenecks of the code.

The component was created by Tony L. Requena from Spain. Probably, you would know better how to pronounce the surname.

Manuel Lemos: No, that's great.

Let me switch here to the other package that I will comment. Starting the screensharing if it works. OK, the other package that I would like to comment, this one is from Thomas Bjork from Sweden. He has been a great contributor, he sent several packages. From the five that he has sent already, four were nominated to the Innovation Award.

OK, let me scroll it to the right position.

This basically is an optimized version of a component that could load JavaScript and CSS from remote servers. The advantage of this approach is that it uses the localStorage to cache previously loaded JavaScript CSS, or even images, because once they are stored on the browser, next request they are needed, they will take no time to load, and this is awesome.

Somehow we commented about this in a previous JavaScript podcast, this possibility. It's great to see an actual component that implements this approach of caching of these assets in localStorage or SessionStorage, depending whatever is available on your browser. So kudos to Thomas Bjork for his contribution. And for that, he was entitled to pick one book of choice from Packt.

JavaScript Innovation Award Rankings of 2014 (46:37)

Manuel Lemos: Now, I am going to mention about the rankings of the Innovation Award winners of 2014. So far, Thomas Bjork is leading as an individual author with 4 packages and 15 points, and is followed by several other authors like David Castillo from Mexico with 2 packages and 13 points, then Andoitz Jordan Marmolejo with 2 packages and 10 points, and then several other authors with one package. Some with more but with less points.

On the ranking in terms of countries for 2014, so far France is leading with 3 packages and 17 points. It is followed right after by Sweden with 4 packages and 15 points. Those are the same from Thomas Bjork. And then, Mexico, with 2 packages and 13 points, those are the packages of David Castillo. And then, Spain, with 3 packages and 12 points, followed right after by Italy with 3 packages and 8 points, Canada with 3 packages and 7 points, and then several other countries with just one package and less points.

As we may see, the competition is heating up. It is interesting. Actually, the JSClasses site has somehow been affected by Google Search ranking updates in the last two years, and that sort of brought less users to become potential contributors.

The numbers of contributors that had been sending packages, at least in the first months of the year was very slow. The increase in packages was very slow. But since, I think, June, Google did an update on the search rankings and the traffic to JSClasses improved a lot, and that allowed to bring many more packages.

As you may see below... I mean, actually, above... in the next month that we see here, I think it is August, we already see many contributions. I hope these contributions keep coming at this pace because at JSClasses, the potential is to grow a lot, and it just depends on the users to participate.

PHP Innovation Award Winners of July 2014 (49:44)

Manuel Lemos: So given that, let's move on to the PHP Innovation Award. And talking about PHP, first I would like to make a few comments on several interesting things before we talk about the actual nominees.

First, there was a few glitches that were fixed this month. One, it was the fact that the site considered that United Kingdom and Great Britain would be actually different countries. I know that, to be accurate, it's not exactly the same thing, but in practice, the users from United Kingdom were being moved to state that they were from Great Britain.

So we could see on the rankings that United Kingdom and Great Britain would appear there as if they were separate countries, and that would change the rankings of United Kingdom as a whole.

So the problem was fixed. It was due to the fact that the list of countries that the site uses comes from the CIA World Fact Book and they considered Great Britain and United Kingdom as separate regions. Well, to be accurate, they are separate regions, but the actual users are from the same country.

So, that was one issue. Another issue is that the site, in reality, allows nominees, winners, to vote on themselves. If they are on a certain month, they go there on the voting page, they look at the winners, and they think that their own package is the one that deserves to win, they can vote on themselves. But there was a glitch in the user interface that prevented that to happen. That problem was fixed. So, if you are a nominee and you would like to vote on yourself, you can.

And this was a thing that was implemented to allow all authors get some votes. Because sometimes when there are many nominees, most people tend to vote on the same few, and there are some nominees that do not get any votes. So, if they do not get any votes, they are not entitled to pick any prizes. So from now on, at least you can vote on yourself and increase your chances to get a prize.

Given that, now, let's talk about the actual nominees, actually winners, that were from July.

Arturs, which ones would you like to comment?

Arturs Sosins: The first one, I would like to comment on is something that really interests me. While in the university, I had written a research work about alternative ways of how to authenticate user, and there were different interesting ways like using kickbot, using rhythm of typing and stuff like that. And here, Alexandru Ocheana, from Romania, provides another interesting way.

Basically, upon registration, it generates the image. Yeah, here, we can see that image. It generates an image that represents your registration, your account. And then by providing this same image, you can authenticate yourself. So, it's basically like a key card that only you have and you can authenticate using it. That's why I picked this package first.

For this package, Alexandru gets a Zend editor, right?

[Laughter]

Manuel Lemos: Yeah, exactly. No, it's a Zend Studio editor, to be accurate.

Arturs Sosins: Zend Studio editor, OK, yeah.

The second package I would like to comment on is by Francisco del Aguila from Spain. While the most common CAPTCHA implementations are of making texts unreadable, unfortunately to both bots and users, then I usually try to follow what other interesting ideas, and one of the ideas is now provided by Francisco.

So what he does, he generates geometrical figures and inputs the number to them. And then, he provides the correct geometrical figure. So you need to input all the numbers that are in this provided geometrical figures. So it's something you need to figure out, and it's not unreadable text. It's much easier. And basically, that's why I like it.

Francisco gets PhpED Professional editor. It was an editor, right?

Manuel Lemos: Exactly. ED is for Editor. PhpED is probably one of the oldest editors like Zend Studio. So, it is a great prize. Typically, the prizes that are picked by the first winners are IDEs. As you actually can see here, the five first prizes were IDEs editors.

Arturs Sosins: Yeah, editors. That's right.

Manuel Lemos: On my behalf, I would like to also comment on a few packages. Let's comment about this PHP Function Profiler by Tony Requena from Spain. Basically, it's a package like several others that exist that allow you to measure the time that PHP code takes place.

But this one is a bit different because it can profile in the individual functions. It's somewhat different from many of the codes that exist, that they rely on you to call the benchmarking class to take note of the time that it took to execute. And this one works the other way around. It's the, actually, class that calls the codes that you want to benchmark.

So kudos for Tony for his contribution. And for that, he picked one downloadable copy of CodeLobster Professional, which is also an editor. It is interesting that Tony has been one of the PHP developers that has been helping Spain to rank better, but we'll comment a bit about that ahead.

Other than that, I would like to also comment another package nominated to the Innovation Award. It was developed by Asbjorn Grandt and it is called Bin String. It is to manipulate text using the mbstring extension.

This is interesting because PHP does not have a really nice and elegant solution to deal with unicode text. And you need to rely on extensions like mbstring. But at the same time, you would like to use the original string manipulation functions.

So, depending on whether that extension is available or not, you would have to call one set of functions or the others. So Asbjorn provided a solution that wraps that decision in calling one set of function or the other in the class.

And then, you just call the class and you don't have to put any conditions in your code. So, it's a much nicer solution for this problem of localization.

And for this contribution, Asbjorn got a prize which was an O'Reilly book. O'Reilly books are type of prize that is picked very, very frequently.

PHP Innovation Award Rankings of 2014 (59:23)

Manuel Lemos: Now that we've covered all the winners, let's talk about the current standings of the Innovation Award rankings for 2014 in PHP. Currently, the rankings had been evolving a lot because many, many packages had been submitted.

The current ranking that show already include the winners of August. So those are the ones that we are going to mention next month.

So far, Chi Hoang from Germany is leading individually with 6 packages and 27 points. It's like he sends one new package a month. Since he tends to send innovative packages intentionally, so he's really participating in the Innovation Award, not just by occasion but...

Arturs Sosins: Consistently.

Manuel Lemos: Yes. He really wants to win the Innovation Award. It's great because he'd been sending some very interesting contributions. Now, he's leading. But following right after him, Orazio Principe from Italy with 3 packages and 24 points. So he's following him right behind, despite he submitted only half of the packages. And then in third position is Andoitz Jordan Marmolejo from Spain with 3 packages and 16 points, then Asbjorn Grandt from Denmark with 2 package and 12 points, and then, several other authors with just one package but less points.

By country, the things have changed a bit because of a detail there. There was user that... I think it was Patrick Laso... he formerly said he was from Spain, but now he says he's from United States. Probably moved there recently. So with that he switches all his points to United States, which formerly would have gone to Spain. So this is an unusual situation but it's totally legal. It was a not a trick. It was something that happened.

But still, in the ranking, Italy is leading with 5 packages and 34 points. It's a bit ahead of United States , Germany and Spain that are now tied in the second position with 27 points. United States has only 4 packages, Germany and Spain with 6 packages.

Then, right behind them, there is Iran with 3 packages and 26 points; then, Brazil with 5 packages, 25 points, then, Russia with 3 packages and 23 points. And then, there is United Kingdom, Denmark and Romania with 2 packages and less points.

Now, you can see that United Kingdom is showing up on the ranking, thanks to the coalescing of the points from Great Britain, which in the end would be from the same country.

This is the ranking considering the winners of August, although there are still four months to be considered for the Innovation Award ranking of 2014. I think there is still great chances of these rankings to change. What do you think, Arturs?.

Sure, as we're seeing before then, some countries are suddenly popping out and then going down. It changes constantly in every month.

Manuel Lemos: Yeah, I think it is great, because thanks to this Innovation Award winners, contest, competition... Well, it's an healthy competition. It's not really people are beating each other. Each user participates individually, so they do not sort of fight other users directly. They just try to be their best. And so far, this has been contributing to great submissions.

Actually, typically, at the beginning of the month when the Innovation Award results are announced, there is a mailing that goes out telling each author how they rank and how their country is standing in the rankings, and they feel motivated to participate in this Innovation Award.

Right in the days that followed, there is a surge of packages. I think the record that I got so far is like 24 packages in the queue. And this has been giving me a lot of work because I need to make an effort to approve them, the packages, faster so the authors do not have to wait too much for the package to be approved.

But all this is positive. It's a lot of more work to me but I do not mind. It has been a great initiative and I hope it continues to be so, because everybody is winning. The authors are getting more exposure to their work.

They are also having fun because they are sort of collaborating with the other developers from the same countries, in order to make a better performance for the country to eventually win the big prize by the end of the year. This has been very exciting, and I think it continue to be so.

I'm not going to comment much about what will happen in the next weeks. There's a new big feature about to be launched. I'll get back to that on next podcast. But all that will foster further the Innovation Award because it will give ideas for new packages to be submitted. But I'll get back to that next month.

So with this, we practically ended this comment on the Innovation Award winners. I hope this continues to be a great initiative and may authors and users benefit from the great packages that had been shared.

Conclusion (1:06:51)

Manuel Lemos: Now, we reached practically the end of this podcast. Arturs, I don't know if you have anything else to comment.

Arturs Sosins: Sure. With a lot we have seen in PHP... all the changes and the so-called sugar syntax optimizations, and every month, the topics we discuss... I think it only proves that the PHP community does not get smaller but maybe only bigger, and only gains popularity. So there is a bright future.

Manuel Lemos: Yes, exactly. I actually mentioned that in the other month. It's great to see that the greatest competitors of PHP are also working on PHP.

[Laughter]

Manuel Lemos: So that is a very fortunate situation that PHP is in and everybody that has been investing for years on PHP development. So as you mentioned again, the future is bright.

And with that, we practically ended this podcast. I would like to thank you again, Arturs, for coming. On my behalf, that is all for now. Bye.

Arturs Sosins: Bye.

[Music]




You need to be a registered user or login to post a comment

1,474,357 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:

FacebookGmail
HotmailStackOverflow
GitHubYahoo


Comments:

1. IS THERE ANY PHP SOFTWARE THAT CAN CREATE AND ADD EXTENSION - Francy Austin (2014-10-18 06:00)
IS THERE ANY PHP SOFTWARE THAT CAN CREATE AND ADD EXTENSION... - 1 reply
Read the whole comment and replies



  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Compiling PHP into Op...   Post a comment Post a comment   See comments See comments (2)   Trackbacks (0)