roo-rb / roo

Roo provides an interface to spreadsheets of several sorts.
MIT License
2.79k stars 501 forks source link

Inherit Roo::Excelx::Coordinate from Array #458

Closed chopraanmol1 closed 6 years ago

chopraanmol1 commented 6 years ago

Profiling Script

MemoryProfiler.report{ Roo::Excelx.new(file_name).tap{|x|(2..x.last_row).each{|i| x.row(i)}} }.pretty_print

Master:

Total allocated: 34559100 bytes (504994 objects)
Total retained:  5563403 bytes (103022 objects)

allocated memory by gem
-----------------------------------
  19254338  roo/lib
   8509100  nokogiri-1.8.4
   6793822  rubyzip-1.2.2
      1304  tmpdir
       320  weakref
       216  other

allocated objects by gem
-----------------------------------
    358381  roo/lib
    145846  nokogiri-1.8.4
       735  rubyzip-1.2.2
        22  tmpdir
         8  weakref
         2  other

retained memory by gem
-----------------------------------
   5561094  roo/lib
       792  rubyzip-1.2.2
       725  nokogiri-1.8.4
       320  weakref
       296  tmpdir
       176  other

retained objects by gem
-----------------------------------
    102989  roo/lib
        14  nokogiri-1.8.4
         8  weakref
         7  rubyzip-1.2.2
         3  tmpdir
         1  other

After Patch:

Total allocated: 33439850 bytes (477013 objects)
Total retained:  4444153 bytes (75041 objects)

allocated memory by gem
-----------------------------------
  18135098  roo/lib
   8509100  nokogiri-1.8.4
   6793812  rubyzip-1.2.2
      1304  tmpdir
       320  weakref
       216  other

allocated objects by gem
-----------------------------------
    330400  roo/lib
    145846  nokogiri-1.8.4
       735  rubyzip-1.2.2
        22  tmpdir
         8  weakref
         2  other

retained memory by gem
-----------------------------------
   4441854  roo/lib
       782  rubyzip-1.2.2
       725  nokogiri-1.8.4
       320  weakref
       296  tmpdir
       176  other

retained objects by gem
-----------------------------------
     75008  roo/lib
        14  nokogiri-1.8.4
         8  weakref
         7  rubyzip-1.2.2
         3  tmpdir
         1  other

Summary

Provide a general description of the code changes in your pull request... were there any bugs you had fixed? If so, mention them. If these bugs have open GitHub issues, be sure to tag them here as well, to keep the conversation linked together.

Other Information

If there's anything else that's important and relevant to your pull request, mention that information here. This could include benchmarks, or other information.

Thanks for contributing to Roo!

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.01%) to 93.836% when pulling 00356c2e4534607f838e6a0c72a6feb8fd689280 on chopraanmol1:inherit_coordinate_from_array into bfcfba42d13be2029a52b9d27010c5b7b95cf59c on roo-rb:master.

tgturner commented 6 years ago

This looks good! Might be worth adding some basic test coverage for the Coordinate class and for extract_coordinates

chopraanmol1 commented 6 years ago

@tgturner as per your suggestion I've added test coverage for extract_coordinate and Coordinate class