Skip to content
Advertisement

Tag: performance

Javascript factorial function memoization

I’m trying to use the factorial function with memoization. I have taken the max value from the object to reduce the number of recursive calls made. But the problem is the first call is I don’t know whether this is optimized or not since the first call is pretty expensive. Any insights on this will be great. Answer You don’t

Questions on performance regarding async/await vs Promises and the event loop

Introduction A colleague of mine and I have been discussing the asynchronous nature of JavaScript in the browser and wondering what technical benefits are. We are aware that async/await is syntactical sugar for Promises, but curious to know if there is any other performance benefit for using one over the other. For example: Are both async/await and Promises treated the

How are the JavaScript Arrays internally resizing?

I’ve been trying to implement a collection type of class (similar to List found in C#) in JavaScript that has some custom functionalities. I also wanted it to be somewhat optimized (I’ve read some articles on how to properly use JavaScript Arrays). I thought to myself “if we don’t define an initial size to an Array and we keep adding

Math.floor VS Math.trunc JavaScript

Background I am making a function that receives a positive number and then rounds the number to the closest integer bellow it. I have been using Math.floor, but recently I discovered Math.trunc. I am aware that both will return the same value, given a positive number, and that they work in completely different ways. I am interested in exploring this

How to profile Javascript now that JSPerf is down? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 1 year ago. Improve this question As some of you probably noticed jsperf is down for some

Advertisement