paust-team / paust-db

GNU General Public License v3.0
6 stars 5 forks source link

Change Timestamp data type issue #61

Closed elon0823 closed 5 years ago

elon0823 commented 5 years ago

현재 PaustDB 메타데이터의 Timestamp data type 이 int64로 되있습니다.

최초의 Unix time 을 설계해서 사용할 당시엔 Unsigned 라는 개념이 없었기 때문에 초기 Unix time 기반 함수들의 time_t 는 다 int64를 리턴하기때문에 그대로 사용된 것 같습니다.

여기서 다음과 같은 코드들을 보면

timestamp := binary.BigEndian.Uint64(key[0:8])
realData.Timestamp = int64(timestamp)

바이너리 데이터를 Timestamp 를 사용하기위해 Uint64 -> int64 형변환이 빈번하게 호출되는 함수에서 이루어지는데요, 처음부터 Timestamp 의 data type 을 Uint64로 만들어놓는다면 조금의 성능개선이 있지 않을까 하여 이슈를 남깁니다.

dragon0170 commented 5 years ago

timestamp가 negative일리 없으니 데이터 타입을 uint64로 바꿔도 될 것 같습니다.