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

Do BrowserDB transactions on a background thread #532

Closed
wants to merge 1 commit into from

Conversation

wesj
Copy link
Contributor

@wesj wesj commented Jun 1, 2015

The SwiftData code runs all transaction synchronously on a background thread to avoid concurrency issues. I build it this way originally so that callers could decide for themselves if they wanted to run on a background thread. None of ours are running on background threads though AFAIK (I think remote tabs and clients is)? This moves all BrowserDB (i.e. places) access to a new background one. That should mean that sync don't block the UI (not verified?) and it DOES mean that tapping the urlbar reacts much more quickly with a large data set (but still shows you no data until the cursor has loaded).

There's a lot of possible places to put this threading. We could also do things like allowing BrowserDB to take a queue when its created, which would let us share a queue with other DBs. Curious what others think.

let deferred = Deferred<Result<()>>()

dispatch_async(queue) {
let start = NSDate()
Copy link
Contributor

Choose a reason for hiding this comment

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

Might as well start with milliseconds directly: NSDate.now()

@wesj wesj closed this Jun 17, 2015
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
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.

None yet

2 participants