[ 
https://issues.apache.org/jira/browse/CSV-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381356#comment-17381356
 ] 

Gary D. Gregory commented on CSV-278:
-------------------------------------

Here are the results for my runs.

-- BEFORE APPLYING PR https://github.com/apache/commons-csv/pull/162
{noformat}
# JMH version: 1.32
# VM version: JDK 1.8.0_292, OpenJDK 64-Bit Server VM, 25.292-b10
# VM invoker: 
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/bin/java
# VM options: -server -Xms1024M -Xmx1024M
# Blackhole mode: full + dont-inline hint
# Warmup: 5 iterations, 10 s each
# Measurement: 20 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.apache.commons.csv.CSVBenchmark.parseCommonsCSV

# Run progress: 0.00% complete, ETA 00:04:10
# Fork: 1 of 1
# Warmup Iteration   1: 2078.928 ms/op
# Warmup Iteration   2: 1735.951 ms/op
# Warmup Iteration   3: 1731.464 ms/op
# Warmup Iteration   4: 1732.816 ms/op
# Warmup Iteration   5: 1732.228 ms/op
Iteration   1: 1731.764 ms/op
Iteration   2: 1732.523 ms/op
Iteration   3: 1734.367 ms/op
Iteration   4: 1732.795 ms/op
Iteration   5: 1731.759 ms/op
Iteration   6: 1731.918 ms/op
Iteration   7: 1759.762 ms/op
Iteration   8: 1733.014 ms/op
Iteration   9: 1760.990 ms/op
Iteration  10: 1734.031 ms/op
Iteration  11: 1731.014 ms/op
Iteration  12: 1733.838 ms/op
Iteration  13: 1884.243 ms/op
Iteration  14: 1794.986 ms/op
Iteration  15: 1725.279 ms/op
Iteration  16: 1725.826 ms/op
Iteration  17: 1726.203 ms/op
Iteration  18: 1725.926 ms/op
Iteration  19: 1727.094 ms/op
Iteration  20: 1726.190 ms/op


Result "org.apache.commons.csv.CSVBenchmark.parseCommonsCSV":
  1744.176 ±(99.9%) 32.134 ms/op [Average]
  (min, avg, max) = (1725.279, 1744.176, 1884.243), stdev = 37.006
  CI (99.9%): [1712.042, 1776.310] (assumes normal distribution)


# Run complete. Total time: 00:04:23

REMEMBER: The numbers below are just data. To gain reusable insights, you need 
to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design 
factorial
experiments, perform baseline and negative tests that provide experimental 
control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from 
the domain experts.
Do not assume the numbers tell you what you want them to tell.

Benchmark                     Mode  Cnt     Score    Error  Units
CSVBenchmark.parseCommonsCSV  avgt   20  1744.176 ± 32.134  ms/op
{noformat}
-- AFTER APPLYING PR https://github.com/apache/commons-csv/pull/162
{noformat}
# JMH version: 1.32
# VM version: JDK 1.8.0_292, OpenJDK 64-Bit Server VM, 25.292-b10
# VM invoker: 
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/bin/java
# VM options: -server -Xms1024M -Xmx1024M
# Blackhole mode: full + dont-inline hint
# Warmup: 5 iterations, 10 s each
# Measurement: 20 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.apache.commons.csv.CSVBenchmark.parseCommonsCSV

# Run progress: 0.00% complete, ETA 00:04:10
# Fork: 1 of 1
# Warmup Iteration   1: 1797.286 ms/op
# Warmup Iteration   2: 1530.711 ms/op
# Warmup Iteration   3: 1523.519 ms/op
# Warmup Iteration   4: 1558.774 ms/op
# Warmup Iteration   5: 1528.387 ms/op
Iteration   1: 1559.851 ms/op
Iteration   2: 1524.913 ms/op
Iteration   3: 1524.326 ms/op
Iteration   4: 1525.966 ms/op
Iteration   5: 1530.290 ms/op
Iteration   6: 1525.912 ms/op
Iteration   7: 1525.376 ms/op
Iteration   8: 1525.431 ms/op
Iteration   9: 1525.917 ms/op
Iteration  10: 1526.005 ms/op
Iteration  11: 1532.988 ms/op
Iteration  12: 1517.567 ms/op
Iteration  13: 1516.962 ms/op
Iteration  14: 1520.299 ms/op
Iteration  15: 1517.392 ms/op
Iteration  16: 1517.772 ms/op
Iteration  17: 1517.473 ms/op
Iteration  18: 1518.316 ms/op
Iteration  19: 1517.181 ms/op
Iteration  20: 1542.505 ms/op


Result "org.apache.commons.csv.CSVBenchmark.parseCommonsCSV":
  1525.622 ±(99.9%) 8.962 ms/op [Average]
  (min, avg, max) = (1516.962, 1525.622, 1559.851), stdev = 10.321
  CI (99.9%): [1516.660, 1534.585] (assumes normal distribution)


# Run complete. Total time: 00:04:29

REMEMBER: The numbers below are just data. To gain reusable insights, you need 
to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design 
factorial
experiments, perform baseline and negative tests that provide experimental 
control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from 
the domain experts.
Do not assume the numbers tell you what you want them to tell.

Benchmark                     Mode  Cnt     Score   Error  Units
CSVBenchmark.parseCommonsCSV  avgt   20  1525.622 ± 8.962  ms/op
{noformat}


> Reuse Buffers in Lexer for Delimiter Detection
> ----------------------------------------------
>
>                 Key: CSV-278
>                 URL: https://issues.apache.org/jira/browse/CSV-278
>             Project: Commons CSV
>          Issue Type: Sub-task
>            Reporter: David Mollitor
>            Priority: Minor
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> When a character is read, and it could be the first character of the 
> delimiter, a look-ahead is performed on the stream to determine if this will 
> be the delimiter.  This look ahead initiates a new buffer to read into for 
> each call.  This can cause overhead and much more turn in the heap.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to