Skip to content

Keep duplicate column naming linear - #1219

Open
quinnj wants to merge 1 commit into
mainfrom
claude/makeunique-linear
Open

quinnj wants to merge 1 commit into
mainfrom
claude/makeunique-linear

Conversation

@quinnj

@quinnj quinnj commented Oct 22, 2026

Copy link
Copy Markdown
Member

A header with many copies of one name was quadratic to read. makeunique! restarted its suffix search at _1 for every duplicate, so N copies built O(N²) symbols:

copies of one name CSV 0.10.16 main this PR
10,000 0.11 s 40 s 0.007 s
20,000 149 s 0.014 s

0.10 kept the next suffix per name since #955 (a 30k-column file with 10k duplicates); the 1.0 rewrite dropped it. Each name now resumes its search after the last suffix it assigned. Names are unchanged: the new function matched both the 1.1.0 and the 0.10.16 algorithm on 200,000 random name lists full of collisions and _k look-alikes.

Verification:

  • New testset duplicate column names (the three naming cases from Improve performance of reading files with duplicate column names #955 plus an allocation bound): fails on main (4,000 copies allocate 2.88 GB; bound is 100 MB) and passes here (1.8 MB).
  • Full suite julia --project=test --check-bounds=yes -t4 test/runtests.jl: 331,783 passed (Julia 1.12.6).

🤖 Generated with Claude Code

makeunique! restarted the suffix search at _1 for every duplicate, so a
header with N copies of one name built O(N^2) symbols: 10,000 copies of
one name took 40 seconds to read, and 20,000 took 149 seconds (CSV
0.10.16: 0.1 seconds). Each name now resumes its search after the last
suffix it assigned, as 0.10 did since #955. The names are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.79%. Comparing base (2f84f42) to head (6e265ce).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1219   +/-   ##
=======================================
  Coverage   95.79%   95.79%           
=======================================
  Files           9        9           
  Lines        5566     5569    +3     
=======================================
+ Hits         5332     5335    +3     
  Misses        234      234           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant