Skip to content

Commit

Permalink
Omit the built-in-environment on env-fingerprinting (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce authored May 10, 2024
2 parents bb42c9e + bc31c06 commit 71db260
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/slicing/static/fingerprint.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { REnvironmentInformation } from '../../dataflow'
import { BuiltInEnvironment } from '../../dataflow'
import objectHash from 'object-hash'
import type { NodeId } from '../../r-bridge'

export type Fingerprint = string

export function envFingerprint(env: REnvironmentInformation): Fingerprint {
return objectHash(env, { excludeKeys: key => key === 'id' })
return objectHash(env, { excludeKeys: key => key === 'id', replacer: (v: unknown) => v === BuiltInEnvironment ? undefined : v })
}

export function fingerprint(id: NodeId, envFingerprint: Fingerprint, onlyForSideEffects: boolean): Fingerprint {
Expand Down

2 comments on commit 71db260

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"artificial" Benchmark Suite

Benchmark suite Current: 71db260 Previous: 1e5ddeb Ratio
Retrieve AST from R code 297.304014 ms 305.50355490909095 ms 0.97
Normalize R AST 33.47667504545455 ms 33.04192136363636 ms 1.01
Produce dataflow information 66.19409236363637 ms 66.58585145454545 ms 0.99
Total per-file 1506.4491765454545 ms 1512.547620909091 ms 1.00
Static slicing 1.3749867935321118 ms (1.2179717397051921) 1.3817132831241319 ms (1.27303105869458) 1.00
Reconstruct code 0.45495556963375827 ms (0.25281509006600167) 0.45135141022522257 ms (0.25927254974160097) 1.01
Total per-slice 1.8449611411688114 ms (1.2811960938190177) 1.8475447304133532 ms (1.3326721674469058) 1.00
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.7329390759026897 # 0.7329390759026897 # 1
reduction (normalized tokens) 0.7209834969577295 # 0.7209834969577295 # 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"social-science" Benchmark Suite

Benchmark suite Current: 71db260 Previous: 1e5ddeb Ratio
Retrieve AST from R code 300.37121526 ms 330.55613118 ms 0.91
Normalize R AST 34.47735746 ms 36.10837608 ms 0.95
Produce dataflow information 178.49361932 ms 188.6117503 ms 0.95
Total per-file 3558.43687142 ms 3858.78617088 ms 0.92
Static slicing 8.265237728810664 ms (14.315002301386608) 8.763488287471356 ms (15.142795018273485) 0.94
Reconstruct code 0.44735237657244165 ms (0.23790071927645645) 0.6295735167403027 ms (0.28826473087031307) 0.71
Total per-slice 8.721310593554442 ms (14.434152308222266) 9.403718790030862 ms (15.25727767695505) 0.93
failed to reconstruct/re-parse 7 # 7 # 1
times hit threshold 298 # 298 # 1
reduction (characters) 0.8935817303062389 # 0.8935817303062389 # 1
reduction (normalized tokens) 0.8531248144961375 # 0.8531248144961375 # 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.