Why are text/blob iterators so much slower than array iterator?

Iterating through the alphabet with text/blob/array

vec {
  "text cost - 4_176, text heap - 68";
  "blob cost - 2_399, blob heap - 80";
  "array cost - 383, array heap - 16";

Please note that in addition to a huge cost reduction there is a reduced heap size for the array test. It looks like some optimization is applied for array iterators and it doesn’t even create an intermediate iterator object. If I am right about the optimization, are there any plans to apply it for text/blob as well. If I am not - what’s going on here?)

1 Like

Array iterators are optimized to simple loops, but blob iterators are not yet. That probably accounts for the difference.