Skip to content

Commit 3a9b478

Browse files
mapsamCarol Hansen
authored andcommitted
node-cpp updates (#43)
* update node-cpp with concurrency examples, add relevant glossary terms
1 parent df52371 commit 3a9b478

2 files changed

Lines changed: 167 additions & 58 deletions

File tree

glossary.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ Contributions are welcome. To contribute, please:
125125
- [small size optimization](#small-size-optimization)
126126
- [performant](#performant)
127127
- [compiler optimization level](#compiler-optimization-level)
128+
- [concurrency](#concurrency)
128129

129130
- [Build modes](#build-modes)
130131

@@ -142,6 +143,7 @@ Contributions are welcome. To contribute, please:
142143

143144
- [Debugging and Profiling](#debugging-and-profiling)
144145

146+
- [profiling](#profiling)
145147
- [debug symbols](#debug-symbols)
146148
- [Debugger](#debugger)
147149
- [Tracer](#tracer)
@@ -217,6 +219,7 @@ Contributions are welcome. To contribute, please:
217219

218220
- [Node](#node)
219221
- [V8](#v8)
222+
- [Node addon](#node-addon)
220223
- [event loop](#event-loop)
221224
- [libuv](#libuv)
222225
- [I/O](#io)
@@ -274,7 +277,7 @@ Learn more [at the mason homepage](https://github.com/mapbox/mason).
274277

275278
### node-pre-gyp
276279

277-
node-pre-gyp is a package manager for node addons written in C++. It is able to install [precompiled loadable modules](#loadable-modules) (aka `.node` files) from binaries.
280+
node-pre-gyp is a package manager for [node addons](https://github.com/mapbox/cpp/blob/master/node-cpp.md) written in C++. It is able to install [precompiled loadable modules](#loadable-modules) (aka `.node` files) from binaries.
278281

279282
Learn more [at the node-pre-gyp homepage](https://github.com/mapbox/node-pre-gyp).
280283

@@ -723,6 +726,10 @@ Compilers are rapidly adding more and more optimizations and shifting around whi
723726
- [a listing](http://llvm.org/docs/Passes.html) of all the internal compiler optimizations in clang++ which you don't need to know specifically, but which are under-the-hood of the "O" levels.
724727
- [a detailed summary](http://stackoverflow.com/a/15548189) of which internal optimizations are grouped in which "O" level across clang++ releases.
725728

729+
### concurrency
730+
731+
Concurrency is the process of executing different pieces of the same process to allow for parallel execution of these pieces [[wikipedia](https://en.wikipedia.org/wiki/Concurrency_(computer_science))]. See [more info here](https://github.com/mapbox/cpp/blob/master/node-cpp.md#why-create-a-node-addon).
732+
726733
## Build modes
727734

728735
### DNDEBUG
@@ -823,7 +830,7 @@ The solution to this problem then is to build your [release builds](#release-bui
823830

824831
### problem of profiling and compiler optimization levels
825832

826-
Profiling is a great strategy for learning why and where a program is slow. But caution must be used in interpreting the results when profiling because:
833+
[Profiling](#profiling) is a great strategy for learning why and where a program is slow. But caution must be used in interpreting the results when profiling because:
827834

828835
- If you are profiling [release builds](#release-build) then your profiling output is likely not showing inline functions which may mislead you about where time is spent in the program. Profilers generally aggregate timing results in a [calltree](#calltree) composed of multiple times sampling the [callstack](#callstack). If the [callstack](#callstack) is not showing you all the functions because some have been inlined away, you may not be able to see the whole picture.
829836

@@ -833,6 +840,12 @@ There is no perfect solution, other than only relying on profiling output to gui
833840

834841
## Debugging and Profiling
835842

843+
### Profiling
844+
845+
Profiling is a way to analyze or measure the performance of a program, to give you a better idea of what your program is actually doing when you run a process. Profiling can help measure things like memory usage, how often a particular function is called within a process, or how many threads are running. It is especially useful for determining how to best optimize a program.
846+
847+
Check out [this guide](https://github.com/springmeyer/profiling-guide) for more information on how to profile.
848+
836849
### debug symbols
837850

838851
Extra stuff the compiler encodes in a binary to help [debuggers](#debugger) inspect details about a running or crashed program and [tracers](#tracer) collect detailed information about program execution. Normally to enable debug [symbols](#symbol) you pass `-g` to a compiler. This can be done in either a [release build](#release-build) or a [debug build](#debug-build).
@@ -1427,6 +1440,10 @@ See these articles to understand more about node [performance](#performance):
14271440

14281441
V8 is a Javascript "engine", or a Javascript interpreter. It translates Javascript into more efficient machine code (native assembly code), then executes it. V8 gives developers access to functionality (networking, DOM handling, external events, HTML5 video, canvas and data storage) needed to control the web browser, and access to server-side/system functionality within Node.js. V8 is [open source and written in C++](https://github.com/v8/v8).
14291442

1443+
### Node Addon
1444+
1445+
See [node addon docs](https://github.com/mapbox/cpp/blob/master/node-cpp.md)
1446+
14301447
### event loop
14311448

14321449
TODO
@@ -1451,4 +1468,4 @@ I/O stands for "input/output".
14511468

14521469
### non-blocking/blocking
14531470

1454-
### [NAN](https://github.com/mapbox/cpp/blob/master/node-cpp.md#nodejs-c-addons)
1471+
### [NAN](https://github.com/mapbox/cpp/blob/master/node-cpp.md#native-abstractions-for-nodejs-nan)

0 commit comments

Comments
 (0)