Greiman / SSD1306Ascii

Hardware: Arduino nano with SSD1306 Oled. I2c connection for the display.

I tested the timing of a big sketch (CNC handwheel, modbus, click encoder for one button menu…) and recognized something strange. I set up a simplified test sketch to ask, if someone can explain this to me.
Simple sketch, prints just “Hello Test!” on that 0.96" display. In the loop() I start first setting a timer. After the print job I stop the time and print the elapsed time as well on the display. Then the display is cleared and process repeats. Sketch uses 5016 bytes (16%) of program storage space. Yes it’s fickering…but I can still read 17/18 millisecond for one code run.
Then I comment out parts of the sketch. It looks like this:

//#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"

#define I2C_ADDRESS 0x3C
#define RST_PIN -1

SSD1306AsciiWire oled;

unsigned long start, finished, elapsed;

void setup() {

  //Wire.begin();
  //oled.set400kHz();

  oled.begin(&Adafruit128x64, I2C_ADDRESS);
  oled.setFont(System5x7);
}

void loop() {

  start = millis();         
  
  oled.setCursor(1, 4);
  oled.set2X();
  oled.print("Hello Test!");
  
  finished=millis();       
  elapsed=finished-start;   
  oled.setCursor(55, 0);    
  oled.set2X();            
  oled.println(elapsed);   

  oled.clear(); 
}

Sketch becomes smaller. Uses now 4898 bytes storage space. Still works fine. No difference in function. BUT ! I read 12/13 millisecond for one code run. So the sketch is smaller and FASTER !? For my big sketch the speed difference is significant. I am surprised ! Commenting out <Wire.h>, Wire.begin(), oled.set400kHz() makes running the code faster with NO DIFFERNZ in display?

Am I drawing a wrong conclusion about the speed here from this test?

Because SSD1306AsciiWire.h is already taking care of the Wire internally in the library.
Ps calling oled.clear in loop is costing you a lot, clear it only when needed.

Thanks for your answer! I checked now SSD1306AsciiWire.h....and yes, it takes care of the Wire.... It's just strange that ALL EXAMPLES in the SSD1306Ascii library include or better advice calling <Wire.h>, Wire.begin() and oled.set400kHz()...wrong advice !

Ps : the oled.clear in loop I just used there to be sure to see fully updated display of speed measurement....

Perhaps for compatibility reasons with other/older libraries, readability...

Ahh, ok then.