AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Optimize how code strings are built up to reduce the library size
- Ngôn ngữ chính
- C++
- Star
- 2.1k
- Fork
- 503
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
As part of the nanoColor project, we have been trying to reduce the size of the library. Currently nanoColor is between 1.5-3 MB, depending on the platform and compiler flags but the goal is to get it down to 1 MB or less.
As we have profiled where the size of the existing library comes from, we noticed that there is a lot of size coming from modules that create code. For example, all the modules that build shader code for various GPU languages are among the largest. Another example is the way Exception message strings are built. All of this uses a pattern which is nice to read in the code but which creates a lot of temporary string objects that bloats the library size.
This proposal is to find a better way to build up these long strings from components that is both easy to read in the code but which is much more efficient in terms of the size of the library.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách lập hồ sơ hiệu năng cho các mô-đun xây dựng mã shader cho các ngôn ngữ GPU và việc xây dựng chuỗi thông báo exception được mô tả trong issue. So sánh các phương pháp ghép các chuỗi dài, sau đó xác minh rằng kích thước thư viện đã được giảm xuống gần mục tiêu đã nêu là 1 MB hoặc ít hơn mà không làm mất tính dễ đọc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- performance
- Loại issue
- Tái cấu trúc
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100