Contacts API: optimize debug statements

RESOLVED FIXED in mozilla17

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gwagner, Assigned: gwagner)

Tracking

(Blocks: 1 bug)

unspecified
mozilla17
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(blocking-basecamp:+)

Details

Attachments

(1 attachment)

30.40 KB, patch
Ben Turner (not reading bugmail, use the needinfo flag!)
: review+
Details | Diff | Splinter Review
Comment hidden (empty)
(Assignee)

Updated

5 years ago
Assignee: nobody → anygregor
(Assignee)

Comment 1

5 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

5 years ago
Created attachment 654314 [details] [diff] [review]
patch
Does the perf needle move with this patch?
(Assignee)

Updated

5 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+
Attachment #654314 - Flags: review?(bent.mozilla)
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.)
(Assignee)

Comment 6

5 years ago
Fixed the variable definition.

https://hg.mozilla.org/integration/mozilla-inbound/rev/3f340329e85b

Comment 7

5 years ago
What about comment 3?
(Assignee)

Comment 8

5 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

5 years ago
Blocks: 746439
blocking-basecamp: --- → ?

Comment 9

5 years ago
https://hg.mozilla.org/mozilla-central/rev/3f340329e85b
Status: NEW → RESOLVED
Last Resolved: 5 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.