Further attempts to strike the right balance between performance and
memory efficiency for laaarge datasets