Timefold Solver is an AI constraint solver for Python to optimize the Vehicle Routing Problem, Employee Rostering, Maintenance Scheduling, Task Assignment, School Timetabling, Cloud Optimization, Conference Scheduling, Job Shop Scheduling, Bin Packing and many more planning problems.
Currently, in order to fully support all the forms a Python iterator can take, jpyinterpreter generates the following code for FOR_ITER:
This is highly atypical in Java, and the JVM probably would have a harder time optimizing its standard for iterator loop:
We can look at TOS to see if it a known iterator type (i.e.
PythonIterator
), and if so, generate the more typical Java loop.