GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Performance: Reduce refcount churn in csv.reader · Issue #156748 · python/cpython

Performance: Reduce refcount churn in csv.reader #156748

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
Performance: Reduce refcount churn in csv.reader#156748
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirperformancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement

Description

@brittanyrey
brittanyrey
opened on Aug 31, 2026
Issue body actions

Minor change to reduce churn in parse_save_field(). It currently calls PyList_Append(self->fields, field); Py_DECREF(field) for every field of every row. PyList_Append internally does Py_NewRef(newitem), so each field pays an incref immediately followed by a decref, plus a critical-section enter/exit.
Since the reference is already about to be dropped, just pass the reference directly to the caller.

(PR is written & ready to attach)

Linked PRs

  • gh-156748 : Performance - Use takeref append in _csv #156749

Activity

  1. aisk
    added
    type-featureA feature request or enhancementA feature request or enhancement
    performancePerformance or resource usagePerformance or resource usage
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Sep 1, 2026
  2. aisk
    added this to CSV issues 📊on Sep 1, 2026
  3. eendebakpt commented on Sep 1, 2026

    @eendebakpt
    eendebakpt
    on Sep 1, 2026
    Contributor
    More actions

    This one is covered by #150942

  4. picnixz
    closed this as a duplicateof Improve performance by using reference stealing methods #150942 on Sep 1, 2026
  5. github-project-automation
    moved this to Done in CSV issues 📊on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirC modules in the Modules dirperformancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • CSV issues 📊
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.