Home Backend Development PHP Tutorial 对一个php开发的页逛的一些技术优化的comment

对一个php开发的页逛的一些技术优化的comment

Jun 13, 2016 pm 12:35 PM
csv memcache php

对一个php开发的页游的一些技术优化的comment

?
说明: 这个历史遗留的页游的技术架构存在问题,并且当时总是说要上线,修改时间也很有限,下面是我当时对其稍微过问一下之后,所能提出的相当有限的技术优化改进的一些comment.
但是毕竟, 这个页游总是被管理层要求即将上线,然后在很有限的时间内永远只能做有限的小修小补,总是不能彻底解决问题,结果是这个页游永远上不了线……?
不懂技术,只是从市场营销的角度来片面要求的管理层来管理就是这样的结果……
?2012-02-17
wooce?9:54:03?
lib/itemconfig.php?和??lib/missionconfig.php,?大小都至少几乎1.5M以上,?并且里面记录的实际上是数据......??
这样引用它们的程序,?每次执行时都要装载它们估计都要花掉不少时间......
php-黄* 9:59:26?
嗯,每个连接都耗几M内存
wooce?10:01:34?
我对这点的优化想法是:?把lib/itemconfig.php?和??lib/missionconfig.php转成用csv格式来存储,?然后装载进去memcache里去,?以后每次php执行时,?如果有要用到它们的数据的地方,?就只要从memcache中读取就可以了
wooce?10:05:11?
那么要优化这点,?首先是把lib/itemconfig.php?和??lib/missionconfig.php转成用csv格式,?如果用手工编辑一个个修改到csv的话很笨拙很繁琐,??可以另外写一个简单的php程序,里面引用lib/itemconfig.php?和??lib/missionconfig.php,?然后程序里循环自动写入到csv里去。??有了csv后,?再搞读取csv到memcache里的程序。
这两步我想让耀*来做,?有没问题呢?
php-黄* 10:05:37?
在数据库有的
wooce?10:08:00?
有??哪张表?
php-黄* 10:08:20?
game_item_info
php-黄* 10:08:28?
game_mission_info
php-黄* 10:08:47?
所有这些配置都是数据库生成的
wooce?10:39:53?
那么,?game_item_info表是通过GMTool维护的??itemconfig.php也是在GMtool维护的时候同时生成的?
php-黄* 10:54:15?
itemconfig.php也是通过www/csv/import_csv.php生成的
wooce?10:55:25?
明白了,?其实最初是有csv,?然后数据库里的和itemconfig.php都是通过csv导入生成的
php-黄* 10:55:49?
www/csv/import_csv.php导入csv文件
wooce?10:57:21?
嗯,找到了,?csv目录下有game_item_info.csv
wooce?11:13:35?
那么,?只需要把现成的csv读入memcache,?然后加上从memcache读取item和mission的config?的代码就可以了
wooce?11:28:15?
这个优化工作?耀*还是黄*来做呢?

PHP-梁耀* 11:59:18?
wooce 11:13:35?
那么,?只需要把现成的csv读入memcache,?然后加上从memcache读取item和mission的config?的代码就可以了

这两个文件的数据平常是不变的吗?
php-黄* 12:01:41?
有可能变化?的
php-黄* 12:02:13?
策划那边有时有改动
wooce?13:41:17?
嗯,?要能在必要时reload?memcache中的数据
php-黄* 13:43:39?
可以直接将配置中的数组存入Memcached
PHP-梁耀* 14:00:33?
那这部分的优化,我去做吧


wooce 11:12:32?
哦, 那么$item 大约有多大呢
php-黄* 11:14:51?
case 'create':{
的注释有item的说明
php-黄* 11:29:43?
现在涉及itemconfig的文件很多的
php-黄* 11:29:59?
新功能还没做完呢
wooce 11:30:49?
这个算是小的优化了, 如果这个都做不了, 那现有版本可优化的地方就没多少了
php-黄* 11:31:27?
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles