Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
83
Issues
83
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
71d5da7b
Verified
Commit
71d5da7b
authored
Jan 05, 2021
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MemoryLeaks test: measure entire IWorld size, except share names
parent
54c6ce7a
Pipeline
#47852
passed with stages
in 9 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
Tests/MemoryLeaks.icl
Tests/MemoryLeaks.icl
+17
-10
No files found.
Tests/MemoryLeaks.icl
View file @
71d5da7b
...
...
@@ -19,10 +19,10 @@ repetitions =: 1000
tests
::
[
UnitTest
]
tests
=:
[
memoryConsumptionOf
"recursive step"
get
Shares
Size
,
memoryConsumptionOf
"local share"
(
withShared
3
\_
->
get
Shares
Size
)
,
memoryConsumptionOf
"parallel task"
(
viewInformation
[]
3
||-
get
Shares
Size
)
,
memoryConsumptionOf
"shared interaction task"
(
withShared
3
\
sds
->
viewSharedInformation
[]
sds
||-
get
Shares
Size
)
[
memoryConsumptionOf
"recursive step"
get
IWorld
Size
,
memoryConsumptionOf
"local share"
(
withShared
3
\_
->
get
IWorld
Size
)
,
memoryConsumptionOf
"parallel task"
(
viewInformation
[]
3
||-
get
IWorld
Size
)
,
memoryConsumptionOf
"shared interaction task"
(
withShared
3
\
sds
->
viewSharedInformation
[]
sds
||-
get
IWorld
Size
)
]
memoryConsumptionOf
::
!
String
!(
Task
Int
)
->
UnitTest
...
...
@@ -54,9 +54,16 @@ where
CustomFailReason
$
concat
[
"Memory consumption increased by "
,
toString
$
endSize
-
initSize
,
" bytes."
]
getSharesSize
::
Task
Int
getSharesSize
=
mkInstantTask
\_
iworld
=:{
memoryShares
}
->
(
Ok
('
Map
'.
foldrNoKey
((+)
o
nodeSize
)
0
memoryShares
),
iworld
)
where
nodeSize
::
!.
a
->
Int
nodeSize
x
=
size
(
copy_to_string
x
)
/* NB: We subtract the size of the names of shares. Because share names include
* TaskIds in string representation, and these IDs are incremented, including
* share names may cause the IWorld size to increase; we want to ignore these
* small changes.
*/
getIWorldSize
::
Task
Int
getIWorldSize
=
mkInstantTask
\_
iworld
=:{
memoryShares
}
#
iworldString
=
copy_to_string
iworld
#
(
iworldSize
,
iworldString
)
=
usize
iworldString
#
(
iworld
,_)
=
copy_from_string
iworldString
#
shareNamesSize
=
'
Map
'.
foldrWithKey`
(\
k
_
n
->
n
+
size
(
copy_to_string
k
))
0
memoryShares
// We cannot simply fold with `size k` due to padding in `copy_to_string`.
->
(
Ok
(
iworldSize
-
shareNamesSize
),
iworld
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment