Change `getSamples()` return type from `array` to `iterable`

Aperta
#227 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php
Ambito
databases

Direzione di ricerca

Start at the getSamples()/getSample() method and trace how anonymizers consume its return value. Check which callers require an array and which can work with iterable values. Done means the API and its callers support sequential generators without materializing all samples, while preserving current behavior.

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

Descrizione

enhancement

Later in anonymizers, we will have file loaders.

The getSample() method returns an array, but file readers will read files sequentially using generators, which will force us to create a temporary array with all values in memory for nothing.

Using iterable typing and using it accordingly will allow us to never go through an array and gain memory and speed (and avoid potential memory limit errors in constrained environments).

Lingua principale
PHP
Stelle
235
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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 makinacorpus/DbToolsBundle

Tutte le issue di makinacorpus/DbToolsBundle

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.