Commit dbf9e9f
node-api: provide napi_define_properties fast path
Implement defining properties via V8's
`v8::Object::CreateDataProperty()`, which is faster for data-valued,
writable, configurable, and enumerable properties.
Re: #45905
Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com>
PR-URL: #48440
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent 38bf290 commit dbf9e9fCopy full SHA for dbf9e9f
File tree
Expand file treeCollapse file tree
6 files changed
+149
-9
lines changedOpen diff view settings
Filter options
- benchmark/napi/define_properties
- src
Expand file treeCollapse file tree
6 files changed
+149
-9
lines changedOpen diff view settings
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1422 | 1422 | |
1423 | 1423 | |
1424 | 1424 | |
| 1425 | + |
1425 | 1426 | |
1426 | 1427 | |
1427 | 1428 | |
|
Collapse file
benchmark/napi/define_properties/.gitignore
Copy file name to clipboard+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
Collapse file
benchmark/napi/define_properties/binding.c
Copy file name to clipboard+104Lines changed: 104 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
Collapse file
benchmark/napi/define_properties/binding.gyp
Copy file name to clipboard+8Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
Collapse file
benchmark/napi/define_properties/index.js
Copy file name to clipboard+15Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
Collapse file
+20-9Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1369 | 1369 | |
1370 | 1370 | |
1371 | 1371 | |
| 1372 | + |
| 1373 | + |
| 1374 | + |
| 1375 | + |
| 1376 | + |
| 1377 | + |
| 1378 | + |
| 1379 | + |
| 1380 | + |
| 1381 | + |
| 1382 | + |
| 1383 | + |
| 1384 | + |
| 1385 | + |
| 1386 | + |
| 1387 | + |
| 1388 | + |
| 1389 | + |
| 1390 | + |
1372 | 1391 | |
1373 | | - |
1374 | | - |
1375 | | - |
1376 | | - |
1377 | | - |
1378 | | - |
1379 | | - |
1380 | | - |
1381 | | - |
| 1392 | + |
1382 | 1393 | |
1383 | 1394 | |
1384 | 1395 | |
|
0 commit comments