Slow print (STDOUT) of large objects

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

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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
devtools

Hướng nghiên cứu

Start by running the reported Ruby 3.3.0 reproduction with the debug gem and stopping at binding.break, then inspect how evaluating result writes large objects to STDOUT. Done should provide a pagination or offset mechanism by default so large objects can be inspected without printing everything at once.

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

Mô tả

Your environment

  • ruby -v: 3.3.0
  • rdbg -v: 1.9.1

Describe the bug
Hi, I'm not sure if this is a bug or a request for an additional feature (or if there is already a way to circumvent it), but when I try to print large objects to STDOUT during the debug session, it takes ages to do so because it tries to puts everything to the screen I believe.

To Reproduce

require 'debug'

def dummy_embeddings
  arr = []
  1536.times do
    arr << 0.012312321312321
  end
  arr
end

result = []
1000.times do
  result << {
    a: 1,
    b: 2,
    dummy_embeddings: dummy_embeddings
  }
end

binding.break

# result

Expected behavior
Other debuggers add some kind of offest/"pagination" by default, when printing large objects. It would be great if this gem could do that too.

Ngôn ngữ chính
Ruby
Star
1.3k
Fork
146
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở 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 ruby/debug

Tất cả issue của ruby/debug

Issue tương tự

Thêm issue về Ruby

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.