Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v18 0/2] box: implement cmod Lua module
@ 2021-02-17 12:39 Cyrill Gorcunov via Tarantool-patches
  2021-02-17 12:39 ` [Tarantool-patches] [PATCH v18 1/2] box/cmod: " Cyrill Gorcunov via Tarantool-patches
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Cyrill Gorcunov via Tarantool-patches @ 2021-02-17 12:39 UTC (permalink / raw)
  To: tml; +Cc: Vladislav Shpilevoy

Please take a look once time permit.

v1-v3 are development ones and not sent.

v5 (by vlad):
 - drop exists, list methods: they are redundant
 - rename cfunc to cbox
 - when create a function make it callable Lua object
 - initialize cbox out of modules
 - fix error in passing module name for reloading
 - make api been cbox.func.[create|drop] and
 - fix test for OSX sake

v6 (by vlad):
 - move module handling into module_cache file.
 - development
 - use rbtree for function instance storage, since
   i don't like the idea of unexpected rehashing of
   values in case of massive number of functions
 - use reference counter and free function instance
   if only load/unload are coupled
 - keep a pointer to the function inside Lua object
   so we don't need to lookup on every function call.
   this force us to implement __gc method
 - use new API and update docs
 - development
 - use hashes for function names lookup
 - simply function loads counting
 - use luaL_register_module and luaL_register_type for
   easier methods registering
 - carry functions as userdata object
 - development
 - switch to new API as been discussed in
 - development
 - switch to refs to carry module usage
 - drop func_name structure renaming
 - carry two hashes for backward compatibility with
   functions created via box.schema.func help
 - complete rework of cmod and most parts of
 - account for file statistics to invalidate
   module cache
 - new API for cmod, no more :reload, the :load
   procedure uses cache invalidation
 - update test cases
 - still there is no GC test since I didn't
   manage to deal with it
 - report module state cached/orphan
 - update test cases
 - do not prevent functions lookup in orphan modules
 - there was an idea to use box.shema.func cache as on
   top of cmod's one, but this doesn't work because in case
   if module doesnt exist in any caches we would put it into
   into cmod's one as well but there wont be a module on
   cmod level which would clean it up later (which makes
   code a way more comple if we choose to track state
   of modules).
 - internal
 - drop idea of unifying box.schema.func and cmod functions
   cache, it brings more problems than solves due to too
   different context of execution;
 - make cmod self consistent, which shrink patch series
   size ~1/5 in compare with previous attempts;
 - improve tests to account internal states of modules
   and functions (tt_dev key in reports).
 - implement pass-through cache for modules loading, for
   this sake 'struct module' uses cmod internally;
 - improve tests to cover sole cmod case and a mixture
   of box.schema.func and cmod to make sure the caches
   are not corrupted.

branch gorcunov/gh-4642-func-ro-18
issue https://github.com/tarantool/tarantool/issues/4642

Cyrill Gorcunov (2):
  box/cmod: implement cmod Lua module
  test: box/cfunc -- add cmod test

 src/box/CMakeLists.txt  |   1 +
 src/box/func.c          | 237 ++++------
 src/box/func.h          |   7 +-
 src/box/lua/cmod.c      | 925 ++++++++++++++++++++++++++++++++++++++++
 src/box/lua/cmod.h      | 123 ++++++
 src/box/lua/init.c      |   2 +
 test/box/CMakeLists.txt |   4 +
 test/box/cfunc1.c       |  58 +++
 test/box/cfunc2.c       | 137 ++++++
 test/box/cfunc3.c       |  25 ++
 test/box/cfunc4.c       |  28 ++
 test/box/cmod.result    | 527 +++++++++++++++++++++++
 test/box/cmod.test.lua  | 200 +++++++++
 test/box/suite.ini      |   2 +-
 14 files changed, 2116 insertions(+), 160 deletions(-)
 create mode 100644 src/box/lua/cmod.c
 create mode 100644 src/box/lua/cmod.h
 create mode 100644 test/box/cfunc1.c
 create mode 100644 test/box/cfunc2.c
 create mode 100644 test/box/cfunc3.c
 create mode 100644 test/box/cfunc4.c
 create mode 100644 test/box/cmod.result
 create mode 100644 test/box/cmod.test.lua

base-commit: 4299daf7df12a67748e28969446c8e8a7530bce1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-17 20:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 12:39 [Tarantool-patches] [PATCH v18 0/2] box: implement cmod Lua module Cyrill Gorcunov via Tarantool-patches
2021-02-17 12:39 ` [Tarantool-patches] [PATCH v18 1/2] box/cmod: " Cyrill Gorcunov via Tarantool-patches
2021-02-17 12:39 ` [Tarantool-patches] [PATCH v18 2/2] test: box/cfunc -- add cmod test Cyrill Gorcunov via Tarantool-patches
2021-02-17 20:15 ` [Tarantool-patches] [PATCH 0/4] cmod: refactor box/func Cyrill Gorcunov via Tarantool-patches
2021-02-17 20:15   ` [Tarantool-patches] [PATCH 1/4] box/func: drop redundant module argument Cyrill Gorcunov via Tarantool-patches
2021-02-17 20:15   ` [Tarantool-patches] [PATCH 2/4] box/func: update module cache in one pass Cyrill Gorcunov via Tarantool-patches
2021-02-17 20:15   ` [Tarantool-patches] [PATCH 3/4] cmod: export cmod_call helper Cyrill Gorcunov via Tarantool-patches
2021-02-17 20:15   ` [Tarantool-patches] [PATCH 4/4] box/func: simplify func_c_call Cyrill Gorcunov via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox