Skip to content

set(range(100000)).difference(set()) is slow #52931

@spiv

Description

@spiv
mannequin
BPO 8685
Nosy @rhettinger, @abalkin, @pitrou, @pjenvey, @florentx
Files
  • set-difference-speedup.diff: Small patch to improve the performance of large_set.difference(small_set)
  • set-difference-speedup-2.diff: Corrected patch.
  • set-mem.py: Quick script to show memory consumption of set.difference on linux
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/pitrou'
    closed_at = <Date 2010-11-30.22:24:53.628>
    created_at = <Date 2010-05-11.09:04:17.799>
    labels = ['interpreter-core', 'performance']
    title = 'set(range(100000)).difference(set()) is slow'
    updated_at = <Date 2010-11-30.22:24:53.626>
    user = 'https://bugs.python.org/spiv'

    bugs.python.org fields:

    activity = <Date 2010-11-30.22:24:53.626>
    actor = 'pitrou'
    assignee = 'pitrou'
    closed = True
    closed_date = <Date 2010-11-30.22:24:53.628>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2010-05-11.09:04:17.799>
    creator = 'spiv'
    dependencies = []
    files = ['17292', '17293', '17306']
    hgrepos = []
    issue_num = 8685
    keywords = ['patch']
    message_count = 19.0
    messages = ['105489', '105490', '105494', '105524', '105585', '105586', '105823', '105885', '105909', '113405', '113418', '113430', '113498', '115295', '115315', '115319', '122936', '122937', '122942']
    nosy_count = 7.0
    nosy_names = ['rhettinger', 'spiv', 'belopolsky', 'pitrou', 'pjenvey', 'stutzbach', 'flox']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue8685'
    versions = ['Python 3.2']

    Metadata

    Metadata

    Assignees

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions