Skip to content

Instantly share code, notes, and snippets.

<html>
<body>
<script src="//cdn.jsdelivr.net/pouchdb/2.2.3/pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
<html>
<body>
<script src="pouch.js"></script>
<script src="index.js"></script>
</body>
</html>
/**
* @license AngularJS v1.3.0-beta.7
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
@nolanlawson
nolanlawson / _sorted_by_frequency
Last active August 29, 2015 14:02
Output from the persisted-views performance test when using the WebSQL adapter and debug-websql
sql statements sorted from most to least frequent:
7256 SELECT seq FROM 'by-sequence' WHERE doc_id_rev=?
7256 SELECT json FROM 'document-store' WHERE id = ?
7256 INSERT INTO 'by-sequence' (doc_id_rev, json, deleted) VALUES (?, ?, ?);
4896 SELECT json AS metadata FROM 'document-store' WHERE id = ?
2562 SELECT 'by-sequence'.seq AS seq, 'by-sequence'.deleted AS deleted, 'by-sequence'.json AS data, 'document-store'.json AS metadata FROM 'document-store' JOIN 'by-sequence' ON 'by-sequence'.seq = 'document-store'.winningseq WHERE 'document-store'.id=?
258 SELECT update_seq FROM 'metadata-store'
100 SELECT 'by-sequence'.seq AS seq, 'by-sequence'.deleted AS deleted, 'by-sequence'.json AS data, 'document-store'.json AS metadata FROM 'document-store' JOIN 'by-sequence' ON 'by-sequence'.seq = 'document-store'.winningseq WHERE 'document-store'.local = 0 AND 'document-store'.id >= ? AND 'by-sequence'.deleted = 0 ORDER BY 'document-store'.id ASC LIMIT 5 OFFSET 0
52 SELECT COUNT('document-store'.id) AS 'num' FROM 'document
@nolanlawson
nolanlawson / app.js
Last active August 29, 2015 14:02
Quick test of pouchdb in node-webkit
(function() {
'use strict';
var db = null;
var dbname = 'idb://pouch_intro';
window.addEventListener( 'load', loadPouch, false );
function loadPouch() {
new PouchDB(dbname, function(err, pouchdb){
<!DOCTYPE html>
<html>
<head>
<title>PouchDB #2342</title>
<script src="pouch.js"></script>
<script src="main.js"></script>
</head>
<body>
</body>
@nolanlawson
nolanlawson / readme.md
Last active August 29, 2015 14:02
PouchDB performance report, June 14 2014

PouchDB performance report, June 14 2014

Summary

PouchDB 3.0.0 will be up to 77% faster than 2.2.3 for secondary index creation. Gains were made across all adapters, with the most improved being IndexedDB in Chrome.

Intro

@nolanlawson
nolanlawson / stardown.md
Last active August 29, 2015 14:02
Server-side *DOWN databases that are passing the PouchDB test suite
Database Known to pass at 100% Comments Issue
LevelDOWN Very stable
MemDOWN Somewhat stable, seems to have intermittents, can't find them now for some reason
RiakDOWN X Seems stable-ish, but needs to implement destroy() here
SqlDOWN X failing at test.design_docs.js-http Concurrent queries here
MysqlDOWN X Doesn't seem stable
RedisDOWN X Fails at test.all_docs.js-http Testing conflicts here and here
@nolanlawson
nolanlawson / tldrs.md
Last active August 29, 2015 14:02
PouchDB PR TLDRs

There are a ton related to performance, which you can probably skip for now. Those should be reviewed with a fine-toothed comb, since most performance fixes make the code harder to read, unfortunately.

pouchdb/pouchdb#2363

This one is kind of a big deal for pouchdb-server. Basically I wanted to set it up so that when we test against pouchdb-server, we don't cram all the files in the root directory (annoying during development), and in the process I discovered a bug in how the db was reporting its name in db.info. This fix makes sure that the name is the same everywhere (on('destory'), on('create'), db.info()) and is something sensible, regardless of the prefix.

pouchdb/pouchdb#2367

More pouchdb-server stuff. I think it makes sense to go ahead and merge this, even though it's failing. Gives us an excuse to make more improvements to MemDOWN.