I am trying to avoid writing a query language for my database project ( http://ragedb.com ) so I am using Lua and Sol to let users write ad-hoc "un" stored procedures to query the database.
This works pretty well until the query needs to grab a lot of data and filter/sort through it.
The data comes back from C++ and crosses over to the Lua side, sometimes multiple times and this is slowing things down quite a bit.
Has anyone faced this before? What do you do to solve it?
Is there a to create some kind of continuation so one part of the query feeds into another?
What about creating an object cache on the C++ side and then having Lua call into C++ functions that use that cache instead of crossing over?