Closed Bug 600059 Opened 14 years ago Closed 6 years ago

[meta] Don't spin the event loop

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1007448

People

(Reporter: mconnor, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: meta, Whiteboard: [sync:scale])

it's ugly, and we need to just write proper async code and not kill babies.  That's XBL's job, after all.
I've started https://wiki.mozilla.org/Services/Sync/WEP/116 as a place for collecting thoughts on the design of the async APIs and the migration path.
Depends on: 603301
No longer depends on: 581560
Relevant thread on dev-platform: https://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/cae2206562025b3c. Looks like using generators isn't a viable option to make async code look pretty.
Let the record show that there was misinformation in the thread and generators are fine to use from a safety perspective (they do not secretly spin a nested event loop).  They do, however, have some optimization impact at this time since I do not believe a generator function can be method JITted directly (though the things it calls should be fine); I am unclear if it likewise precludes the tracing JIT for that frame between yields or not.  Until ECMAScript adopts generators, we probably won't see a lot of optimization of them...
(In reply to comment #4)
> ... Until ECMAScript adopts generators, we probably won't see a 
> lot of optimization of them...

It's good to hear that they're not totally unsuitable, but given Sync's unusual performance requirements, anything which is a little prettier but a lot slower or more consy isn't really in the running. More's the pity…
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Depends on: 652221
Priority: -- → P3
Summary: kill Sync.js dependency → [meta] Don't spin the event loop
Keywords: meta
Whiteboard: [sync:scale]
Blocks: 809457
Depends on: 731524
Depends on: 823198
Blocks: 731524, 710080
No longer depends on: 731524
Priority: P3 → --
Blocks: 702180
Blocks: 697649
Depends on: 829770
No longer depends on: 829770
Status: ASSIGNED → NEW
No longer blocks: 697649
Blocks: 697649
Assignee: rnewman → nobody
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.