使用 67.2 MB 的 APK 檔案作為測試目標
程式均運行在 M1 MacBook Air 上,Node 和 Rust 編譯出來的成品均為 ARM64 Binary
let apple_jwks = match reqwest::get("https://appleid.apple.com/auth/keys").await {
Ok(response) => match response.text().await {
Ok(text) => text,
Err(_) => {
return Err(err_json_gen(
StatusCode::INTERNAL_SERVER_ERROR,
Some("Could not parse response from Apple.".to_owned()),
))
}
const fileExisted = await Result.safe(fsPromises.stat(targetDir));
if (fileExisted.isOk()) {
fs.rmSync(targetDir, { recursive: true });
}
const mkdir = await Result.safe(
fsPromises.mkdir(targetDir, { recursive: true }),
);
if (mkdir.isErr()) {
#[derive(Deserialize)]
pub struct SignInWithAppleJwtClaims {
sub: String,
email: String,
}
impl SignInWithAppleJwtClaims {
pub async fn validate_and_decode(jwt: String) -> Result<Self, (StatusCode, Json<Value>)> {
let Ok(response) = reqwest::get("https://appleid.apple.com/auth/keys").await else {
ezcon@ez500:~/ezmonitor$ hey -z 30s -c 100 http://localhost:1234/api/get
Summary:
Total: 30.1203 secs
Slowest: 0.2984 secs
Fastest: 0.0801 secs
Average: 0.1514 secs
Requests/sec: 659.1560
Summary:
Total: 30.0199 secs
Slowest: 0.0995 secs
Fastest: 0.0212 secs
Average: 0.0551 secs
Requests/sec: 1813.5947