summaryrefslogtreecommitdiff
path: root/lib/zlib.js
Commit message (Collapse)AuthorAgeFilesLines
* repl: Private Buffer object in lib/* filesEmmanuel Odeke2014-10-251-0/+1
| | | | | | | | | | | Fixes usage of global object 'Buffer' in lib/* files by ensuring that each file does an explicit require('buffer').Buffer. Previously, when running a repl, due to usage of global 'Buffer', any redefinition of Buffer would cause a crash eg var Buffer = {}. Fixes: https://github.com/joyent/node/issues/8588 PR-URL: https://github.com/joyent/node/pull/8603 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* zlib: do not crash on write after closeFedor Indutny2014-06-271-0/+4
| | | | | | fix #7767 Signed-off-by: Fedor Indutny <fedor@indutny.com>
* zlib: allow zero values for level and strategyBrian White2013-07-011-2/+8
| | | | This is a back-port of commit c9644fb from the master branch.
* zlib: Manage flush flags appropriatelyisaacs2013-03-081-13/+34
| | | | | | | If you call z.flush();z.write('foo'); then it would try to write 'foo' before the flush was done, triggering an assertion in the zlib binding. Closes #4950
* stream: _write takes an encoding argumentisaacs2013-03-051-2/+2
| | | | | This vastly reduces the overhead of decodeStrings:false streams, such as net and http.
* stream: Remove output function from _transformisaacs2013-03-051-9/+7
| | | | Just use stream.push(outputChunk) instead.
* stream: remove lowWaterMark featureisaacs2013-02-211-18/+1
| | | | | | | | | | It seems like a good idea on the face of it, but lowWaterMarks are actually not useful, and in practice should always be set to zero. It would be worthwhile for writers if we actually did some kind of writev() type of thing, but actually this just delays calling write() and the overhead of doing a bunch of Buffer copies is not worth the slight benefit of calling write() fewer times.
* Merge remote-tracking branch 'ry/v0.8' into masterisaacs2013-02-061-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: AUTHORS ChangeLog deps/npm/html/api/bin.html deps/npm/html/api/bugs.html deps/npm/html/api/commands.html deps/npm/html/api/config.html deps/npm/html/api/deprecate.html deps/npm/html/api/docs.html deps/npm/html/api/edit.html deps/npm/html/api/explore.html deps/npm/html/api/help-search.html deps/npm/html/api/init.html deps/npm/html/api/install.html deps/npm/html/api/link.html deps/npm/html/api/load.html deps/npm/html/api/ls.html deps/npm/html/api/npm.html deps/npm/html/api/outdated.html deps/npm/html/api/owner.html deps/npm/html/api/pack.html deps/npm/html/api/prefix.html deps/npm/html/api/prune.html deps/npm/html/api/publish.html deps/npm/html/api/rebuild.html deps/npm/html/api/restart.html deps/npm/html/api/root.html deps/npm/html/api/run-script.html deps/npm/html/api/search.html deps/npm/html/api/shrinkwrap.html deps/npm/html/api/start.html deps/npm/html/api/stop.html deps/npm/html/api/submodule.html deps/npm/html/api/tag.html deps/npm/html/api/test.html deps/npm/html/api/uninstall.html deps/npm/html/api/unpublish.html deps/npm/html/api/update.html deps/npm/html/api/version.html deps/npm/html/api/view.html deps/npm/html/api/whoami.html deps/npm/html/doc/README.html deps/npm/html/doc/adduser.html deps/npm/html/doc/bin.html deps/npm/html/doc/bugs.html deps/npm/html/doc/build.html deps/npm/html/doc/bundle.html deps/npm/html/doc/cache.html deps/npm/html/doc/changelog.html deps/npm/html/doc/coding-style.html deps/npm/html/doc/completion.html deps/npm/html/doc/config.html deps/npm/html/doc/dedupe.html deps/npm/html/doc/deprecate.html deps/npm/html/doc/developers.html deps/npm/html/doc/disputes.html deps/npm/html/doc/docs.html deps/npm/html/doc/edit.html deps/npm/html/doc/explore.html deps/npm/html/doc/faq.html deps/npm/html/doc/folders.html deps/npm/html/doc/global.html deps/npm/html/doc/help-search.html deps/npm/html/doc/help.html deps/npm/html/doc/index.html deps/npm/html/doc/init.html deps/npm/html/doc/install.html deps/npm/html/doc/json.html deps/npm/html/doc/link.html deps/npm/html/doc/ls.html deps/npm/html/doc/npm.html deps/npm/html/doc/outdated.html deps/npm/html/doc/owner.html deps/npm/html/doc/pack.html deps/npm/html/doc/prefix.html deps/npm/html/doc/prune.html deps/npm/html/doc/publish.html deps/npm/html/doc/rebuild.html deps/npm/html/doc/registry.html deps/npm/html/doc/removing-npm.html deps/npm/html/doc/restart.html deps/npm/html/doc/rm.html deps/npm/html/doc/root.html deps/npm/html/doc/run-script.html deps/npm/html/doc/scripts.html deps/npm/html/doc/search.html deps/npm/html/doc/semver.html deps/npm/html/doc/shrinkwrap.html deps/npm/html/doc/star.html deps/npm/html/doc/start.html deps/npm/html/doc/stop.html deps/npm/html/doc/submodule.html deps/npm/html/doc/tag.html deps/npm/html/doc/test.html deps/npm/html/doc/uninstall.html deps/npm/html/doc/unpublish.html deps/npm/html/doc/update.html deps/npm/html/doc/version.html deps/npm/html/doc/view.html deps/npm/html/doc/whoami.html deps/npm/man/man1/global.1 deps/npm/man/man1/ls.1 deps/npm/man/man1/npm.1 deps/npm/man/man1/rm.1 deps/npm/man/man3/npm.3 deps/npm/node_modules/glob/glob.js deps/npm/node_modules/glob/package.json deps/npm/node_modules/node-gyp/package.json deps/npm/node_modules/npm-registry-client/package.json deps/npm/node_modules/npmconf/package.json deps/npm/node_modules/read-installed/package.json deps/npm/node_modules/rimraf/package.json deps/npm/node_modules/rimraf/rimraf.js deps/npm/package.json deps/uv/src/win/error.c doc/api/crypto.markdown lib/zlib.js src/node_version.h src/node_zlib.cc test/simple/test-buffer.js
| * zlib: reduce memory consumption, release earlyBen Noordhuis2013-02-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In zlibBuffer(), don't wait for the garbage collector to reclaim the zlib memory but release it manually. Reduces memory consumption by a factor of 10 or more with some workloads. Test case: function f() { require('zlib').deflate('xxx', g); } function g() { setTimeout(f, 5); } f(); Observe RSS memory usage with and without this commit. After 10,000 iterations, RSS stabilizes at ~35 MB with this commit. Without, RSS is over 300 MB and keeps growing. Cause: whenever the JS object heap hits the high-water mark, the V8 GC sweeps it clean, then tries to grow it in order to avoid more sweeps in the near future. Rule of thumb: the bigger the JS heap, the lazier the GC can be. A side effect of a bigger heap is that objects now live longer. This is harmless in general but it affects zlib context objects because those are tied to large buffers that live outside the JS heap, on the order of 16K per context object. Ergo, don't wait for the GC to reclaim the memory - it may take a long time. Fixes #4172.
* | zlib: streams2isaacs2012-12-141-124/+91
| |
* | zlib: s/clear/close/ and match other close() semanticsisaacs2012-10-311-4/+15
| |
* | zlib: reduce memory consumption, release earlyBen Noordhuis2012-10-301-1/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In zlibBuffer(), don't wait for the garbage collector to reclaim the zlib memory but release it manually. Reduces memory consumption by a factor of 10 or more with some workloads. Test case: function f() { require('zlib').deflate('xxx', g); } function g() { setTimeout(f, 5); } f(); Observe RSS memory usage with and without this commit. After 10,000 iterations, RSS stabilizes at ~35 MB with this commit. Without, RSS is over 300 MB and keeps growing. Cause: whenever the JS object heap hits the high-water mark, the V8 GC sweeps it clean, then tries to grow it in order to avoid more sweeps in the near future. Rule of thumb: the bigger the JS heap, the lazier the GC can be. A side effect of a bigger heap is that objects now live longer. This is harmless in general but it affects zlib context objects because those are tied to large buffers that live outside the JS heap, on the order of 16K per context object. Ergo, don't wait for the GC to reclaim the memory - it may take a long time. Fixes #4172.
* zlib: Emit 'close' on destroy().Dominic Tarr2012-08-041-0/+1
|
* domain: the EventEmitter constructor is now always called in nodecoreAndreas Madsen2012-06-151-2/+4
|
* zlib: use Buffer.concat()isaacs2012-06-151-19/+1
|
* Fix #3052 Handle errors properly in zlibisaacs2012-04-021-0/+40
|
* zlib: don't use C++ templatesssuda2012-03-291-9/+9
| | | | Reduces the executable's size by a few kilobytes.
* Added destroy method to Zlib object in zlib.js moduleChristian Ress2012-03-131-0/+6
|
* Lint all the JavaScripts.isaacs2012-02-181-1/+1
|
* Merge branch 'v0.6'Fedor Indutny2012-01-241-8/+12
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog doc/template.html lib/cluster.js lib/http.js lib/tls.js src/node.h src/node_version.h test/simple/test-cluster-kill-workers.js
| * Fix #2365 zlib crashing on invalid inputNicolas LaCasse2012-01-201-8/+12
| | | | | | | | | | Fix zlib crashes on error due to improper use of removeListener in the error handler
* | zlib: reset() method for deflate/inflate streamsFedor Indutny2012-01-121-0/+4
| | | | | | | | * ammended test-zlib-dictionary to cover reusing streams
* | [zlib] added dictionary supportFedor Indutny2011-12-051-1/+8
|/
* Close #1930 Convenience methods for zlibMatt Robenolt2011-11-041-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of 20 commits. Their commit messages are preserved below for the benefit of future generations. * Adding a shortcut to easily compress/decompress a string of text. * Making the API consistent. unzip should accept a Buffer for input as well. * Adding docs. * Oops, typo. * Propagate error through the callback. * Adding zlib from string tests. * Typo in test. * Remove 'end' listeners, and join buffers properly instead of joining them as a string. * Oops, needs to be rendered to a string. * Updated test to include multi-byte characters. * unzip should return a raw Buffer. Updated docs to reflect. * And finally updating test. * EventEmitter.destroy() is a bit more customary * Revert "EventEmitter.destroy() is a bit more customary" * Renaming internal methods to "buffer" instead of string. * Remove the 'error' listeners as well. * @isaacs: spacing/style, and compress duplicate functions into one * @isaacs: Update docs * @isaacs: doc style fix
* Close #1929 zlib Respond to 'resume' events properlyisaacs2011-10-241-2/+3
|
* Fix #1882 zlib Update 'availOutBefore' value, and testisaacs2011-10-131-0/+5
|
* zlib: Typo. s/opt/opts/isaacs2011-09-261-1/+1
|
* zlib: lintisaacs2011-09-171-15/+35
|
* zlib: Fix test so that it's not trivially passing, then pass it.isaacs2011-09-171-10/+8
| | | | Regression from the refactor to move more things into JS.
* Initial pass at zlib bindingsisaacs2011-09-171-0/+325