Closed Bug 784746 Opened 8 years ago Closed 8 years ago

Contacts API: optimize debug statements

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17
blocking-basecamp +

People

(Reporter: gwagner, Assigned: gwagner)

References

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → anygregor
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()
Attached patch patchSplinter Review
Does the perf needle move with this patch?
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.)
What about comment 3?
(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.
Blocks: 746439
blocking-basecamp: --- → ?
https://hg.mozilla.org/mozilla-central/rev/3f340329e85b
Status: NEW → RESOLVED
Closed: 8 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.