summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2023-05-16Replace `sub` with `delete_prefix`/`delete_suffix`Geremia Taglialatela
Ruby 2.5 introduced `delete_prefix` and `delete_suffix`. Those methods are helpful when serializing formula and array formula values, that are supposed to start and end with given prefixes Also moves formula prefix to constants so they can be used by both `Cell` and `CellSerializer` classes Formula: ``` Ruby version: 3.2.2 Comparison: delete_prefix: 8759353.5 i/s sub: 2607022.4 i/s - 3.36x (± 0.00) slower Comparison: delete_prefix: 40 allocated sub: 160 allocated - 4.00x more ``` Array Formula: ``` Ruby version: 3.2.2 Comparison: delete_prefixes: 4798837.8 i/s sub_sub: 937072.1 i/s - 5.12x (± 0.00) slower Comparison: delete_prefixes: 120 allocated sub_sub: 488 allocated - 4.07x more ```
2023-05-15Merge pull request #224 from tagliala/chore/fix-inefficient-hash-searchZsolt Kozaroczy
Fix Inefficient Hash Search offenses
2023-05-15Merge pull request #223 from pkmiec/simpleTypedListAsArrayZsolt Kozaroczy
SimpleTypedList subclass of Array
2023-05-15Merge pull request #226 from tagliala/chore/fix-typo-in-readmeZsolt Kozaroczy
Fix minimum supported Ruby version in Readme
2023-05-13Fix minimum supported Ruby version in ReadmeGeremia Taglialatela
Ref: #214 [ci skip]
2023-05-10Fix `SimpleTypedList#to_a` and `SimpleTypedList#to_ary` returning the ↵Paul Kmiec
internal list instance The `to_a` and `to_ary` now work more like standard Array methods with `to_a` returning a new array containing the elements of self and `to_ary` returning self.
2023-05-10Derive SimpleTypedList from ArrayPaul Kmiec
Currently the SimpleTypedList is wrapping `@list` Array and re-implementing certain methods to add type / value checking and delegating all the non-destrutive methods to the internal @list. Most everything that ends up being serialized to the excel file is derived from SimpleTypedList (for example, a Row is a SimpleTypedList of Cells). This means that many of the delegated methods are hit over and over again especially `[]`. This extra delegation really adds up. We can avoid the delegation by having SimpleTypedList extend Array and still remove any un-safe methods. It is possible to re-introduce an unsafe method in a subclass of SimpleTypedList if needed. Here is one way, ```ruby class MyList < SimpleTypedList def clear @clear_method ||= Array.instance_method(:clear).bind(self) @clear_method.call end end ```
2023-05-10Fix Inefficient Hash Search offensesGeremia Taglialatela
Use `key?` instead of `keys.include?` to improve performance
2023-05-10Merge pull request #217 from kiskoza/validation-improvementsZsolt Kozaroczy
Validation improvements
2023-05-10Move definition of valid values and validator lambdas out of the methods to ↵Koza
reduce memory consumption
2023-05-10Merge pull request #220 from pkmiec/pipeDirectlyToOutputZsolt Kozaroczy
Pipe directly to output
2023-05-09Do not change the whitespace that is produced by to_xml_string'sPaul Kmiec
2023-05-07Regenerated rubocop todosPaul Kmiec
``` %> rubocop --auto-gen-config --no-auto-gen-timestamp --no-offense-counts ``` May need to rebase / resolve conlicts when https://github.com/caxlsx/caxlsx/pull/222 is merged.
2023-05-05Write directly to file io instead of buffering the output in memoryPaul Kmiec
2023-05-05Introduce BufferedZipOutputStream to avoid lots of small writes to ↵Paul Kmiec
Zip::OutputStream The BufferedZipOutputStream is a drop-in replacement for Zip::OutputStream similar to ZipCommand.
2023-05-05Pipe output directly to str and avoid additional memory allocationsPaul Kmiec
Currently, there are lots of examples of code like this, ``` str << ('<tag ' << foo << ' ' << bar << '/>') ``` which create the string for the tag in memory before piping to str. We can avoid creating all of these intermediate strings by dropping the paranthesis and piping directly to str. This relies on the `str` passed around to handle lots of small appends. This is a problem when using RubyZip, but that is solved in the next commit.
2023-05-05Improve benchmarking / profilingPaul Kmiec
Added zip_command variant to benchmark.rb and added profile_memory.rb based on the `memory_profiler` gem.
2023-05-05Merge pull request #219 from pkmiec/frozenStringsZsolt Kozaroczy
Frozen strings
2023-05-05Revert changelogZsolt Kozaroczy
Co-authored-by: Geremia Taglialatela <[email protected]>
2023-05-05Merge branch 'master' into frozenStringsZsolt Kozaroczy
2023-05-05Merge pull request #218 from tagliala/chore/rubocop-production-stage-iiZsolt Kozaroczy
Fix Layout/HeredocIndentation offenses
2023-05-04Fix tests / code to work with frozen string literalsPaul Kmiec
2023-05-04Enable Style/FrozenStringLiteralComment and autocorrectPaul Kmiec
2023-05-04Fix Layout/HeredocIndentation offensesGeremia Taglialatela
Also use `XML` as delimiter to highlight syntax in supported editors
2023-05-04Merge pull request #216 from tagliala/chore/introduce-rubocop-performanceZsolt Kozaroczy
Introduce RuboCop performance
2023-05-04Merge pull request #215 from ↵Zsolt Kozaroczy
tagliala/chore/fix-minor-safe-offenses-to-production-code Fix safe, minor offenses to production code
2023-05-03Fix unescaped dot in regexp and convert to includeGeremia Taglialatela
2023-05-03Introduce RuboCop performanceGeremia Taglialatela
Also fixes performance offences in non-production code
2023-05-03Fix safe, minor offenses to production codeGeremia Taglialatela
- Lint/RedundantStringCoercion - Style/CommentAnnotation offenses - Style/DefWithParentheses - Style/EvalWithLocation - Style/MethodCallWithoutArgsParentheses - Style/MethodDefParentheses - Style/NilComparison - Style/Semicolon
2023-05-03Merge pull request #204 from tagliala/chore/add-rubocop-stage-ii-testsNoel Peden
Fix offenses to non-production code
2023-05-03Fix Style/MapToHash offense (unsafe)Geremia Taglialatela
2023-05-03Improve RuboCop configGeremia Taglialatela
Show links to style guide and RuboCop documentation
2023-05-03Lock RuboCop versionsGeremia Taglialatela
2023-05-03Fix non-production Style/NumericLiterals offensesGeremia Taglialatela
2023-05-03Remove redundant load pathsGeremia Taglialatela
2023-05-03Fix Style/RedundantFileExtensionInRequire offenseGeremia Taglialatela
2023-05-03Fix tests not using valuesGeremia Taglialatela
2023-05-03Fix time testsGeremia Taglialatela
Remove some old code related to Ruby 1.x
2023-05-03Fix boolean testGeremia Taglialatela
2023-05-03Fix other non-production offensesGeremia Taglialatela
- Style/MethodCallWithoutArgsParentheses - Style/StringLiteralsInInterpolation
2023-05-03Add RuboCop MinitestGeremia Taglialatela
2023-05-03Fix offenses to non-production codeGeremia Taglialatela
- Lint/AmbiguousBlockAssociation - Lint/AmbiguousOperatorPrecedence - Lint/EmptyBlock - Lint/RedundantSplatExpansion - Lint/RedundantStringCoercion - Lint/SymbolConversion - Lint/UnusedBlockArgument - Style/BlockDelimiters - Style/CommentAnnotation - Style/EachForSimpleLoop - Style/EmptyMethod - Style/ExpandPathArguments - Style/FileWrite - Style/GlobalStdStream (UNSAFE) - Style/HashEachMethods (UNSAFE) - Style/NestedParenthesizedCalls - Style/NilComparison - Style/NumericLiteralPrefix (manually fixed) - Style/ParallelAssignment - Style/PreferredHashMethods (UNSAFE) - Style/RedundantInterpolation (UNSAFE) - Style/RedundantParentheses (UNSAFE) - Style/RegexpLiteral - Style/RescueStandardError - Style/SpecialGlobalVars (UNSAFE) - Style/SymbolProc (UNSAFE) - Style/ZeroLengthPredicate (UNSAFE)
2023-05-03Merge pull request #214 from tagliala/chore/reintroduce-ruby26-compatibilityNoel Peden
Reintroduce Ruby 2.6 compatibility
2023-05-03Reintroduce Ruby 2.6 compatibilityGeremia Taglialatela
The main reason is to allow JRuby 9.3, which is still supported.
2023-04-27Drop support for Ruby < 2.7Stefan
2023-04-27Merge pull request #211 from tagliala/chore/anticipate-failuresNoel Peden
Test against Ruby head
2023-04-27Test against Ruby headGeremia Taglialatela
2023-04-23Update version.rb [skip ci]Noel Peden
2023-04-23Add test to ensure various OWASP prefixes are never parsed as formulaStefan
2023-04-23CHANGELOGjohnnyshields