惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
V
V2EX
Martin Fowler
Martin Fowler
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
博客园 - 【当耐特】
Cisco Talos Blog
Cisco Talos Blog
The Hacker News
The Hacker News
K
Kaspersky official blog
Security Latest
Security Latest
H
Help Net Security
博客园_首页
美团技术团队
Spread Privacy
Spread Privacy
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
G
Google Developers Blog
NISL@THU
NISL@THU
爱范儿
爱范儿
I
Intezer
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Hacker News: Ask HN
Hacker News: Ask HN
I
InfoQ
The Cloudflare Blog
F
Full Disclosure
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Introducing roo-smarter_csv — A Drop-In Roo CSV Backend That's 3–4.6x Faster
Tilo Sloboda · 2026-05-20 · via DEV Community

Roo is great at hiding the differences between CSV, XLSX, ODS, and friends behind one spreadsheet-style API, but its CSV processing is slow.

Meet roo-smarter_csv — a drop-in backend that makes Roo's CSV path 3–4.6× faster and significantly more robust against messy real-world data, without changing a single line of your existing Roo code.

gem 'roo-smarter_csv'

Enter fullscreen mode Exit fullscreen mode

require 'roo-smarter_csv'

spreadsheet = Roo::Spreadsheet.open('people.csv')
spreadsheet.cell(2, 1)   # => "John"
spreadsheet.row(2)       # => ["John", 30, "john@example.com", 50000]

Enter fullscreen mode Exit fullscreen mode

That's the whole integration. Roo::Spreadsheet.open, cell, row, column, each, parse, first_row / last_row, first_column / last_column, to_csv — all the methods you already use keep working exactly as before. Under the hood, SmarterCSV does the parsing.


Why a new backend?

For CSV specifically, Roo delegates to Ruby's built-in CSV library, and there are three long-standing problems with Ruby CSV:

  1. It's slow. Ruby's CSV is the bottleneck in many real-world Roo CSV pipelines.
  2. It requires manual configuration. You need to provide the parameters for column and row separators, amongst other things.
  3. It's fragile against real-world data. Inconsistent separators, BOMs, mixed quote styles, embedded newlines, and numeric coercion edge cases can cause silent data corruption — see 10 Ways Ruby's CSV.read Can Silently Corrupt or Lose Your Data for a tour.

roo-smarter_csv swaps SmarterCSV in as the parser while keeping Roo's spreadsheet API as the public model. SmarterCSV has been around for 14 years — a battle-tested library you can rely on. You get its speed, robustness, and automatic detection of parameters — and nothing about how you call Roo changes.


Performance: 3–4.6× faster than Roo::CSV

Speedup measured against Roo's built-in CSV backend, using SmarterCSV 1.17.1:

File Speedup
PEOPLE_IMPORT_B.csv 2.98×
uscities.csv 4.22×
uszips.csv 4.45×
worldcities.csv 4.58×
embedded_newlines_60k.csv 3.84×
heavy_quoting_60k.csv 3.42×
many_empty_fields_60k.csv 3.36×
sample_100k.csv 3.17×
sensor_data_50krows_50cols.csv 3.23×
tab_separated_60k.tsv 3.14×
utf8_multibyte_60k.csv 3.17×

The speedup holds up across the awkward shapes Ruby's CSV tends to choke on — heavy quoting, embedded newlines, many empty fields, UTF-8 multibyte content, tab-separated input. SmarterCSV's C extension does the heavy lifting; the Roo grid model is populated from the parsed rows.

For deeper benchmark background, see the recent SmarterCSV 1.16 release notes and the SmarterCSV 1.15.2 benchmark write-up.


Benefits beyond speed

The performance number is the headline, but the robustness improvements are arguably more valuable on a production import path.

Automatic separator detection

SmarterCSV's col_sep: :auto and row_sep: :auto are the effective defaults. CSV exports from Excel, MySQL, PostgreSQL, Google Sheets, and assorted European tools use different separators (,, ;, \t) and different line endings (\n, \r\n, \r). With Ruby's CSV you have to know upfront — guess wrong and you get one giant row, or one column with embedded commas. With roo-smarter_csv you usually don't need to specify anything:

Roo::Spreadsheet.open('us_export.csv')        # comma-separated, LF
Roo::Spreadsheet.open('eu_export.csv')        # semicolon-separated, CRLF
Roo::Spreadsheet.open('mysql_export.tsv', extension: :csv)   # tab-separated

Enter fullscreen mode Exit fullscreen mode

All three Just Work.

Automatic numeric conversion

convert_values_to_numeric: true is on by default. Cells containing "30" become 30, "1.5" becomes 1.5. With Ruby's CSV you'd write the coercion yourself, or pass converters: :numeric and pray you don't have ZIP codes with leading zeros (Ruby CSV mangles those - SmarterCSV handles those correctly).

spreadsheet.cell(2, 2)   # => 30        (Integer, not "30")
spreadsheet.cell(2, 4)   # => 1.5       (Float, not "1.5")

Enter fullscreen mode Exit fullscreen mode

UTF-8 BOM handling

Excel loves to write a UTF-8 BOM at the start of CSV files. Ruby's CSV will happily put a <0xfeff> at the start of your first header. SmarterCSV strips the BOM transparently — your first column header is the actual header.

Robust quote handling

SmarterCSV 1.16 ships RFC 4180–compliant quote boundary handling by default, plus quote_escaping: :auto that handles both "" (RFC) and \" (MySQL, PostgreSQL COPY TO) escape conventions row-by-row. Mid-field quotes (5'10", O'Brien) no longer toggle quoted mode and silently corrupt rows.

Same spreadsheet model

Critically, none of this changes how Roo presents the data. SmarterCSV row hashes are an internal parsing representation; Roo still stores everything in its coordinate-based cell grid, so cell(row, col), row(n), column(n), first_row, last_row, each, parse, and to_csv all behave exactly as Roo users expect.

Blank rows stay addressable, too — roo-smarter_csv sets remove_empty_hashes: false so Roo's row numbering matches the file even when rows are empty.


Installation

# Gemfile
gem 'roo-smarter_csv'

Enter fullscreen mode Exit fullscreen mode

bundle install

Enter fullscreen mode Exit fullscreen mode

# Anywhere in your app's boot path (config/application.rb, an initializer, etc.)
require 'roo-smarter_csv'

Enter fullscreen mode Exit fullscreen mode

require "roo-smarter_csv" loads both roo and smarter_csv and registers Roo::SmarterCSV as Roo's CSV handler. From that point on, every Roo::Spreadsheet.open(...) on a CSV file routes through SmarterCSV.


Usage examples

Drop-in replacement

require 'roo'
require 'roo-smarter_csv'

csv = Roo::Spreadsheet.open('people.csv')

csv.cell(2, 1)      # => "John"
csv.cell(2, 2)      # => 30
csv.row(2)          # => ["John", 30, "john@example.com", 50000]
csv.first_row       # => 1
csv.last_row        # => 4

csv.each do |row|
  # process row
end

Enter fullscreen mode Exit fullscreen mode

TSV (tab-separated)

csv = Roo::Spreadsheet.open(
  'people.tsv',
  extension: :csv,
  csv_options: { col_sep: "\t" }
)

Enter fullscreen mode Exit fullscreen mode

StringIO / in-memory input

io = StringIO.new("Name,Age\nAlice,30\nBob,25\n")
csv = Roo::Spreadsheet.open(io, extension: :csv)
csv.row(2)   # => ["Alice", 30]

Enter fullscreen mode Exit fullscreen mode

Passing SmarterCSV options directly

csv = Roo::Spreadsheet.open(
  'data.csv',
  smarter_csv: {
    col_sep:    ';',
    quote_char: '"',
    encoding:   'utf-8',
  }
)

Enter fullscreen mode Exit fullscreen mode


Options: two namespaces, clear precedence

roo-smarter_csv understands two option namespaces and resolves them in a predictable order.

smarter_csv: — the primary namespace

Anything SmarterCSV accepts can go here:

Roo::Spreadsheet.open('data.csv',
  smarter_csv: {
    col_sep: ';',
    row_sep: "\n",
    quote_char: '"',
    encoding: 'utf-8',
  })

Enter fullscreen mode Exit fullscreen mode

csv_options: — Roo compatibility namespace

If you already pass csv_options: to Roo, the following four keys are bridged into the effective SmarterCSV options:

  • col_sep
  • row_sep
  • quote_char
  • encoding

No other Roo options are treated as CSV parser settings.

Precedence rules

  1. Start with SmarterCSV defaults.
  2. Apply roo-smarter_csv Roo-compatibility overrides (notably remove_empty_hashes: false).
  3. Copy the supported keys from csv_options: into the effective SmarterCSV options.
  4. Apply smarter_csv: on top.
  5. If the same key exists in both places, smarter_csv: wins and a warning is emitted.
Roo::Spreadsheet.open(
  'data.csv',
  csv_options:  { col_sep: ';'  },
  smarter_csv:  { col_sep: "\t" }   # ← wins, warning emitted
)

Enter fullscreen mode Exit fullscreen mode

This means existing Roo code that passes csv_options: keeps working unchanged, and you can opt into the full SmarterCSV option surface whenever you want.

Effective defaults

When you pass no options at all, the effective configuration is:

  • col_sep: :auto — auto-detect separator
  • row_sep: :auto — auto-detect line endings
  • quote_char: '"'
  • downcase_header: true
  • strings_as_keys: false
  • convert_values_to_numeric: true
  • remove_empty_hashes: false (Roo-compat override)
  • headers_in_file: true

That covers the vast majority of real-world CSV inputs without any configuration.


What it does not change

roo-smarter_csv is intentionally narrow in scope:

  • It only affects CSV. Roo's XLSX, ODS, and other backends are untouched.
  • It preserves Roo's coordinate model. SmarterCSV's hash-of-symbols rows are an internal parsing artifact — the public API is still spreadsheet-style cells, rows, and columns.
  • It preserves Roo's single-sheet CSV behavior. A CSV file is still a single sheet.
  • It preserves to_csv export for the in-memory spreadsheet representation.

If you've been using Roo's CSV path and the rest of your code expects Roo's grid API, nothing in your code needs to change.


When to reach for it

roo-smarter_csv is the right choice when:

  • You already have a Roo-based pipeline and don't want to rewrite it.
  • You import CSV files from heterogeneous sources (different tools, locales, separator conventions).
  • Your imports are big enough that a 3–4× speedup matters.
  • You've been hitting silent data quality bugs caused by Ruby CSV's defaults.

If you're starting fresh and don't need Roo's multi-format abstraction, use SmarterCSV directly — you get the same speed plus a richer hash-based API (chunked processing, instrumentation hooks, bad-row quarantine, key_mapping, column selection, and more). See Switch from Ruby CSV to SmarterCSV in 5 Minutes.


New to SmarterCSV?


That's it ✨

gem 'roo-smarter_csv'

Enter fullscreen mode Exit fullscreen mode

require 'roo-smarter_csv'

Enter fullscreen mode Exit fullscreen mode

Two lines, no API change, 3–4.6× faster CSV imports and much better tolerance for real-world data.


Issues, feedback, and PRs welcome.