Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What on earth made Microsoft improve PHP for Windows

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article shows you what makes Microsoft improve PHP for Windows. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Microsoft is trying to improve the speed of PHP on Windows, and it seems that Microsoft is increasingly supporting the open source community. On the other hand, 51CTO saw a gradual increase in the share of PHP from the ranking of programming languages in the first issue.

Garrett Serack, director of Microsoft's open source community, recently spoke to the media about Microsoft's efforts to achieve this goal.

Poor performance of PHP applications deployed in Windows

For years, PHP developers may have chosen to work on Windows, but few have chosen to deploy PHP programs on Windows. Serack said the result was not unreasonable. "when users happily run an PHP application on Windows, IIS may suddenly crash, and no one knows why," he said. "the existing PHP drive is based on the old protocol and its performance is not high. The reason is that the PHP community lacks the necessary information to improve it."

Serack believes that Microsoft faces a new problem since Microsoft developers learned that PHP can be used to develop third-party applications. Microsoft is beginning to realize that developers don't deploy PHP on Windows because they can't use it, and some people within Microsoft are ready to make changes. Since then, Serack has spent most of his time on this job.

Microsoft improves Windows's support for PHP

First of all, Microsoft is encouraged to improve Windows's support for PHP by the SQL Server team, which hopes to make existing open source applications better use SQL Server drivers. In other words, they want developers to deploy PHP applications on Windows using SQL Server instead of MySQL, or at least to reduce criticism of themselves. In October 2007, the new and improved version of the Windows PHP driver was released. But it was not accepted by the open source community, so the SQL Server team modified it again to achieve what people really want.

Figure PHP running under Windows Server 2008: performance improvement of 130%

Naturally, the team wants to feed back the modified code to the open source community. According to Serack, this means that you need to communicate with Microsoft's legal team several times before you can be allowed to share the code. The legal process took months because open source code is still a relatively new thing for Microsoft. But Microsoft is not alone in this challenge. As Serack points out, "every large company that shares code with the open source community goes through a similar legal approval process."

Anyway, at last year's OSCON conference, Microsoft submitted code to Adobe and other projects. Serack said, "around this time last year, Microsoft Open Source Lab staff wanted to accelerate the development of PHP on Windows." Pierre Joye had free time at the time, so Microsoft asked him to work with Serack to achieve the following goal: to improve PHP on Windows.

At the same time, Serack began to refine the Windows PHP generation process and re-script it. With so many other projects involved, he had to create tools and rebuild more. "I want to include all the DLL," he said. He created a tracking tool to track what was being created and created an entirely new Visual Studio project file. Serack is pleased to say, "make files and custom batch scripts are no longer needed."

With the above improvements alone, the gap between the speed of the core interpreter benchmark and the speed of PHP running on Linux is narrowed to less than 1%. Next, Serack creates a binary tool that runs real data (that is, real PHP scripts) to provide canonical data to the compiler. Profile guided Optimization (Profile-Guided Optimization,PGO) is one of the coolest features of Visual Studio, which has been confirmed by .NET developer friends. This makes its core interpreter about 18% faster and doesn't change a single line of code, just the generation process.

Perfecting the generation process is not a meaningless task. It takes time for each module to be compiled with the same and correct settings. Serack said, "if a library uses different optimizations, it is not normal."

Joye has also replaced some old libraries, he said. For example, the POSIX regular expression function library has been around for about 10 years. Serack said that creating a new version of the dependency library has a significant impact on performance, but it also has a significant impact on reliability.

This is not to say that the task has been fully completed. The so-called open source project, or development project, is like writing a novel, programming will never be completed, it will only be abandoned. "We are still making some efforts," Serack said. For example, the file system implementation of Windows is different from that of Linux. And he admits, "in real-world applications, we can't be successful in terms of performance." but at least we already have this really stable platform. "

Some people may think: "Microsoft? open source? commitment? you must be joking." Serack himself did not believe this attitude at first. In fact, Microsoft deliberately kept a very low profile when making PHP improvements on Windows. "We don't want to offend anyone," Serack said. "our goal is to get PHP to run well on Windows. We want to share PHP, not split it. That's something we don't even think about. We participate in the community by sharing code, not by controlling it."

The goal of Serack is to simply make PHP run better on Windows. He was excited by the developer's response, "Great! I already have a Windows server. Now I don't have to buy another one to run my PHP app."

Serack welcomes help and advice from the PHP community; he wants people to express their views on how to run PHP better on Windows, especially developers' suggestions that can help track issues and optimizations. "if there is anything wrong, let's fix it together," he said. "

"We've given people a choice, and now they can deploy PHP on Windows and run them properly," Serack said.

The above is exactly what makes Microsoft improve PHP for Windows. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report