Skip to content

Conversation

@yaslab
Copy link
Owner

@yaslab yaslab commented Nov 14, 2018

Improved speed of reading from file. (6a18924, 028bd2f)

Result of the performance test

  • OS: Ubuntu 16.04
  • Swift: 4.2.1-RELEASE
  • Build Configuration: release
  • CSV file info
    • File size: 13.3MB (15310 records, 55 fields)
    • Encoding: UTF-8 (Including ASCII and Japanese)
Before (v2.2.1) After (this branch) Delta
1st 35.313s 5.811s -83.5%
2nd 35.964s 5.746s -84.0%
3rd 35.672s 5.732s -83.9%

Test code

// main.swift
import Foundation
import CSV

let stream = InputStream(fileAtPath: "/path/to/file.csv")!
let csv = try! CSVReader(stream: stream, hasHeaderRow: true)
while csv.next() != nil {}

@yaslab yaslab self-assigned this Nov 14, 2018
@codecov
Copy link

codecov bot commented Nov 14, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@329bf23). Click here to learn what that means.
The diff coverage is 92.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #65   +/-   ##
=========================================
  Coverage          ?   96.17%           
=========================================
  Files             ?       12           
  Lines             ?     1149           
  Branches          ?        0           
=========================================
  Hits              ?     1105           
  Misses            ?       44           
  Partials          ?        0
Impacted Files Coverage Δ
Tests/CSVTests/CSVReaderTests.swift 100% <ø> (ø)
Sources/CSV/CSVReader.swift 96.38% <ø> (ø)
Tests/CSVTests/UnicodeTests.swift 100% <100%> (ø)
Sources/CSV/CSVWriter.swift 91.48% <100%> (ø)
Sources/CSV/BinaryReader.swift 85.91% <90.62%> (ø)
Tests/CSVTests/BinaryReaderTests.swift 92.64% <92.64%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 329bf23...1e83c6e. Read the comment docs.

@yaslab
Copy link
Owner Author

yaslab commented Nov 17, 2018

This branch can not be built by 1e83c6e. I will fix it with another PR.

@yaslab yaslab merged commit d124b1a into master Nov 17, 2018
@yaslab yaslab deleted the speed-up branch November 17, 2018 06:55
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