summaryrefslogtreecommitdiff
path: root/src/multi.rs
AgeCommit message (Collapse)Author
2023-03-14Improve error reporting when calling Rust functions from Lua.Alex Orlenko
In particular new error type `Error::BadArgument` added to help identify bad argument position or name (eg `self` for userdata).
2022-12-30Rename MultiValue cache to poolAlex Orlenko
2022-12-19Rename ToLua/ToLuaMulti -> IntoLua/IntoLuaMultiAlex Orlenko
2022-05-29More inline attributesAlex Orlenko
2022-05-28Make Variadic::new and MultiValue::new constAlex Orlenko
2021-11-12Performance optimization: cache and reuse `MultiValue` containersAlex Orlenko
2021-10-12Update documentation referencesAlex Orlenko
Using rustdoc links (see RFC https://github.com/rust-lang/rfcs/pull/1946)
2021-05-04Fix clippy warningsAlex Orlenko
2021-02-27Fix/whitelist some clippy warningsAlex Orlenko
2020-04-17v0.3.0-alpha.1 with async supportAlex Orlenko
Squashed commit of the async branch.
2019-11-04Fix examples and docsAlex Orlenko
2019-10-01Rename to mluaAlex Orlenko
2019-09-29Backport changes from rlua 0.16 (master branch)Alex Orlenko
2018-10-01Allow non-utf8 Lua source in load / exec / evalkyren
2018-09-02small macro style changekyren
2018-09-02Implement tuple MultiValue tuple conversion up to 16kyren
2018-08-05format with up-to-date rustfmtkyren
2018-03-19Clean up some lifetime specificationkyren
2018-03-11A lot of performance changes.kyren
Okay, so this is kind of a mega-commit of a lot of performance related changes to rlua, some of which are pretty complicated. There are some small improvements here and there, but most of the benefits of this change are from a few big changes. The simplest big change is that there is now `protect_lua` as well as `protect_lua_call`, which allows skipping a lightuserdata parameter and some stack manipulation in some cases. Second simplest is the change to use Vec instead of VecDeque for MultiValue, and to have MultiValue be used as a sort of "backwards-only" Vec so that ToLuaMulti / FromLuaMulti still work correctly. The most complex change, though, is a change to the way LuaRef works, so that LuaRef can optionally point into the Lua stack instead of only registry values. At state creation a set number of stack slots is reserved for the first N LuaRef types (currently 16), and space for these are also allocated separately allocated at callback time. There is a huge breaking change here, which is that now any LuaRef types MUST only be used with the Lua on which they were created, and CANNOT be used with any other Lua callback instance. This mostly will affect people using LuaRef types from inside a scope callback, but hopefully in those cases `Function::bind` will be a suitable replacement. On the plus side, the rules for LuaRef types are easier to state now. There is probably more easy-ish perf on the table here, but here's the preliminary results, based on my very limited benchmarks: create table time: [314.13 ns 315.71 ns 317.44 ns] change: [-36.154% -35.670% -35.205%] (p = 0.00 < 0.05) create array 10 time: [2.9731 us 2.9816 us 2.9901 us] change: [-16.996% -16.600% -16.196%] (p = 0.00 < 0.05) Performance has improved. create string table 10 time: [5.6904 us 5.7164 us 5.7411 us] change: [-53.536% -53.309% -53.079%] (p = 0.00 < 0.05) Performance has improved. call add function 3 10 time: [5.1134 us 5.1222 us 5.1320 us] change: [-4.1095% -3.6910% -3.1781%] (p = 0.00 < 0.05) Performance has improved. call callback add 2 10 time: [5.4408 us 5.4480 us 5.4560 us] change: [-6.4203% -5.7780% -5.0013%] (p = 0.00 < 0.05) Performance has improved. call callback append 10 time: [9.8243 us 9.8410 us 9.8586 us] change: [-26.937% -26.702% -26.469%] (p = 0.00 < 0.05) Performance has improved. create registry 10 time: [3.7005 us 3.7089 us 3.7174 us] change: [-8.4965% -8.1042% -7.6926%] (p = 0.00 < 0.05) Performance has improved. I think that a lot of these benchmarks are too "easy", and most API usage is going to be more like the 'create string table 10' benchmark, where there are a lot of handles and tables and strings, so I think that 25%-50% improvement is a good guess for most use cases.
2017-12-04more reorganization in an attempt to shrink the size of lua.rskyren
2017-12-03I believe this is all the external API changes necessary for 'm' safetykyren
2017-09-15Fix links in `Variadic` docsJonas Schievink
2017-09-14More documentation workJonas Schievink
2017-08-03Fixup grammar error in doc comments.kyren
2017-08-01Formatting, only implement tuple conversion up to 12kyren
2017-08-01Fix references to hlists in documentation, improve? Variadic usabilitykyren
Also rename to/from/pack/unpack to pack/unpack/pack_multi/unpack_multi, I don't know if this makes their usage clearer, and it IS a bit confusing that I'm changing the meaning of the words 'pack' and 'unpack'
2017-07-31Two major API changes to start with:kyren
* Callbacks have generic argument and return types * All variadics are done with tuples
2017-07-24auto formattingkyren
2017-07-24Slight changes for consistencykyren
I am not actually sure what the best pattern is to import conflicting standard types, but this is at least consistent.
2017-07-24Do several more Lua prefix renames, add prelude modulekyren
Rename the following: LuaNil => Nil LuaExternalError => ExternalError LuaExternalResult => ExternalResult LuaCallback => Callback (internal only) Use qualified re-exports at the top of the module. Add a new public 'prelude' module which re-exports everything with a non-conflicting name (Adds back the Lua prefix), and is meant to be imported unqualified.
2017-07-23Remove the `Lua*` prefix from most typesJonas Schievink
cc #15 Doesn't touch `LuaString` mainly because that's a *lot* of renaming work and the code looks weird. Also I want feedback before I proceed.
2017-06-27Comments should be wrapped at 100 lines, according to standardkyren
2017-06-18DocumentationJonas Schievink
2017-06-15small warning / clippy fixes, doc commentskyren
2017-06-14Allow passing `Result<T, E>` to LuaJonas Schievink
For this to work, both `T` and `E` need to implement `ToLua`. An `Ok(t)` passes the contained `T`, while an `Err(e)` passes `nil` followed by the contained `E`. This matches the common Lua idiom used by functions like `io.open`. Closes #3
2017-05-22Update to use hlist_macro for hlist macros.kyren
You will type hlist! hlist_pat! and HList! so often that every character counts. Apologize for the API churn in the README.
2017-05-21Doc updates, remove unused functionskyren
2017-05-21Initial importkyren