Skip to content

ui: Migrating to Flechette for arrow record parsing#6176

Merged
manojVivek merged 11 commits into
mainfrom
flechette-1
Jan 29, 2026
Merged

ui: Migrating to Flechette for arrow record parsing#6176
manojVivek merged 11 commits into
mainfrom
flechette-1

Conversation

@manojVivek
Copy link
Copy Markdown
Contributor

@manojVivek manojVivek commented Jan 27, 2026

Changes in this PR should bring in significant(>2x) improvements in reading the arrow record data, but brings in a slight degraded(~0.7x) table parsing speed.

This degradation is caused by these array copies that are needed to align the bytes to support the bigints in the data.

Making a fix to improve that parsing performance in #6177 with speeds up the parsing by 1.3x.

@manojVivek manojVivek requested a review from a team as a code owner January 27, 2026 09:30
@alwaysmeticulous
Copy link
Copy Markdown

alwaysmeticulous Bot commented Jan 27, 2026

✅ Meticulous spotted visual differences in 9 of 349 screens tested, but all differences have already been approved: view differences detected.

Meticulous evaluated ~5 hours of user flows against your PR.

Last updated for commit c6f6bac. This comment will update as new commits are pushed.

Copy link
Copy Markdown
Contributor

@yomete yomete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work!

const table: Table<any> = useMemo(() => {
const result = tableFromIPC(arrow.record);
const table: Table = useMemo(() => {
// Copy to aligned buffer only if byteOffset is not 8-byte aligned (required for BigUint64Array)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I can't remember the exact configuration, but this is something we can enforce (at least in rust) on the backend.

Also, I first mistook this for a buffer only carrying the uint64 array, which is always naturally 8-byte aligned since every entry is 8-bytes, but this is because the record as a whole may have arrays that are not necessarily 8 byte aligned. This probably deserves some extra detail in the comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind on the second part now that I read the second PR.

return [];
}

// Use Set to collect unique filenames (Flechette decodes dictionaries upfront)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's very unfortunate, it shouldn't matter in this case, since the backend should already return unique items, but maybe we should open an issue about this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raise an issue to not decode the dictionaries upfront?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, that we can directly access the underlying dictionary like we did before.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just found the underlying dictionary is already exposed, so changed this to use that one.

const maxDepth = useMemo(() => {
if (callersFlamegraphData?.arrow != null) {
const table = tableFromIPC(callersFlamegraphData.arrow.record);
// Copy to aligned buffer only if byteOffset is not 8-byte aligned (required for BigUint64Array)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this happens a couple times throughout the codebase now, maybe we can extract this into a util function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@manojVivek manojVivek enabled auto-merge (squash) January 29, 2026 06:40
@manojVivek manojVivek merged commit a9708ec into main Jan 29, 2026
38 checks passed
@manojVivek manojVivek deleted the flechette-1 branch January 29, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants