Contacts API: optimize debug statements

RESOLVED FIXED in mozilla17

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: gwagner, Assigned: gwagner)

Tracking

unspecified
mozilla17
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking-basecamp:+)

Details

Attachments

(1 attachment)

Assignee

Description

7 years ago
No description provided.
Assignee

Updated

7 years ago
Assignee: nobody → anygregor
Assignee

Comment 1

7 years ago
Currently we create lots of garbage because we use 

let DEBUG = 0;
if (DEBUG)
  debug = function (s) { dump("-*- ContactManager: " + s + "\n"); }
else
  debug = function (s) {}

debug(...)

I want to change it to 
if (DEBUG) debug()
Assignee

Comment 2

7 years ago
Posted patch patchSplinter Review
Does the perf needle move with this patch?
Assignee

Updated

7 years ago
Attachment #654314 - Flags: review?(bent.mozilla)
Comment on attachment 654314 [details] [diff] [review]
patch

Review of attachment 654314 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me!
Attachment #654314 - Flags: review+
Comment on attachment 654314 [details] [diff] [review]
patch

Review of attachment 654314 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/contacts/ContactManager.js
@@ +4,5 @@
>  
>  "use strict";
>  
> +const DEBUG = false;
> +debug = function (s) { dump("-*- ContactManager: " + s + "\n"); }

Missing variable definition for `debug`. Either

  let debug = ...

or

  function debug(...) ...

(I suggest the latter.)

Comment 7

7 years ago
What about comment 3?
Assignee

Comment 8

7 years ago
(In reply to Andreas Gal :gal from comment #7)
> What about comment 3?

500 contacts take now 1.5 sec with the UI Test -> Get all contacts.
So from 9sec to 1.5sec.
Assignee

Updated

7 years ago
Blocks: 746439
blocking-basecamp: --- → ?
https://hg.mozilla.org/mozilla-central/rev/3f340329e85b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
blocking-basecamp: ? → +
You need to log in before you can comment on or make changes to this bug.