← All issues

[JSC] Compare 8-bit strings a word at a time in DFG/FTL string equality

2fc620c

JSC의 DFG와 FTL은 8-bit string 동일성 비교를 JIT-compiled code에 직접 인라인합니다. 이 commit은 byte 단위 루프를 word 단위 역방향 루프로 교체했습니다. 다만 pointer 크기보다 짧은 string은 기존 byte 루프를 그대로 사용합니다. 나머지 1~7바이트 구간은 offset 0에서의 단일 overlapping word load로 처리됩니다. word 루프는 length ≥ 8일 때만 진입하므로 이 방식은 안전합니다.

256바이트 string 동일성 비교에서 최대 5.85배, 긴 string에서 2.86배의 속도 향상이 이루어졌습니다. string keying, deduplication, property-lookup workload가 직접적인 수혜를 받습니다.

🔒

The overlapping-tail load and loop entry guard have edge cases worth investigating — audit directions included.

더 확인하려면 구독해 주세요