protected Map<PlcTag, String> createSortedTagMap() {
        return new TreeMap<>((tag1, tag2) -> {
            if (tag1 instanceof S7SzlTag) {
                S7SzlTag s7Tag1 = (S7SzlTag) tag1;
                S7SzlTag s7Tag2 = (S7SzlTag) tag2;
                if (s7Tag1.getSzlId() == s7Tag2.getSzlId()) {
                    return s7Tag1.getIndex() - s7Tag2.getIndex();
                }
                return s7Tag1.getSzlId() - s7Tag2.getSzlId();
            } else if (tag1 instanceof S7ClkTag) {
                // Technically CLK tags should be identical as there's
                // only one address for reading the PLC clock information.
                return 0;
            } else if (tag1 instanceof S7Tag) {
                S7Tag s7Tag1 = (S7Tag) tag1;
                S7Tag s7Tag2 = (S7Tag) tag2;
                if (s7Tag1.getByteOffset() == s7Tag2.getByteOffset()) {
                    return s7Tag1.getBitOffset() - s7Tag2.getBitOffset();
                }
                return s7Tag1.getByteOffset() - s7Tag2.getByteOffset();
            }
            return 0;
        });
    }
In contrast to the S7Optimizer, the S7BlockReadOptimizer only looks at the bytes that require being read
and focuses on reading raw blocks of bytes instead of doing individual reads for each item.
plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7light/readwrite/optimizer/S7BlockReadOptimizer.java