-
Hey 👋 I'm relatively new to using I wrote a simple script to reproduce this: import { remark } from "remark";
import remarkGfm from "remark-gfm";
let input = "Column 1 | Column 2 | Column 3\n--- | --- | ---";
for (let rows = 1; rows <= 1000; rows++) {
input += "\nCell 1 | Cell 2 | Cell 3";
console.time(`Rows: ${rows}`);
remark().use(remarkGfm).processSync(input);
console.timeEnd(`Rows: ${rows}`);
} Is there something I can do to speed up the parsing or is this an issue with |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Welcome @ManuelDevelopment! A few things to note, your example doesn't just parse a thousand line table. It's also worth noting that long and complex content takes longer to parse than simple and short content, period. 🙂 In terms of what can be done to trim extra time.
That said, in my testing, in the sandbox (which has extra overhead over native node.js) both remark and micromark take under 30 seconds to process a table with 2000 rows. |
Beta Was this translation helpful? Give feedback.
-
Hey! GFM tables are tough to parse, they are different than other markdown constructs and require looking ahead further. |
Beta Was this translation helpful? Give feedback.
-
I'm coming from a duplicate (ish) bug where I'm trying to just parse text and no tables. I'm getting these results: micromark-extension-gfm-table@1.0.3
micromark-extension-gfm-table@1.0.4
So I'm assuming the regression happened in 1.0.4? |
Beta Was this translation helpful? Give feedback.
Hey! GFM tables are tough to parse, they are different than other markdown constructs and require looking ahead further.
That being said, there are likely things to improve where they are parsed: https://github.com/micromark/micromark-extension-gfm-table. Perhaps you can profile and help there?