Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial changes for compilation time tracking. #1111

Merged
merged 15 commits into from
Dec 9, 2024

Conversation

studiosutara
Copy link
Contributor

@studiosutara studiosutara commented Dec 3, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/1208613456171888/1208801514911205/f
iOS PR:
macOS PR:
What kind of version bump will this require?: Major/Minor/Patch

Optional:

Tech Design URL:
CC:

Description:

Steps to test this PR:
1.
1.

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@@ -388,6 +386,15 @@ public class ContentBlockerRulesManager: CompiledRuleListsSource {
unprotectedSitesHash: nil))
}

// todo - this hard code is a placeholder till I figure out how to check for this task vs. Ad attr task
if task.rulesList.name == "TrackerDataSet" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I saw an enum for this somewhere, but cannot recall. What is the best way to check for the correct task?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you have in mind DefaultContentBlockerRulesListsSource 's Constants

// todo - this hard code is a placeholder till I figure out how to check for this task vs. Ad attr task
if task.rulesList.name == "TrackerDataSet" {
if let perfInfo = result.performanceInfo {
self.errorReporting?.fire(.contentBlockingCompilationTaskPerformance(retryCount: perfInfo.iterationCount,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want to exclude lookups right?

@@ -65,10 +86,14 @@ extension ContentBlockerRulesManager {
DispatchQueue.main.async {
let identifier = model.rulesIdentifier.stringValue
Logger.contentBlocking.debug("Lookup CBR with \(identifier, privacy: .public)")
// Todo: how do we exclude this case from compilation time where the result is returned from cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think since we have resultType, this comment is addressed?


let perfInfo = compilationTime.map {
CompilationResult.PerformanceInfo(compilationTime: $0,
iterationCount: getCompilationRetryCount())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Iteration time would be 1 + retryCount per what we've discussed.

@studiosutara studiosutara marked this pull request as ready for review December 6, 2024 23:59
@@ -24,23 +24,24 @@ extension ContentBlockerRulesManager {

final class LookupRulesTask {

typealias LookupResult = (compiledRulesList: WKContentRuleList, model: ContentBlockerRulesSourceModel)
// This type has been overloaded multiple times, I'm collapsing them all into CompilationResult type
// typealias LookupResult = (compiledRulesList: WKContentRuleList, model: ContentBlockerRulesSourceModel)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be removed

@studiosutara studiosutara merged commit 55e7de1 into main Dec 9, 2024
7 checks passed
@studiosutara studiosutara deleted the smodi/compilation_time_tracking branch December 9, 2024 20:31
samsymons added a commit that referenced this pull request Dec 19, 2024
* main: (24 commits)
  change api (#1133)
  Ensure authToken is present before calling refreshAuthTokenIfNeeded
  Add 'locale' to report broken site params
  Add 'locale' to report broken site params
  Ensure authToken is present before calling refreshAuthTokenIfNeeded
  Privacy Pro Free Trials - Models and API (#1120)
  remove MaliciousSiteProtectionSubfeature (#1131)
  Malware protection 6: Malware integration (#1099)
  Add underlying error to PrivacyStatsError (#1130)
  Initial changes for compilation time tracking. (#1111)
  iOS System level credential provider (#1127)
  Increase ratio of complete form saves (#1124)
  Add PrivacyStatsError.failedToClearPrivacyStats (#1128)
  Update autofill to 16.0.0 (#1122)
  Update local network routing (#1117)
  Update RMF version matching to ignore build number (#1118)
  Fix threading issue between using a Semaphore and async/await (#1115)
  add experiment test fake feature (#1119)
  Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests from `a603ff9` to `6133e7d` (#1109)
  experiment default metrics pixels (#1107)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants