Need help in optimization
See original GitHub issueHi,
Thanks for this great library.
I have a use case related to multiple domains where I will have to do nlp.clone()
multiple times in order not to overlap lexicon information related to one domain with another.
Currently, each nlp.clone()
call is taking approx. 160ms. So, for 40 domains it is taking approximately 6 seconds. Any better way of doing this?
var nlp = require('compromise');
const performance = require('perf_hooks').performance;
var totalTime = 0;
var numOfDomains = 40;
for(var i = 0; i < numOfDomains; i++){
var t0 = performance.now();
var _nlp = nlp.clone();
var t1 = performance.now();
var diff = (t1 - t0);
totalTime += diff;
}
console.log("Time taken for " + numOfDomains + " apps is approx. " + Math.round(totalTime / 1000) + " Seconds");
Time taken for 40 apps is approx. 6 Seconds
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Optimization - Calculus I - Pauls Online Math Notes
In this section we are going to look at optimization problems. In optimization problems we are looking for the largest value or the...
Read more >10 Steps for Improving Business Optimization (With Benefits)
Optimization can help businesses with their internal and external operations, depending on their unique needs.
Read more >Optimization Problems - Calculus - YouTube
This calculus video explains how to solve optimization problems. It explains how to solve the fence along the river problem, ...
Read more >How to Solve ANY Optimization Problem [Calc 1] - YouTube
Optimization problems are like men. They're all the same amirite? … Show more. Show more. Key moments. View all. Solving for W.
Read more >How to Solve Optimization Problems in Calculus - Matheno.com
Need to solve Optimization problems in Calculus? Let's break 'em down and develop a strategy that you can use to solve them routinely...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@spencermountain Yes. Replaced
nlp.clone()
with below code@spencermountain Thanks for the prompt reply! I used your suggestion of setting the world values directly and then running
.tagger()
. Performance is much better now! Thank you!