perf(gfql): CPU PageRank spends ~95% of its time in to_igraph conversion and join-back, not the solver

Aperta
#2,032 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
numpy, pandas, python
Ambito
data, performance

Direzione di ricerca

Start with the to_igraph conversion and score join-back used by the CPU call('pagerank') path; the issue does not name their source files or tests. Profile those stages on the LiveJournal polars frame before investigating the listed suspects. Done means a pyg-bench receipt shows conversion plus join-back under 2x solver time, and the CPU PageRank rung is rerun under the same protocol.

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

Descrizione

On the LiveJournal graph (4.8M nodes, 69M edges, polars frames) a call('pagerank') on the CPU path takes 52.6 s of which the igraph solver (igraph.Graph.pagerank) is 2.8 s. The remaining ~50 s is to_igraph (frame to igraph edge list, node re-indexing) plus joining the scores back onto the node frame.

Measured 2026-09-04 on dgx-spark under the receipted-lane protocol (private pyg-bench GraphFrames ladder, lj-polars-pagerank; solver time from the runner's phase receipt). Numbers here are diagnostic, not the published cells.

Expected: conversion should be a small constant factor over the solver, i.e. a few seconds, not 18x the solver.

Suspects (not yet profiled at function level):

  • building the igraph graph from a Python-level edge iterable instead of a contiguous integer array pair (Graph(n, edges=...) with edges as a 2-column numpy array),
  • id remapping through pandas factorize/merge on the full node table instead of a single dense mapping,
  • the join-back of scores merging on the id column rather than positional assignment when the node order is preserved.

Acceptance: a pyg-bench receipt where to_igraph + join-back is under 2x the solver on LJ, and the CPU PageRank rung re-run under the same protocol.

Related: plans/gfql-benchmark-numbers/plan.md T2.10.6.

Lingua principale
Python
Stelle
2.6k
Fork
229
Merge medio
1g 5h
PR unite (30g)
99

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 graphistry/pygraphistry

Tutte le issue di graphistry/pygraphistry

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.