bytesparadise / libasciidoc

A Golang library for processing Asciidoc files.
Apache License 2.0
205 stars 25 forks source link

refactor(parser): simplify QuotedText rules #1079

Closed xcoulon closed 2 years ago

xcoulon commented 2 years ago

track last element in a group to compare with its latest character when needed (ie, to check if a rule can apply or not)

also:

Fixes #1077

Signed-off-by: Xavier Coulon xcoulon@redhat.com

codecov[bot] commented 2 years ago

Codecov Report

Merging #1079 (4529e15) into master (04acb03) will decrease coverage by 0.00%. The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master    #1079      +/-   ##
==========================================
- Coverage   80.93%   80.93%   -0.01%     
==========================================
  Files          90       90              
  Lines        7585     7569      -16     
==========================================
- Hits         6139     6126      -13     
+ Misses        949      947       -2     
+ Partials      497      496       -1     
github-actions[bot] commented 2 years ago

Comparing with master branch:

name                                          old time/op    new time/op    delta
RealDocumentProcessing/demo.adoc-2              38.4ms ± 1%    38.5ms ± 2%    ~     (p=0.673 n=9+8)
RealDocumentProcessing/vertx-examples.adoc-2    95.4ms ± 0%    96.1ms ± 1%  +0.75%  (p=0.000 n=9+10)
RealDocumentProcessing/mocking.adoc-2            104ms ± 0%     104ms ± 1%    ~     (p=0.278 n=9+10)

name                                          old alloc/op   new alloc/op   delta
RealDocumentProcessing/demo.adoc-2              12.8MB ± 0%    12.8MB ± 0%    ~     (p=0.606 n=9+8)
RealDocumentProcessing/vertx-examples.adoc-2    30.9MB ± 0%    30.9MB ± 0%    ~     (p=0.211 n=9+10)
RealDocumentProcessing/mocking.adoc-2           28.7MB ± 0%    28.7MB ± 0%    ~     (p=0.356 n=9+10)

name                                          old allocs/op  new allocs/op  delta
RealDocumentProcessing/demo.adoc-2                175k ± 0%      175k ± 0%    ~     (p=0.870 n=9+8)
RealDocumentProcessing/vertx-examples.adoc-2      456k ± 0%      456k ± 0%    ~     (p=0.284 n=9+10)
RealDocumentProcessing/mocking.adoc-2             486k ± 0%      486k ± 0%    ~     (p=0.149 n=9+10)

Comparing with latest release:

name                                          old time/op    new time/op    delta
RealDocumentProcessing/demo.adoc-2              16.9ms ± 2%    38.5ms ± 2%  +127.25%  (p=0.000 n=9+8)
RealDocumentProcessing/vertx-examples.adoc-2    48.4ms ± 2%    96.1ms ± 1%   +98.56%  (p=0.000 n=10+10)
RealDocumentProcessing/mocking.adoc-2           47.9ms ± 2%   104.2ms ± 1%  +117.41%  (p=0.000 n=10+10)

name                                          old alloc/op   new alloc/op   delta
RealDocumentProcessing/demo.adoc-2              8.85MB ± 0%   12.83MB ± 0%   +44.97%  (p=0.000 n=10+8)
RealDocumentProcessing/vertx-examples.adoc-2    24.0MB ± 0%    30.9MB ± 0%   +28.65%  (p=0.000 n=8+10)
RealDocumentProcessing/mocking.adoc-2           21.6MB ± 0%    28.7MB ± 0%   +32.67%  (p=0.000 n=9+10)

name                                          old allocs/op  new allocs/op  delta
RealDocumentProcessing/demo.adoc-2                106k ± 0%      175k ± 0%   +64.84%  (p=0.000 n=10+8)
RealDocumentProcessing/vertx-examples.adoc-2      305k ± 0%      456k ± 0%   +49.53%  (p=0.000 n=10+10)
RealDocumentProcessing/mocking.adoc-2             326k ± 0%      486k ± 0%   +48.83%  (p=0.000 n=10+10)