Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow print (STDOUT) of large objects #1075

Open
AlexAvlonitis opened this issue Feb 9, 2024 · 0 comments
Open

Slow print (STDOUT) of large objects #1075

AlexAvlonitis opened this issue Feb 9, 2024 · 0 comments

Comments

@AlexAvlonitis
Copy link

AlexAvlonitis commented Feb 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant