| Age | Commit message (Collapse) | Author |
|
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
```
|
|
Fix Inefficient Hash Search offenses
|
|
SimpleTypedList subclass of Array
|
|
Fix minimum supported Ruby version in Readme
|
|
Ref: #214
[ci skip]
|
|
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.
|
|
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
```
|
|
Use `key?` instead of `keys.include?` to improve performance
|
|
Validation improvements
|
|
reduce memory consumption
|
|
Pipe directly to output
|
|
|
|
```
%> 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.
|
|
|
|
Zip::OutputStream
The BufferedZipOutputStream is a drop-in replacement for Zip::OutputStream similar
to ZipCommand.
|
|
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.
|
|
Added zip_command variant to benchmark.rb and added profile_memory.rb based on
the `memory_profiler` gem.
|
|
Frozen strings
|
|
Co-authored-by: Geremia Taglialatela <[email protected]>
|
|
|
|
Fix Layout/HeredocIndentation offenses
|
|
|
|
|
|
Also use `XML` as delimiter to highlight syntax in supported editors
|
|
Introduce RuboCop performance
|
|
tagliala/chore/fix-minor-safe-offenses-to-production-code
Fix safe, minor offenses to production code
|
|
|
|
Also fixes performance offences in non-production code
|
|
- Lint/RedundantStringCoercion
- Style/CommentAnnotation offenses
- Style/DefWithParentheses
- Style/EvalWithLocation
- Style/MethodCallWithoutArgsParentheses
- Style/MethodDefParentheses
- Style/NilComparison
- Style/Semicolon
|
|
Fix offenses to non-production code
|
|
|
|
Show links to style guide and RuboCop documentation
|
|
|
|
|
|
|
|
|
|
|
|
Remove some old code related to Ruby 1.x
|
|
|
|
- Style/MethodCallWithoutArgsParentheses
- Style/StringLiteralsInInterpolation
|
|
|
|
- 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)
|
|
Reintroduce Ruby 2.6 compatibility
|
|
The main reason is to allow JRuby 9.3, which is still supported.
|
|
|
|
Test against Ruby head
|
|
|
|
|
|
|
|
|