Add parser benchmarks (#953)

The current benchmark is not too useful now that we have a linear parser.

This changes the benchmarks to parse the standard library, and also the language snippet tests.

Co-authored-by: Islon Scherer <islonscherer@gmail.com>
This commit is contained in:
Daniel Chao
2025-02-13 11:22:31 -08:00
committed by GitHub
parent d00d0ba79f
commit 65cf3237b7
4 changed files with 53 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,12 +23,13 @@ import org.opentest4j.AssertionFailedError
import org.pkl.commons.*
object FileTestUtils {
@JvmStatic
val rootProjectDir: Path by lazy {
val workingDir = currentWorkingDir
workingDir.takeIf { it.resolve("settings.gradle.kts").exists() }
?: workingDir.parent.takeIf { it.resolve("settings.gradle.kts").exists() }
?: workingDir.parent.parent.takeIf { it.resolve("settings.gradle.kts").exists() }
?: throw AssertionError("Failed to locate root project directory.")
?: workingDir.parent.parent.takeIf { it.resolve("settings.gradle.kts").exists() }
?: throw AssertionError("Failed to locate root project directory.")
}
val selfSignedCertificate: Path by lazy {
rootProjectDir.resolve("pkl-commons-test/build/keystore/localhost.pem")