Skip to content

Commit

Permalink
[release:patch] Support More Side-Effects
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce committed Sep 13, 2024
1 parent 5dbde2f commit 44c526b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dataflow/environments/built-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ registerBuiltInFunctions(false, ['apply', 'tapply', 'Tapply'],
registerBuiltInFunctions(false, ['print'], defaultBuiltInProcessor, { returnsNthArgument: 0, forceArgs: 'all' as const } )
registerBuiltInFunctions(true, ['('], defaultBuiltInProcessor, { returnsNthArgument: 0 } )
registerBuiltInFunctions(false, ['load', 'load_all', 'setwd', 'set.seed'], defaultBuiltInProcessor, { hasUnknownSideEffects: true, forceArgs: [true] } )
registerBuiltInFunctions(false, ['eval', 'body', 'formals', 'environment'], defaultBuiltInProcessor, { hasUnknownSideEffects: true, forceArgs: [true] } )
registerBuiltInFunctions(false, ['cat'], defaultBuiltInProcessor, { forceArgs: 'all' as const } ) /* returns null */
registerBuiltInFunctions(false, ['switch'], defaultBuiltInProcessor, {} ) /* returns null */
registerBuiltInFunctions(true, ['return'], defaultBuiltInProcessor, { returnsNthArgument: 0, cfg: ExitPointType.Return } )
Expand Down Expand Up @@ -220,4 +221,4 @@ registerBuiltInFunctions(false, ['library.dynam', 'install.packages','install',
registerBuiltInFunctions(false, ['attach', 'detach', 'unname', 'rm', 'remove'], defaultBuiltInProcessor, { hasUnknownSideEffects: true } )

/* they are all mapped to `<-` but we separate super assignments */
registerReplacementFunctions({ makeMaybe: true }, ['<-', '<<-'], '[', '[[', '$', '@', 'names', 'dimnames', 'attributes', 'attr', 'class', 'levels', 'rownames', 'colnames')
registerReplacementFunctions({ makeMaybe: true }, ['<-', '<<-'], '[', '[[', '$', '@', 'names', 'dimnames', 'attributes', 'attr', 'class', 'levels', 'rownames', 'colnames', 'body', 'environment', 'formals')

2 comments on commit 44c526b

@EagleoutIce
Copy link
Member Author

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: 44c526b Previous: 69a5fc8 Ratio
Retrieve AST from R code 239.42213677272727 ms (103.82313121172619) 254.0663056818182 ms (111.00956124859476) 0.94
Normalize R AST 20.457404363636364 ms (36.77082082099273) 21.304006772727273 ms (37.381897968932314) 0.96
Produce dataflow information 38.21900681818182 ms (81.34971002482807) 40.67071668181818 ms (86.45291664681547) 0.94
Total per-file 816.8130319090909 ms (1460.0152060402618) 872.2856076363636 ms (1588.4594968913652) 0.94
Static slicing 2.2454117276977246 ms (1.3672814394953574) 2.2540939123938912 ms (1.2408759344118971) 1.00
Reconstruct code 0.22823695438019298 ms (0.180587515271109) 0.24820597687991225 ms (0.20259172674837386) 0.92
Total per-slice 2.4904620761066987 ms (1.4311425544325718) 2.5200681050838227 ms (1.3153274268350599) 0.99
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.7869360165281424 # 0.7869360165281424 # 1
reduction (normalized tokens) 0.7639690077689504 # 0.7639690077689504 # 1
memory (df-graph) 147.42458274147728 KiB (358.6827375397903) 147.42458274147728 KiB (358.6827375397903) 1

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

@EagleoutIce
Copy link
Member Author

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: 44c526b Previous: 69a5fc8 Ratio
Retrieve AST from R code 241.19898486000002 ms (44.93266335552592) 241.419398 ms (45.10415936849987) 1.00
Normalize R AST 22.15083762 ms (17.078596378622905) 22.21252828 ms (16.743829774339492) 1.00
Produce dataflow information 74.87567007999999 ms (88.09994848451149) 76.47963048 ms (92.86765617245509) 0.98
Total per-file 11369.75587748 ms (54073.12372176306) 11128.12225152 ms (53314.44953778299) 1.02
Static slicing 22.549699250990475 ms (80.89690479433877) 21.721580926884755 ms (79.88249488357124) 1.04
Reconstruct code 0.23785571716825718 ms (0.14842108337668944) 0.23449054097499383 ms (0.14561179514636924) 1.01
Total per-slice 22.79558156247473 ms (80.92056204842162) 21.963907934107166 ms (79.90597541173697) 1.04
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.8702425339407753 # 0.8862013459637729 # 0.98
reduction (normalized tokens) 0.8080197262683358 # 0.8339515062511054 # 0.97
memory (df-graph) 145.541875 KiB (153.47859961917467) 145.7402734375 KiB (153.4526987962704) 1.00

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

Please sign in to comment.