Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2916228
test_gc_stress10.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
test_gc_stress10.js
View Options
import
{
Screen
,
colors
,
codes
,
pad
,
truncate
}
from
'../examples/tui/tuey.js'
;
const
screen
=
new
Screen
({
fullscreen
:
false
,
hideCursor
:
false
});
const
logs
=
[
{
time
:
'10:23:45'
,
level
:
'INFO'
,
message
:
'Application started'
},
{
time
:
'10:23:48'
,
level
:
'WARN'
,
message
:
'Cache directory not found, creating...'
},
{
time
:
'10:24:05'
,
level
:
'ERROR'
,
message
:
'Failed to load plugin: missing-plugin'
},
{
time
:
'10:24:06'
,
level
:
'WARN'
,
message
:
'Running with reduced functionality'
},
{
time
:
'10:24:10'
,
level
:
'INFO'
,
message
:
'Ready to accept connections'
}
];
function
render
()
{
screen
.
write
(
2
,
14
,
colors
.
bold
+
colors
.
magenta
+
'┌─ Recent Activity ───────────────────────┐'
+
codes
.
reset
);
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
log
=
logs
[
i
];
const
levelColor
=
log
.
level
===
'ERROR'
?
colors
.
red
:
log
.
level
===
'WARN'
?
colors
.
yellow
:
colors
.
green
;
screen
.
write
(
2
,
15
+
i
,
colors
.
magenta
+
'│'
+
codes
.
reset
);
screen
.
write
(
4
,
15
+
i
,
`
${
colors
.
dim
}${
log
.
time
}${
codes
.
reset
}
${
levelColor
}${
log
.
level
}${
codes
.
reset
}
${
truncate
(
log
.
message
,
30
)
}
`
);
screen
.
write
(
45
,
15
+
i
,
colors
.
magenta
+
'│'
+
codes
.
reset
);
}
screen
.
write
(
2
,
20
,
colors
.
magenta
+
'└──────────────────────────────────────────┘'
+
codes
.
reset
);
}
const
t0
=
Date
.
now
();
for
(
let
frame
=
0
;
frame
<
50000
;
frame
++
)
{
render
();
const
stats
=
Ant
.
stats
();
const
elapsed
=
((
Date
.
now
()
-
t0
)
/
1000
).
toFixed
(
2
);
console
.
log
(
`frame
${
frame
}
: arena
${
(
stats
.
arenaUsed
/
1024
/
1024
).
toFixed
(
1
)
}
MB / `
+
`
${
(
stats
.
arenaSize
/
1024
/
1024
).
toFixed
(
1
)
}
MB, `
+
`rss
${
(
stats
.
rss
/
1024
/
1024
).
toFixed
(
1
)
}
MB, `
+
`elapsed
${
elapsed
}
s`
);
}
const
total
=
((
Date
.
now
()
-
t0
)
/
1000
).
toFixed
(
2
);
const
final_stats
=
Ant
.
stats
();
console
.
log
(
`Done:
${
total
}
s, arena
${
(
final_stats
.
arenaUsed
/
1024
/
1024
).
toFixed
(
1
)
}
MB, `
+
`rss
${
(
final_stats
.
rss
/
1024
/
1024
).
toFixed
(
1
)
}
MB`
);
console
.
log
(
'OK'
);
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Thu, Mar 26, 4:44 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
511915
Default Alt Text
test_gc_stress10.js (2 KB)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment