generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed slow load of flashcard modal (bug introduced in 1.12.0) (#926)
* Possibly fixed, for beta testing * Added logging of detailed timing debug * Problem fixed, still needs tidy up * Removed detailed timing logging * Removed detailed timing logging * lint, format and update change log * Removed unused code caught by test coverage checks
- Loading branch information
Showing
8 changed files
with
71 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
docs/changelog.md | ||
docs/changelog.md |
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
docs/en/contributing.md | ||
docs/en/contributing.md |
This file contains 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 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 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 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,31 @@ | ||
import moment from "moment"; | ||
|
||
// These functions were used to diagnose performance issue | ||
// https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/914 | ||
|
||
let testTimeInfo: [string, number][]; | ||
|
||
export function testTimeStart(): void { | ||
testTimeInfo = [["Start", moment().valueOf()]]; | ||
} | ||
|
||
export function testTimeLog(desc: string): void { | ||
if (testTimeInfo == null) testTimeStart(); | ||
testTimeInfo.push([desc, moment().valueOf()]); | ||
} | ||
|
||
export function testTimeGetLapTime(): number { | ||
return moment().valueOf() - testTimeInfo[0][1]; | ||
} | ||
|
||
export function testTimeFormatLapInfo(): string { | ||
let prevTime: number = testTimeInfo[0][1]; | ||
let result: string = ""; | ||
for (let i = 1; i < testTimeInfo.length; i++) { | ||
const thisTime: number = testTimeInfo[i][1]; | ||
result += `\t${testTimeInfo[i][0]}\t${thisTime - prevTime}`; | ||
prevTime = thisTime; | ||
} | ||
result += `\tLapTime\t${testTimeGetLapTime()}|`; | ||
return result; | ||
} |
This file contains 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 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