Skip to content

Instantly share code, notes, and snippets.

@tejom
Last active November 22, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tejom/424d89feb9b063644cd01edfcbb39c43 to your computer and use it in GitHub Desktop.
Save tejom/424d89feb9b063644cd01edfcbb39c43 to your computer and use it in GitHub Desktop.
notes on v8
https://www.youtube.com/watch?v=VhpdsjBUS3g&feature=youtu.be&t=16m30s
http://mrale.ph/blog/2011/12/18/v8-optimization-checklist.html
gdb compile
https://groups.google.com/forum/#!topic/v8-users/OIICvStFMmc
https://groups.google.com/forum/#!searchin/v8-users/gdb%7Csort:relevance/v8-users/GxCmg3fRaLU/p6Jb95RkQ9cJ
V8 Inside Out” from WebRebels 2012
saw tooth gc memory usage
v8 gc trigger
memory pool is exhausted and need to allocate
young and old memory, age based on gc survived
young, fast allocation,collection and freqention collection
few survive,(80%)
old generation slow and infrequent
increment mark,sweep(return memory), compact
young space
to and from space
to ( new Foo)
unllocated memory
when your try to allocate and run out of space
swap to and from
mark used memory in from space
copy back to "to space"
issues
calling new
unoptmized mode code
implicit memory allocation ex each math op
var a = p*x two allocations
v8 will eventually try to optomize code
code can be deoptimized
to many deoptimzations cause code to never be optmized
try catch not optimized
modify objects
add field to existing object
deoptimized
new class is generate in v8
v8 tools
v8 timeline
--prof --noprof-lazy --log-timer-events
plot-timer-events
generate png file
state v8 is in
code kind
optimized and unoptimized
green optimized
blue and red unoptimized
--prof --noprof-lazy --log-timer-events
<os>-tick-proccesor
functions seen by profiler
* shows optimized
~ unoptimized
find unoptimized functions
--trace-deopt --trace-opt-verbose
text to terminal
optimization and reason
ic
inline cache
ic-explorer.html
__
The corresponding source can be found in
src/heap/gc-tracer.cc
On Wed, Sep 16, 2015 at 7:02 AM dmonji <monika...@gmail.com> wrote:
[29648:0xbad6f48] 2631 ms: Scavenge 8.0 (22.6) -> 4.2 (22.6) MB, 8.4 / 0 ms [allocation failure].
[<process id>:<isolate address>] <absolute time> ms: <type> <start object size> (<start memory size>) -> <end object size> (<end memory size>) MB, <scavenge duration> / <time spent in external callbacks, e.g. embedder> [<reason>].
[29648:0xbad6f48] 3130 ms: Mark-sweep 8.0 (22.6) -> 4.4 (22.6) MB, 63.0 / 0 ms (+ 69.0 ms in 55 steps since start of marking, biggest step 2.4 ms) [GC interrupt] [GC in old space requested].
Same as above, with the addition
... (<time spent in incremental marking> / <# incremental steps> , biggest step <longest time for incremental marking step>) [<reason, e.g. GC via stack guard] [<ultimate reason>].
g++ -o shell src/hello-world.cc -I. -I./deps/v8 -I./deps/v8/include -I./include -Wl,--start-group deps/v8/out/x64.release/obj.target/{src/libv8_{base,libbase,external_snapshot,libplatform,libsampler},third_party/icu/libicu{uc,i18n}}.a -Wl,--end-group -lrt -ldl -pthread -std=c++0x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment