• @tve I know you're doing some benchmarking at the moment? Please could you try:

    static ALWAYS_INLINE char jsvStringIteratorGetChar(JsvStringIterat­or *it) {
      if (!it->ptr) return 0;
    ~ifdef ESP8266
      int addr = (int)it->ptr + (int)it->charIdx;
      uint32_t bytes = *(uint32_t*)(addr & ~3);
      return ((uint8_t*)&bytes)[(int)addr & 3];
    ~else
      return it->ptr[it->charIdx];
    ~endif
    }
    
    // and
    
    static ALWAYS_INLINE char jslNextCh(JsLex *lex) {
      if (!lex->it.ptr) return 0;
    ~ifdef ESP8266
      int addr = (int)lex->it.ptr + (int)lex->it.charIdx;
      uint32_t bytes = *(uint32_t*)(addr & ~3);
      return ((uint8_t*)&bytes)[(int)addr & 3];
    ~else
      return (char)(lex->it.ptr[lex->it.charIdx]);
    ~endif
    }
    
    // ~ should be a hash - the forum 'eats' it otherwise
    

    And see if it hurts performance much? My hope is that actually it won't have that much of an effect at all.

    If not, it'd be great to get it in as it could really help with the low RAM situation...

About

Avatar for Gordon @Gordon started