Tag:Xiecheng

  • Shadowfax: let laravel wear sword of swoole

    Time:2021-7-15

    Spool can be said to be a sharp sword of PHP, which expands the boundary of PHP and makes many phpers see the dawn of high concurrency. It is very worthwhile to improve the performance of laravel by using swoole. In this way, we can not only get the high performance of swoole, but also […]

  • A simple example of PHP spool

    Time:2021-7-13

    This paper records a preliminary study and simple use of spool.Welcome to discuss and make complaints about it. Introduction to spool Spool is an advanced PHP web development framework. The framework is not to improve the performance of the website, but to improve the development efficiency of the website.Use the special effect of asynchronous coroutine […]

  • Jin chat chat chat system based on easysoole and layim

    Time:2021-7-12

    statement Jin chat is a complete chat application based on easysoole and layim through https://github.com/woann/chat The author agrees that easysoole V3 is used to reconstruct all server-side code, and new functions such as token authentication, redis / MySQL coroutine connection pool and task asynchronous task are added to the original functions This project is based […]

  • Hyperf releases socket.io component and v1.1.30 enterprise level PHP micro service cloud native collaboration framework

    Time:2021-7-8

    Update content This week’s update is mainly releasedhyperf/socketio-serverSocket.io is a popular application layer real-time communication protocol and framework, which can easily realize response, grouping and broadcasting.hyperf/socketio-serverYesSocket.ioOfWebSocketTransport protocol. In addition, we fixed some bugs and continued to improve the stability of hyperf, which was released on1.1.30Users are advised to update this version. Direct access to the […]

  • Brief introduction of swoole

    Time:2021-7-4

    What is Xiecheng A coroutine can be simply understood as a thread, except that the thread is user state and does not require the participation of the operating system. The cost of creating, destroying and switching is very low. Coprocessor can’t use multi-core CPU, it needs to rely on multi-core CPUSwooleThe multi process model of. […]

  • Pprof use

    Time:2021-7-3

    Basic use View stack call information $ go tool pprof http://localhost:6060/debug/pprof/heap View the information of the cooperative project $ go tool pprof http://localhost:6060/debug/pprof/goroutine View CPU information within 30s $ go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30 other $ go tool pprof http://localhost:6060/debug/pprof/threadcreate $ go tool pprof http://localhost:6060/debug/pprof/block $ go tool pprof http://localhost:6060/debug/pprof/mutex $ go tool pprof http://localhost:6060/debug/pprof/trace?seconds=5 Extended […]

  • Example and priority of spool coroutine

    Time:2021-6-30

    Example 1: Co::set([‘hook_flags’=> SWOOLE_HOOK_ALL]); Co\run(function () { go(function() { var_dump(file_get_contents(“http://www.baidu.com/”)); }); go(function() { Co\System::sleep(1); echo “done\n”; }); }); echo 1; // Can be executed Example 2: Co\run(function () { $server = new Co\Http\Server(“127.0.0.1”, 9502, false); $server->handle(‘/’, function ($request, $response) { $response->end(“Index”); }); $server->start(); }); echo 1; // Can’t execute Example 3: Co::set([‘hook_flags’=> SWOOLE_HOOK_ALL]); go(function() { […]

  • Read co module source code from generator

    Time:2021-6-26

    This is the fourth article on the principle and implementation of JS asynchrony This article gives you a thorough understanding of the event loop Read the EventEmitter source code of node.js from the publish subscribe mode Handwritten a promise / A +, perfectly passed the official 872 test cases This article will mainly talk about […]

  • Implementation of asynchronous non blocking IO based on spool and PHP coroutine

    Time:2021-6-26

    This article is published in segment fault by neusnail. It is forbidden to reprint without permissionhttps://segmentfault.com/a/11… In this paper, the implementation of cooperative scheduling is based on zanhphttp://zanphp.io/ I wrote a simple framework of spool + PHP coroutine:https://github.com/neuSnail/PcsInterested can see, very immature, welcome to teach. PCs is my graduation project based on zanhp. Different from […]

  • Read co module source code from generator

    Time:2021-6-25

    This is the fourth article on the principle and implementation of JS asynchrony This article gives you a thorough understanding of the event loop Read the EventEmitter source code of node.js from the publish subscribe mode Handwritten a promise / A +, perfectly passed the official 872 test cases This article will mainly talk about […]

  • Performance test of spool coroutine

    Time:2021-6-25

    //When you turn on CO programming, file operations, sleep, mysqli, PDO, streams, etc. become asynchronous io Co::set([‘hook_flags’=> SWOOLE_HOOK_ALL]); $s = microtime(true); //Create a coroutine container Co\run(function() { //Start 100 coroutines to execute usleep for ($c = 100; $c–;) { go(function () { for ($n = 100; $n–;) { usleep(1000); } }); } //Start 100 programs […]

  • Python performance optimization

    Time:2021-6-24

    background This paper mainly discusses the performance analysis and optimization of Python code, aiming to solve some common performance bottlenecks at the language level. It is the accumulation and summary in the usual work. It will be more basic and comprehensive. By the way, it will also introduce some optimization experience in the service architecture. […]