# 대량의 tolower()를 빠르게 수행하기

> Clean Markdown view of GeekNews topic #6869. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=6869](https://news.hada.io/topic?id=6869)
- GeekNews Markdown: [https://news.hada.io/topic/6869.md](https://news.hada.io/topic/6869.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-06-30T09:21:01+09:00
- Updated: 2022-06-30T09:21:01+09:00
- Original source: [dotat.at](https://dotat.at/@/2022-06-27-tolower-swar.html)
- Points: 4
- Comments: 0

## Topic Body

- DNS서버는 종종 도메인명을 소문자로 변환해야 함   
- BIND는 기존 DNS값을 보존해야 하기 때문에 좀 더 작업이 필요함  
- SWAR를 tolower()에 적용해 보기로 함  
→ SIMD within a register : 하나의 명령어로 레지스터 안에서 여러 데이터를 병렬 연산 하는 것  
- uint64_t 에 넣은 8개의 ASCII 문자를 처리하는 `tolower8` 함수를 생성   
→ 구현한 C 코드의 각 라인당 설명은 원문 참조   
- 성능   
```  
    0.098 ms memmove() copy  
    0.399 ms tolower8() copy  
    1.817 ms tolower() copy  
    0.280 ms tolower8() compare  
    2.090 ms tolower() compare  
```

## Comments



_No public comments on this page._
