Nodejs profiling: parent element (sliced ​​string)

I was profiling a nodejs application and saw some weird lines marked as parent in (chopped string) .

I am using v8 profiler and node inspector.

Here is a photo of the profiler screen (sorry for the photo, not the screenshot, it’s just that my system is really overloaded and there is not enough space to create a screen): http://i.imgur.com/dkkPbGA.jpg

So my question is, what is the parent in the (chopped string) string?

UPD : after some review, it looks like I understand when I made a slice on the line, it saved the parent line (is this an optimization?). As a result, these parent lines were in memory. After I copied these spliced ​​lines, it looks like these parent lines were cleared from memory. I'm right?

+4
source share
1 answer

, . var longstring = "abc...", (a.k.a. "slice" ) var short = longstring.substr(20, 30), ; short a slice of |longstring| beginning at index 20 with a length of 30, longstring short "parent". short, longstring .

( ( V8) , , , , - , . , , ( ) ( , , ) .)

0

Source: https://habr.com/ru/post/1609220/


All Articles