isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
477 stars 47 forks source link

feat: add native 'exists' implementation #22

Open billiegoose opened 4 years ago

billiegoose commented 4 years ago

In theory, a native implementation of exists that doesn't throw an Error and immediately catch it might be ever-so-slightly faster. Not sure what the overhead of creating an Error object is... it can be "expensive" because it creates a stack trace - although I think most browsers compute the stack trace only if needed nowadays. Hmm.

Originally posted by @wmhilton in https://github.com/isomorphic-git/lightning-fs/issues/21#issuecomment-519230529