Closed tehn closed 4 years ago
There may also be other/faster ways to get/parse the directory structure without recursively hammering scandir
/popen
I looked at this briefly awhile back and will revisit
In build_select_tree , how about a single popen
to find . -type f -name "*.lua"
and then filter that list?
that would certainly accelerate the process if you want to give it a try. i won't be able to get to this for a bit.
i gave it a try:
but i still notice a lag in metros & dropped MIDI clock messages on SELECT :/
likely needs https://github.com/monome/norns/issues/779
i'm trying to see how a coroutine could help this. i will make some relevant comments on 779.
the only actual solution i see is to create an asynchronous wrapper for these blocking OS calls, in C, backed by pthreads. coroutines could rovide some convenient syntax on the lua side.
i'd actually recommend closing this and making #779 more specific ("implement asynchronous system calls")
agreed!
the script list folder recursion is too heavy for lua to maintain timing of metros/etc, so it's likely that metros will get stalled and a running script will stutter. (ie awake)
more pronounced with more scripts in the folder.
coroutines is one solution.