AI助手支持GPT4.0
Upon inspection using xhProf, I realized that the PHP implementation loading the MO files is really slow.
在使用xhProf进行检查时,我意识到PHP实现加载MO文件的速度确实很慢。
From my tests, about 25% to 40% of the time WordPress spends rendering the page is actually spent locating, parsing and merging all the translation files.
根据我的测试,WordPress花在渲染页面上的时间中大约有25%到40%的时间实际上是在查找,解析和合并所有翻译文件上。 p>
This plugin works by caching the whole $l10n variable holding all the text domains and overridding the load_textdomain.
load_textdomain
此插件通过缓存包含所有文本域的整个$ l10n变量并覆盖 load_textdomain code>。 p>Caching is done using serialize and written to wp-content/uploads/l10n.pson.使用序列化完成缓存,并将其写入 wp-content / uploads / l10n.pson code>。Be sure to regenerate the cache if a .mo changes.如果.mo更改,请确保重新生成缓存。 p>TODO待办事项 h4>Provide a better UI page提供更好的UI页面 li> ul>Speed comparison速度比较 h3>Comparing WordPress Gettext loading vs this plugin.将WordPress Gettext加载与该插件进行比较。 p>Using the average response time of: 使用以下平均响应时间: siege -c 1 -r 100 -b http://localhost/围攻-c 1 -r 100 -b http:// localhost / p>Vanilla: Fresh install of WordPress Vanilla:全新安装WordPress Common: WPML, Types, Views, and Gravity Forms常见:WPML,类型,视图和重力形式Total Cache: Common + Total Cache (APC object/database cache, no page cache)总缓存:通用+总缓存(APC对象/数据库缓存,无页面缓存)BuddyPress: BP-Registration-Options, BP Show Friends, BuddyPress, BuddyPress Activity Plus, Gravity Forms, Invite Anyone, U BuddyPress Forum Attachment, U BuddyPress Forum Editor, User SwitchingBuddyPress:BP注册选项,BP显示好友,BuddyPress,BuddyPress活动增强版,重力窗体,邀请任何人,U BuddyPress论坛附件,U BuddyPress论坛编辑器,用户切换 p> Vanilla Common Total Cache BuddyPress Vanilla Common Total Cache BuddyPressNative 202 ms 565 ms 478 ms 567 ms原生202 ms 565 ms 478 ms 567 msCached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%) code> pre>
load_textdomain code>。 p>Caching is done using serialize and written to wp-content/uploads/l10n.pson.使用序列化完成缓存,并将其写入 wp-content / uploads / l10n.pson code>。Be sure to regenerate the cache if a .mo changes.如果.mo更改,请确保重新生成缓存。 p>TODO待办事项 h4>Provide a better UI page提供更好的UI页面 li> ul>Speed comparison速度比较 h3>Comparing WordPress Gettext loading vs this plugin.将WordPress Gettext加载与该插件进行比较。 p>Using the average response time of: 使用以下平均响应时间: siege -c 1 -r 100 -b http://localhost/围攻-c 1 -r 100 -b http:// localhost / p>Vanilla: Fresh install of WordPress Vanilla:全新安装WordPress Common: WPML, Types, Views, and Gravity Forms常见:WPML,类型,视图和重力形式Total Cache: Common + Total Cache (APC object/database cache, no page cache)总缓存:通用+总缓存(APC对象/数据库缓存,无页面缓存)BuddyPress: BP-Registration-Options, BP Show Friends, BuddyPress, BuddyPress Activity Plus, Gravity Forms, Invite Anyone, U BuddyPress Forum Attachment, U BuddyPress Forum Editor, User SwitchingBuddyPress:BP注册选项,BP显示好友,BuddyPress,BuddyPress活动增强版,重力窗体,邀请任何人,U BuddyPress论坛附件,U BuddyPress论坛编辑器,用户切换 p> Vanilla Common Total Cache BuddyPress Vanilla Common Total Cache BuddyPressNative 202 ms 565 ms 478 ms 567 ms原生202 ms 565 ms 478 ms 567 msCached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%) code> pre>
Caching is done using serialize and written to wp-content/uploads/l10n.pson.
wp-content/uploads/l10n.pson
使用序列化完成缓存,并将其写入 wp-content / uploads / l10n.pson code>。Be sure to regenerate the cache if a .mo changes.如果.mo更改,请确保重新生成缓存。 p>TODO待办事项 h4>Provide a better UI page提供更好的UI页面 li> ul>Speed comparison速度比较 h3>Comparing WordPress Gettext loading vs this plugin.将WordPress Gettext加载与该插件进行比较。 p>Using the average response time of: 使用以下平均响应时间: siege -c 1 -r 100 -b http://localhost/围攻-c 1 -r 100 -b http:// localhost / p>Vanilla: Fresh install of WordPress Vanilla:全新安装WordPress Common: WPML, Types, Views, and Gravity Forms常见:WPML,类型,视图和重力形式Total Cache: Common + Total Cache (APC object/database cache, no page cache)总缓存:通用+总缓存(APC对象/数据库缓存,无页面缓存)BuddyPress: BP-Registration-Options, BP Show Friends, BuddyPress, BuddyPress Activity Plus, Gravity Forms, Invite Anyone, U BuddyPress Forum Attachment, U BuddyPress Forum Editor, User SwitchingBuddyPress:BP注册选项,BP显示好友,BuddyPress,BuddyPress活动增强版,重力窗体,邀请任何人,U BuddyPress论坛附件,U BuddyPress论坛编辑器,用户切换 p> Vanilla Common Total Cache BuddyPress Vanilla Common Total Cache BuddyPressNative 202 ms 565 ms 478 ms 567 ms原生202 ms 565 ms 478 ms 567 msCached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%) code> pre>
wp-content / uploads / l10n.pson code>。Be sure to regenerate the cache if a .mo changes.如果.mo更改,请确保重新生成缓存。 p>TODO待办事项 h4>Provide a better UI page提供更好的UI页面 li> ul>Speed comparison速度比较 h3>Comparing WordPress Gettext loading vs this plugin.将WordPress Gettext加载与该插件进行比较。 p>Using the average response time of: 使用以下平均响应时间: siege -c 1 -r 100 -b http://localhost/围攻-c 1 -r 100 -b http:// localhost / p>Vanilla: Fresh install of WordPress Vanilla:全新安装WordPress Common: WPML, Types, Views, and Gravity Forms常见:WPML,类型,视图和重力形式Total Cache: Common + Total Cache (APC object/database cache, no page cache)总缓存:通用+总缓存(APC对象/数据库缓存,无页面缓存)BuddyPress: BP-Registration-Options, BP Show Friends, BuddyPress, BuddyPress Activity Plus, Gravity Forms, Invite Anyone, U BuddyPress Forum Attachment, U BuddyPress Forum Editor, User SwitchingBuddyPress:BP注册选项,BP显示好友,BuddyPress,BuddyPress活动增强版,重力窗体,邀请任何人,U BuddyPress论坛附件,U BuddyPress论坛编辑器,用户切换 p> Vanilla Common Total Cache BuddyPress Vanilla Common Total Cache BuddyPressNative 202 ms 565 ms 478 ms 567 ms原生202 ms 565 ms 478 ms 567 msCached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%) code> pre>
Be sure to regenerate the cache if a .mo changes.
如果.mo更改,请确保重新生成缓存。 p>
ul>
Comparing WordPress Gettext loading vs this plugin.
将WordPress Gettext加载与该插件进行比较。 p>
Using the average response time of:
使用以下平均响应时间:
siege -c 1 -r 100 -b http://localhost/
围攻-c 1 -r 100 -b http:// localhost / p>
Vanilla: Fresh install of WordPress
Vanilla:全新安装WordPress
Common: WPML, Types, Views, and Gravity Forms
常见:WPML,类型,视图和重力形式
Total Cache: Common + Total Cache (APC object/database cache, no page cache)
总缓存:通用+总缓存(APC对象/数据库缓存,无页面缓存)
BuddyPress: BP-Registration-Options, BP Show Friends, BuddyPress, BuddyPress Activity Plus, Gravity Forms, Invite Anyone, U BuddyPress Forum Attachment, U BuddyPress Forum Editor, User Switching
BuddyPress:BP注册选项,BP显示好友,BuddyPress,BuddyPress活动增强版,重力窗体,邀请任何人,U BuddyPress论坛附件,U BuddyPress论坛编辑器,用户切换 p>
Vanilla Common Total Cache BuddyPress Vanilla Common Total Cache BuddyPressNative 202 ms 565 ms 478 ms 567 ms原生202 ms 565 ms 478 ms 567 msCached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%) code> pre>
Vanilla Common Total Cache BuddyPressNative 202 ms 565 ms 478 ms 567 ms原生202 ms 565 ms 478 ms 567 msCached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%)
Native 202 ms 565 ms 478 ms 567 ms
原生202 ms 565 ms 478 ms 567 ms
Cached 193 ms (-5%) 322 ms (-43%) 333 ms (-30%) 431 ms (-24%)
缓存的193 ms(-5%)322 ms(-43%)333 ms(-30%)431 ms(-24%)
code> pre>
wp-content/uploads/l10n.pson must be writable
wp-content / uploads / l10n.pson必须可写 p>
WP_DEBUG
WP_DEBUG code>必须为假 li>
ol>
原文出处:http://www.sanshu.cn/a/6127.html
群主管理都是支付大佬