-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(cargo): Try some config flags for perf (#4)
Co-authored-by: Goulven Clec'h <[email protected]>
- Loading branch information
1 parent
aa36d93
commit 1c44ac8
Showing
12 changed files
with
846 additions
and
163 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
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,3 +1,12 @@ | ||
[workspace] | ||
members = ["crates/*"] | ||
resolver = "2" | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
lto = "fat" | ||
codegen-units = 1 | ||
|
||
[profile.benchmark] | ||
inherits = "release" | ||
debug = true |
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,47 @@ | ||
import { get_hover } from "../../csslsrs/dist/generated/csslsrs"; | ||
import { getCSSLanguageService } from "vscode-css-languageservice"; | ||
import { TextDocument } from "vscode-languageserver-textdocument"; | ||
import cssCustomData from "../../../crates/csslsrs/data/css-schema.json"; | ||
import { bench, describe } from "vitest"; | ||
|
||
describe("Hover", async () => { | ||
const vscodeLanguageService = getCSSLanguageService(); | ||
const content = ` | ||
body { | ||
background-color: #fff; | ||
} | ||
a { | ||
color: red; | ||
} | ||
h1.foo { | ||
color: rgba(0, 0, 0, 0.5); | ||
} | ||
h1 > span { | ||
color: linear-gradient(to right, red, #fff); | ||
} | ||
`; | ||
|
||
const textDocument = TextDocument.create( | ||
"file:///test.css", | ||
"css", | ||
0, | ||
content | ||
); | ||
|
||
bench("CSSLSRS(WASM) - Hover", async () => { | ||
await get_hover(textDocument, { line: 4, character: 3 }, cssCustomData); | ||
}); | ||
if (!process.env.CODSPEED) { | ||
bench("vscode-css-languageservice - Hover", () => { | ||
const stylesheet = vscodeLanguageService.parseStylesheet(textDocument); | ||
vscodeLanguageService.doHover( | ||
textDocument, | ||
{ line: 4, character: 3 }, | ||
stylesheet | ||
); | ||
}); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
import codspeedPlugin from "@codspeed/vitest-plugin"; | ||
import { defineConfig } from "vitest/config"; | ||
|
||
const plugins = process.env.CODSPEED ? [codspeedPlugin()] : []; | ||
|
||
export default defineConfig({ | ||
plugins, | ||
}); |
Oops, something went wrong.