couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caolan McMahon (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1075) Circular require's in CommonJS modules
Date Tue, 03 May 2011 04:34:03 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028014#comment-13028014
] 

Caolan McMahon commented on COUCHDB-1075:
-----------------------------------------

Just FYI, this patch makes a fairly normal Kanso (http://kansojs.org) app respond around 10x
faster on the initial request (the one rendered by CouchDB). Removing the  per-request limitation
by commenting out the line "Couch.module_cache = {};" from State.reset you gain another 10x
speed increase on-top of the previous for all subsequent requests.

I think the small risks of users abusing the module_cache for storing state between requests
(which you might argue is at their own risk) are by far outweighed by the performance increases
for serious couchapps.

> Circular require's in CommonJS modules
> --------------------------------------
>
>                 Key: COUCHDB-1075
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1075
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>            Reporter: Caolan McMahon
>              Labels: javascript
>         Attachments: circular_requires.patch
>
>
> Having a CommonJS module A which requires B, when B also requires A causes the stack
to fill up with require calls. A prerequisite for this fix is the caching of modules, even
if it is only on a per-request basis.
> Patch incoming.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message