quarto-dev / quarto-dev/quarto-cli

latex pattern for raw table treatment is checked twice in Lua : perf improvement ?

Open
#11,915 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

crossref enhancement lua maintenance performance tables
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

I just noticed this while reading code.

For raw LaTeX Table, we do process table patterns, only when found

https://github.com/quarto-dev/quarto-cli/blob/b42543e510ad01125d87be07eee380fd177dda68/src/resources/filters/quarto-pre/table-captions.lua#L171-L181

though we also do the exact same inside the function call
https://github.com/quarto-dev/quarto-cli/blob/b42543e510ad01125d87be07eee380fd177dda68/src/resources/filters/quarto-pre/table-captions.lua#L202-L221

As those string matching were already a problem related to perf (#9733), maybe this is worth simplifying here to avoid the duplicate treatment

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect src/resources/filters/quarto-pre/table-captions.lua at the cited ranges around lines 171-181 and 202-221. Compare the raw LaTeX table pattern checks and confirm that the duplicate matching can be removed while preserving the existing treatment.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
performance
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.