[
https://issues.apache.org/jira/browse/COUCHDB-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209237#comment-13209237
]
Osher E commented on COUCHDB-890:
---------------------------------
I do not know what the appointed patch means, but I'm in the believe that a
simple solution can be made:
by wrapping the 'native' require function with a requirer of our own, we can
keep alive the execution-context of a certain view, where this context would be
used whenever new documents need to be indexed to the view. it means that a
design-document with several views will have such execution context per view,
This execution context will hold the view-level instances to the evaluated
modules.
>From the other side - a reverse index is held, which references the view
>execution-contexts for all the views it is involved in.
Once the design-document is updated, every module that field a check-sum check
(i.e changed) will invalidate all the views that it is part of.
P.S:
I would love to help and offer pull-requests if someone would help me get
started: how to my own build? how is the server.js is generated? how to debug
this? how to edit such sources? what are the conventions that are followed? I'm
GMT+2.
> Option to use a persistent CommonJS module cache
> ------------------------------------------------
>
> Key: COUCHDB-890
> URL: https://issues.apache.org/jira/browse/COUCHDB-890
> Project: CouchDB
> Issue Type: Improvement
> Components: JavaScript View Server
> Environment: All
> Reporter: mikeal
> Attachments: commonjscache.diff
>
>
> Since COUCHDB-1075, there is a CommonJS module cache used for resolving
> circular CommonJS dependencies. However, Caolan reports a 10x speed
> improvement by not clearing this cache between requests. An option to not
> clear the cache could be a great tool for performance-interested power users
> who know their CommonJS modules are sane. The improvement will be even
> greater when we turn on the JIT compiler in SpiderMonkey since cached modules
> will benefit from being pre-JIT'd.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira