Slow print (STDOUT) of large objects

Aperta
#1,075 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
ruby
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Ruby
Stelle
1.3k
Fork
146
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ruby/debug

Tutte le issue di ruby/debug

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.