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

How to analyze the performance of Cache

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces you how to carry out Cache performance analysis, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Lua5.4-alpha-rc2 has been released for some time, and there is no time to run and see how it performs. I happened to be free recently, so I came to have a look. As a result, the first piece of test code surprised me.

-- a.lua

Collectgarbage ("stop")

Local function foo ()

Local a = 3

For I = 1,64 * 1024 * 1024 do

A = I

End

Print (a)

End

Foo ()

On Lua5.3.4 and Lua5.4-alpha-rc2, the running time of this code is 0.55 and 0.42 seconds.

Through `. / luac-p-l. / lua`, we can see that the performance hotspots in the previous paragraph of the code must be OP_MOVE and OP_FORLOOP. So there must be a change in the execution interpretation code of these two opcode.

I carefully compared the implementation of OP_FORLOOP and OP_MOVE and found that there are three optimizations in the implementation.

1. The execution code of vmcase (OP_FORLOOP) has been removed from'0

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

Internet Technology

Wechat

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

12
Report