Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[iOS]: anyTextHaveBeenModified performance

Đang mở
#336 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
react-native
Lĩnh vực
mobile, performance

Hướng nghiên cứu

Bắt đầu bằng cách xác định anyTextHaveBeenModified và lệnh gọi của nó từ textViewDidChange, sau đó lập hồ sơ hiệu năng khi nhập trong một trường HTML có khoảng 3k ký tự. Xem xét việc xử lý màu sắc, tiêu đề và khoảng trắng độ rộng bằng không được mô tả trong issue; được xem là hoàn tất khi việc chỉnh sửa ký tự không còn gây ra độ trễ đáng kể đối với con trỏ hoặc việc cập nhật văn bản.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug
At the moment, when working with a medium-sized text and typing quickly, the caret and text updates can feel noticeably laggy. This appears to be caused by anyTextHaveBeenModified being executed on every text change within the text view. Since this method iterates over the entire input range and processes blockquote and inline code colors, heading styles, and zero-width spaces, it is relatively expensive.

In practice, this results in a performance cost of approximately 25 ms per single character change for an HTML input of around 3k characters, which is not particularly large.

Image
Proposed solution
  1. It may be worth reconsidering whether color handling is necessary inside textViewDidChange. Similar to the approach used in the foreground color styles PRs, this logic could potentially be handled elsewhere, with base colors restored in the same way if needed.
  2. Improper headings could likely be resolved in a single pass, rather than running separate logic for each heading style.
  3. At this point, it is unclear how best to handle zero-width spaces. However, with the new parser and serializer implementation, it may be unlikely for them to appear in the text view at all.

Expected behavior

Typing shouldn't be laggy

Screenshots
If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Ngôn ngữ chính
C
Star
1.4k
Fork
67
Merge trung bình
3 ngày 22 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của software-mansion/react-native-enriched-html

Tất cả issue của software-mansion/react-native-enriched-html

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.