-
Notifications
You must be signed in to change notification settings - Fork 404
Performance fixes #5245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Performance fixes #5245
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
a2006ec
much simpler, faster profiler, no analysis, just collection
cscheid 6b3cdc3
new profiler:
cscheid 6d17499
convert to tracing json in lua
cscheid 4becc26
keep track of active filter in category
cscheid 21500fc
revive old coarse, joint ts+lua profiler
cscheid 1108875
remove print
cscheid e5ee48c
garbage
cscheid b3a268e
Merge branch 'main' into feature/fast-profiler
cscheid 7ffa1a1
using the interrupt-based lua profiler
cscheid 9de2080
Merge branch 'main' into feature/fast-profiler
cscheid d25df0e
profile using more accurate line information
cscheid c5a298c
add tool to convert to perfetto's json format
cscheid ec75e32
Merge branch 'main' into feature/fast-profiler
cscheid d94b676
properly nested filter category, trim useless frames
cscheid 619e45d
performance: skip empty filters, don't walk pure-pandoc filters
cscheid 74cec4a
performance: don't call walk on meta-only filter
cscheid 8342fcf
only merge when necessary
cscheid e872370
Merge branch 'main' into feature/fast-profiler
cscheid fe9891c
partial work towards shortcode parsing at frontend
cscheid 431cd05
breakquartomd mystery solved
cscheid 9d9f465
partial work towards parsing shortcodes: blocks and inlines
cscheid 2184911
shortcodes: code (block/inline/raw), images/links
cscheid 9428b2d
undo bad combineFilters, add more fixes for shortcode params
cscheid 5d6c2fa
temporarily switch to raw-text in shortcodes
cscheid 7b85eb4
partial work on shortcodes
cscheid de07929
unshortcode fixes
cscheid 08c01ec
continue unshortcodeing after bracket
cscheid 69866eb
be more robust if shortcode is not found
cscheid d1f63c9
hack around pipeline with shortcode ids
cscheid be3e8dc
revert bad perf change
cscheid fb9c2b3
make execution conditional
cscheid 40bdea4
use quarto.ast.walk
cscheid 7d9e114
don't run if code-annotation: false
cscheid b1ee9c2
Merge branch 'main' into feature/fast-profiler
cscheid 3494b60
compute index to prevent calling unnecessary filters
cscheid ea316ec
missing file
cscheid 6d38c61
missing file
cscheid 952c776
rm print
cscheid 4f733fa
represent index checks explicitly
cscheid 08f7b63
dont import unused file
cscheid aa8d262
indices: crossref preprocess
cscheid 089bd9a
crossref initialization outside of preprocess for skipping well
cscheid d162e74
preprocess: theorems
cscheid 88429e0
cites and layout
cscheid 06e0c3a
move crossref init earlier, fix cites
cscheid ea4525c
bad conditional
cscheid a7f2ef3
panels and extended figures
cscheid a197eb9
fix conditional
cscheid 93d2d20
Merge branch 'main' into feature/fast-profiler
cscheid 78fc949
typo
cscheid 72645a7
Merge branch 'main' into feature/fast-profiler
cscheid 21473d0
fix typos, update indices on figure change
cscheid 8069483
table-captions fix
cscheid c3bb2d2
grab file information from right location
cscheid ff27ba9
more fixes. tests pass.
cscheid 0e476b6
Merge branch 'main' into feature/fast-profiler
cscheid 29bea9e
memoize kernelspecs
cscheid e5cb322
don't repeatedly reconstruct parse
cscheid 042fc66
perf: cache translations file
cscheid ff10c10
cache project index results
cscheid e63c89a
perf metrics
cscheid 23ecb1c
clone options optionally
cscheid 5883b67
Merge branch 'main' into feature/fast-profiler
cscheid 2727de7
QUARTO_TS_PROFILE
cscheid 763fa8e
indices -> flags
cscheid 3920b67
indices -> flags
cscheid 57295e3
indices -> flags
cscheid ee087e4
smoke test
cscheid ed9f9a8
remove comments, move lpeg calculation back inside filter
cscheid 4ba2261
actually use flags
cscheid 528dade
Merge branch 'main' into feature/fast-profiler
cscheid d65dc6b
merge
cscheid dd593bf
refactor: use names that respect lua's naming convention
cscheid b7fe690
chore: naming convention
cscheid 89177fd
chore: naming conventions
cscheid 5e951c6
chore: lua naming conventions
cscheid 26fef77
chore: lua naming conventions
cscheid 48e5a55
chore: lua naming conventions
cscheid 8727eed
chore: lua naming conventions
cscheid 4299f6e
Merge branch 'main' into feature/fast-profiler
cscheid d7bd93a
chore: lua naming conventions
cscheid 6acc63d
trim spaces at the end of raw parameters
cscheid 53ce143
use is_format consistently
cscheid 05359c6
chore: lua naming conventions
cscheid ecc81cf
Merge branch 'main' into feature/fast-profiler
cscheid 89022af
Fix bundling issue
dragonstyle 5a91371
chore: lua naming conventions
cscheid b097010
remove unneeded files
cscheid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * cache.ts | ||
| * | ||
| * provides a simple cache for expensive operations | ||
| * | ||
| * Copyright (C) 2023 Posit Software, PBC | ||
| */ | ||
|
|
||
| export function cache<T>(f: () => Promise<T>): () => Promise<T> { | ||
| let value: T | undefined = undefined; | ||
| return async () => { | ||
| if (value === undefined) { | ||
| value = await f(); | ||
| } | ||
| return value; | ||
| }; | ||
| } | ||
|
|
||
| export function cacheMap<K, V>( | ||
| f: (key: K) => Promise<V>, | ||
| ): (key: K) => Promise<V> { | ||
| const map = new Map<K, V>(); | ||
| return async (key: K) => { | ||
| if (!map.has(key)) { | ||
| map.set(key, await f(key)); | ||
| } | ||
| return map.get(key)!; | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /* | ||
| * metrics.ts | ||
| * | ||
| * Copyright (C) 2020-2023 Posit Software, PBC | ||
| */ | ||
|
|
||
| import { inputTargetIndexCacheMetrics } from "../../project/project-index.ts"; | ||
|
|
||
| export function quartoPerformanceMetrics() { | ||
| return { | ||
| inputTargetIndexCache: inputTargetIndexCacheMetrics, | ||
| }; | ||
| } | ||
|
|
||
| export function reportPeformanceMetrics() { | ||
| console.log("---"); | ||
| console.log("Performance metrics"); | ||
| console.log("Quarto:"); | ||
| console.log(JSON.stringify(quartoPerformanceMetrics(), null, 2)); | ||
| console.log(); | ||
| // denoMetrics is some kind of fancy object that doesn't respond | ||
| // to a bunch of the normal methods. So we have to do this | ||
| // the JSON-round-trip way. | ||
| console.log("Deno:"); | ||
| const denoMetrics = JSON.parse(JSON.stringify(Deno.metrics() as any)); | ||
| denoMetrics.ops = Object.fromEntries( | ||
| Object.entries(denoMetrics.ops).map( | ||
| ([key, opMetrics]: any) => { | ||
| for (const key of Object.keys(opMetrics)) { | ||
| if (opMetrics[key] === 0) { | ||
| delete opMetrics[key]; | ||
| } | ||
| } | ||
| return [key, opMetrics]; | ||
| }, | ||
| ).filter(([_key, opMetrics]: any) => Object.keys(opMetrics).length > 0) | ||
| .map(([key, opMetrics]: any) => { | ||
| if ( | ||
| (opMetrics.opsDispatched === opMetrics.opsDispatchedSync && | ||
| opMetrics.opsDispatched === opMetrics.opsCompleted && | ||
| opMetrics.opsDispatched === opMetrics.opsCompletedSync) || | ||
| (opMetrics.opsDispatched === opMetrics.opsDispatchedAsync && | ||
| opMetrics.opsDispatched === opMetrics.opsCompleted && | ||
| opMetrics.opsDispatched === opMetrics.opsCompletedAsync) | ||
| ) { | ||
| return [key, opMetrics.opsDispatched]; | ||
| } else { | ||
| return [key, opMetrics]; | ||
| } | ||
| }), | ||
| ); | ||
| console.log(JSON.stringify(denoMetrics, null, 2)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.