开源软件名称(OpenSource Name):openresty/lua-tablepool开源软件地址(OpenSource Url):https://github.com/openresty/lua-tablepool开源编程语言(OpenSource Language):Perl 67.6%开源软件介绍(OpenSource Introduction):Namelua-tablepool - Lua table recycling pools for LuaJIT Table of Contents
Synopsislocal tablepool = require "tablepool"
local pool_name = "some_tag"
local my_tb = tablepool.fetch(pool_name, 0, 10)
-- using my_tb for some purposes...
tablepool.release(pool_name, my_tb) DescriptionThis Lua library implements a pool mechanism to recycle small Lua tables. This can avoid frequent allocations and de-allocation of many small Lua tables for temporary use. Recycling tables can also reduce the overhead of garbage collection in general. The Lua table pools are shared across all the requests handled by the current NGINX
worker process unless MethodsTo load the
fetch
Fetches a (free) Lua table from the table pool of the specified name release
Releases the already used Lua table, The caller must not continue using the released Lua table, The optional According to the current implementation, for maximum 200 Lua tables can be cached in
an individual pool. We may make this configurable in the future. If the specified table
pool already exceeds its size limit, then the CaveatsLarge tables requiring clearingIf you always need to clear out the recycled Lua tables, then you should avoid recycling relatively large Lua tables (like those of hundreds or even thousands of elements in a single table). This is because clearing large Lua tables may offset the benefit of recycling tables. It is recommended to always watch for the PrerequisitesThis Lua library depends on the new CommunityEnglish Mailing ListThe openresty-en mailing list is for English speakers. Chinese Mailing ListThe openresty mailing list is for Chinese speakers. Bugs and PatchesPlease report bugs or submit patches by
AuthorYichun "agentzh" Zhang (章亦春) agentzh@gmail.com, OpenResty Inc. Copyright and LicenseThis module is licensed under the BSD license. Copyright (C) 2016-2021, by Yichun "agentzh" Zhang, OpenResty Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论