[Issue 6498] [CTFE] copy-on-write is slow and causes huge memory usage

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 10 11:45:45 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=6498

--- Comment #7 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Metrics of the code in this report ran by v2.080:
---
Command being timed: "./generated/linux/release/64/dmd issue6498.d -c"
User time (seconds): 6.44
System time (seconds): 0.29
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:06.75 
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 1104116 
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 274715
Voluntary context switches: 1
Involuntary context switches: 256
Swaps: 0
File system inputs: 246
File system outputs: 6
Socket messages sent: 0 
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
---

As of v2.085.0 - when most of dinterpret had been converted over to returning
UnionExp on the stack.
---
Command being timed: "./generated/linux/release/64/dmd issue6498.d -c"
User time (seconds): 6.64
System time (seconds): 0.19
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:06.84
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 636044
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1
Minor (reclaiming a frame) page faults: 157878
Voluntary context switches: 1
Involuntary context switches: 231
Swaps: 0
File system inputs: 386
File system outputs: 6
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
---

As of v2.089.0 - when a ctfeRegion allocator was introduced to free memory
after exiting an interpret "scope".
---
Command being timed: "./generated/linux/release/64/dmd issue6498.d -c"
User time (seconds): 6.88
System time (seconds): 0.14
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.03
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 637204
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 158019
Voluntary context switches: 1
Involuntary context switches: 17
Swaps: 0
File system inputs: 474
File system outputs: 6
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
---

As of v2.100.0
---
Command being timed: "./generated/linux/release/64/dmd issue6498.d -c"
User time (seconds): 7.13
System time (seconds): 0.07
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.22
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 482504
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 119238
Voluntary context switches: 1
Involuntary context switches: 223
Swaps: 0
File system inputs: 833
File system outputs: 6
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
---


With -lowmem.
---
Command being timed: "./generated/linux/release/64/dmd issue6498.d -c -lowmem"
User time (seconds): 7.64
System time (seconds): 0.05
Percent of CPU this job got: 103%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.42
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 28760
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1
Minor (reclaiming a frame) page faults: 5679
Voluntary context switches: 2376
Involuntary context switches: 774
Swaps: 0
File system inputs: 833
File system outputs: 6
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
---

--


More information about the Digitalmars-d-bugs mailing list