Skip to content

Instantly share code, notes, and snippets.

@enebo
Created February 4, 2023 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enebo/785b29fe428186aa4517d58d91fcc500 to your computer and use it in GitHub Desktop.
Save enebo/785b29fe428186aa4517d58d91fcc500 to your computer and use it in GitHub Desktop.

current csv:

Total time: 169.50

     total        self    children       calls  method
----------------------------------------------------------------
    168.12        0.00      168.11           1  Integer#times
    168.11        0.00      168.11          60  Benchmark.realtime
    168.11        0.00      168.10          30  CSV.foreach
    168.10        0.00      168.10          30  CSV.open
    168.07        0.00      168.07          30  CSV#each
    167.81        0.00      167.81         112  Enumerator#each
    167.80        0.00      167.80          60  CSV::Parser#parse
    167.79        0.00      167.79          30  CSV::Parser#parse_quotable_loose
    167.79        0.07      167.72          30  CSV::Parser::InputsScanner#each_line
    163.48        4.07      159.41       37020  String#each_line
    156.51       38.04      118.46          30  CSV::Parser#parse_quotable_robust
     69.65        5.47       64.18    30921930  CSV::Parser#parse_column_value
     64.18       16.74       47.44    30921930  CSV::Parser#parse_quoted_column_value
     39.76       16.37       23.39    69028020  CSV::Parser::InputsScanner#scan_all
     37.72        6.48       31.24    31184040  CSV::Parser::InputsScanner#scan
     31.76        0.37       31.39      299100  CSV::Parser::InputsScanner#read_chunk
     30.58       30.58        0.00      299065  IO#gets
     27.84        0.12       27.73      262080  CSV::Parser#parse_row_end
     22.16       22.16        0.00   100212061  StringScanner#scan
     15.10        5.11       10.00    30921930  CSV::Parser#parse_column_end
      3.08        3.08        0.00   100200390  StringScanner#eos?
      2.80        2.80        0.00    66322349  Array#<<
      2.60        2.60        0.00    19054320  String#<<
      2.56        2.56        0.00    35400330  CSV::Parser#validate_field_size
      2.30        2.30        0.00    35401661  String#[]
      2.23        2.23        0.00    49975091  String#length
      1.90        1.90        0.00    69319582  Kernel.nil?
      1.18        0.06        1.12          54  Kernel.require
      1.13        1.13        0.00    35400360  Integer#zero?
      0.92        0.11        0.81          18  Kernel.load
      0.65        0.42        0.23      599160  CSV::Parser::InputsScanner#adjust_last_keep
      0.62        0.09        0.53      299980  Class#new
      0.54        0.00        0.54         294  Array#each
      0.50        0.11        0.39      262080  CSV::Parser#start_row
      0.48        0.00        0.48          18  Kernel.require
      0.47        0.22        0.25      300000  CSV::Parser#emit_row
      0.43        0.00        0.43           1  Gem::Specification.load_defaults
      0.43        0.00        0.43           1  Gem::Specification.each_spec
      0.43        0.00        0.43           1  Gem::Specification.each_gemspec
      0.35        0.13        0.22          59  Kernel.require_relative
      0.35        0.35        0.00       38022  String#split
      0.32        0.13        0.18      300090  CSV::Parser::InputsScanner#keep_start
      0.28        0.00        0.28          73  Gem::Specification.load
      0.28        0.28        0.00     8957321  Array#[]
      0.27        0.00        0.27          30  CSV#parser_enumerator
      0.27        0.00        0.27          30  CSV#parser
      0.25        0.00        0.25          30  CSV::Parser#initialize
      0.25        0.00        0.25          30  CSV::Parser#prepare
      0.25        0.09        0.16      300000  CSV::FieldsConverter#convert
      0.25        0.25        0.00     4478460  String#count
Total time: 106.90

     total        self    children       calls  method
----------------------------------------------------------------
    105.51        0.00      105.51           1  Integer#times
    105.51        0.00      105.51          60  Benchmark.realtime
    105.50        0.00      105.50          30  CSV.foreach
    105.50        0.00      105.50          30  CSV.open
    105.39        0.21      105.18          30  CSV#each
    105.18        0.24      104.95      300030  CSV#shift
    104.82        0.79      104.03      300030  Kernel.loop
     71.26       31.83       39.42      300211  Array#each
     29.74       29.74        0.00      300115  IO#gets
     10.52        7.41        3.11    70800239  BasicObject#!=
      7.96        7.96        0.00   106200067  String#[]
      5.02        5.02        0.00    35400323  String#=~
      3.91        3.91        0.00    35400000  String#gsub!
      2.93        2.93        0.00    70800984  String#==
      2.87        2.87        0.00    35400000  String#*
      2.68        2.68        0.00      300028  String#split
      2.22        2.22        0.00    70800222  Array#last
      1.94        1.94        0.00    35400000  String#count
      1.76        1.76        0.00    35700894  Hash#[]
      1.51        1.51        0.00    35400124  Integer#==
      1.37        1.37        0.00    35400055  Array#<<
      1.20        0.07        1.13          44  Kernel.require
      0.97        0.10        0.87          18  Kernel.load
      0.89        0.89        0.00      300000  String#sub!
      0.47        0.00        0.47           1  Gem::Specification.load_defaults
      0.47        0.00        0.47           1  Gem::Specification.each_spec
      0.47        0.00        0.47           1  Gem::Specification.each_gemspec
      0.44        0.00        0.44          13  Kernel.require
      0.37        0.09        0.27      300715  Class#new
      0.29        0.00        0.29          69  Gem::Specification.load
      0.25        0.08        0.16         145  Kernel.eval
      0.24        0.12        0.12          45  Kernel.require_relative
      0.18        0.01        0.17          63  Gem.register_default_spec
      0.17        0.17        0.00           6  JRuby::Util.load_ext
      0.15        0.02        0.13          68  Gem::Specification#initialize
      0.11        0.00        0.11           5  Kernel.gem
      0.10        0.00        0.10           5  Gem::Dependency#to_spec
      0.10        0.00        0.10           5  Gem::Dependency#to_specs
      0.10        0.00        0.10           5  Gem::Dependency#matching_specs
      0.09        0.00        0.08          30  CSV#initialize
      0.08        0.00        0.07           4  Kernel.send
      0.07        0.04        0.02        1124  Array#any?
      0.06        0.00        0.06         105  IO.open
      0.06        0.00        0.06          30  CSV#init_separators
      0.06        0.01        0.05         973  Gem.already_loaded?
      0.06        0.00        0.05          75  Gem.open_file
      0.05        0.01        0.04          99  Gem::Version#<=>
      0.05        0.00        0.05          98  Comparable.>=
      0.05        0.01        0.04         272  Array#map!
      0.05        0.00        0.05           5  Gem::Specification.stubs_for                                           
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment