Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use Blob objects for storing file data #16

@sicking

Description

@sicking

ArrayBuffer objects have the disadantage that they always have to live in memory. So if your file entries contain ArrayBuffer objects which describe the file contents, that means that the whole file contents is read into memory whenever the IDB entry is read.

However if you use Blob objects to hold the data, that means that that only the metadata about the Blob needs to be read at the time when the IDB entry is read. The actual Blob contents doesn't need to be read into memory until the Blob is read using FileReader.

Another advantage that Blob gives is that it enables the IDB implementation to store the Blob data outside of the database. This improves performance of the database since it can be kept more compact. Firefox currently does this, though I think IE does not. Not sure what chrome does since they only recently added Blob support (not sure if it's even landed yet).

The lack of Blob support in Chrome might be the main sticking issue here though...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions