-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory: user-space #13
Open
matthewzorin
wants to merge
8
commits into
Kernel-GL-HRK:Matvii.Zorin
Choose a base branch
from
matthewzorin:memory
base: Matvii.Zorin
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
43996d3
time management: homework
yekovalyov f4d7480
memory management: homework
yekovalyov 9cb9488
Merge pull request #1 from Kernel-GL-HRK/master
matthewzorin d96e6f8
memory: Create user-space program, which measures time of malloc and …
matthewzorin f4dea0f
memory: Add loop to allocate buffers
matthewzorin ccce55d
memory: Add 3 functions to provide memory allocate functions testing
matthewzorin 46da075
memory: Add stack memory control (low)
matthewzorin 56c414e
memory: Change log file name to avoid the conflict
matthewzorin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,103 @@ | ||
|
||
*--------------------------*malloc()*--------------------------* | ||
Power Buffer size (bytes) Allocation (ns) Freeing (ns) | ||
1 1 639 250 | ||
2 2 136 76 | ||
3 4 62 52 | ||
4 8 65 50 | ||
5 16 118 53 | ||
6 32 133 56 | ||
7 64 173 60 | ||
8 128 125 57 | ||
9 256 88 60 | ||
10 512 123 55 | ||
11 1024 161 55 | ||
12 2048 2814 503 | ||
13 4096 136 111 | ||
14 8192 2667 65 | ||
15 16384 2964 68 | ||
16 32768 2709 68 | ||
17 65536 2649 65 | ||
18 131072 7214 11243 | ||
19 262144 4328 3641 | ||
20 524288 3932 3511 | ||
21 1048576 3922 3563 | ||
22 2097152 6590 6440 | ||
23 4194304 6199 4696 | ||
24 8388608 5362 4700 | ||
25 16777216 5014 4485 | ||
26 33554432 5010 4580 | ||
27 67108864 4996 4713 | ||
28 134217728 4969 5114 | ||
29 268435456 4954 8277 | ||
30 536870912 4851 8161 | ||
31 1073741824 5969 12895 | ||
32 2147483648 5312 12504 | ||
33 4294967296 5297 12424 | ||
0 1 562 188 | ||
1 2 126 142 | ||
2 4 87 92 | ||
3 8 62 66 | ||
4 16 114 80 | ||
5 32 201 100 | ||
6 64 180 100 | ||
7 128 216 99 | ||
8 256 161 82 | ||
9 512 182 94 | ||
10 1024 257 98 | ||
11 2048 3071 427 | ||
12 4096 202 144 | ||
13 8192 2991 118 | ||
14 16384 2922 130 | ||
15 32768 2956 127 | ||
16 65536 3157 115 | ||
17 131072 7894 11804 | ||
18 262144 6035 5208 | ||
19 524288 4953 4626 | ||
20 1048576 4590 4788 | ||
21 2097152 7491 7109 | ||
22 4194304 7855 6362 | ||
23 8388608 6855 6457 | ||
24 16777216 7230 4132 | ||
25 33554432 4343 3841 | ||
26 67108864 4183 4081 | ||
27 134217728 4370 4466 | ||
28 268435456 4272 5380 | ||
29 536870912 6116 11445 | ||
30 1073741824 7452 17836 | ||
31 2147483648 8581 18082 | ||
32 4294967296 7534 17259 | ||
|
||
MEAN 3020 3413 | ||
MEAN 3551 4093 | ||
|
||
*--------------------------*calloc()*--------------------------* | ||
Power Buffer size (bytes) Allocation (ns) Freeing (ns) | ||
1 1 506 185 | ||
2 2 115 53 | ||
3 4 96 53 | ||
4 8 92 55 | ||
5 16 146 53 | ||
6 32 158 52 | ||
7 64 158 55 | ||
8 128 271 57 | ||
9 256 196 60 | ||
10 512 248 65 | ||
11 1024 225 73 | ||
12 2048 320 225 | ||
13 4096 411 100 | ||
14 8192 3250 73 | ||
15 16384 3569 85 | ||
16 32768 10327 146 | ||
17 65536 25198 160 | ||
18 131072 58739 163 | ||
19 262144 139834 236 | ||
20 524288 39028 190 | ||
21 1048576 346880 186 | ||
22 2097152 508630 300 | ||
23 4194304 1477771 6869 | ||
24 8388608 4135254 734 | ||
25 16777216 5359725 968 | ||
26 33554432 15250 13000 | ||
27 67108864 5334 4553 | ||
28 134217728 4238 4544 | ||
29 268435456 4176 5120 | ||
30 536870912 4059 6818 | ||
31 1073741824 5032 10706 | ||
32 2147483648 4465 10362 | ||
33 4294967296 4402 10506 | ||
0 1 473 163 | ||
1 2 200 115 | ||
2 4 164 105 | ||
3 8 122 80 | ||
4 16 170 78 | ||
5 32 172 87 | ||
6 64 200 100 | ||
7 128 385 70 | ||
8 256 248 82 | ||
9 512 317 102 | ||
10 1024 381 96 | ||
11 2048 343 341 | ||
12 4096 785 112 | ||
13 8192 4993 152 | ||
14 16384 3966 112 | ||
15 32768 11941 136 | ||
16 65536 26086 204 | ||
17 131072 69981 187 | ||
18 262144 150670 423 | ||
19 524288 53354 1525 | ||
20 1048576 866863 2804 | ||
21 2097152 899034 483 | ||
22 4194304 1189385 1004 | ||
23 8388608 2389343 839 | ||
24 16777216 5158120 1421 | ||
25 33554432 26193 17083 | ||
26 67108864 10045 9273 | ||
27 134217728 8189 10461 | ||
28 268435456 8123 9737 | ||
29 536870912 7246 12217 | ||
30 1073741824 9096 20275 | ||
31 2147483648 9524 19847 | ||
32 4294967296 8271 19839 | ||
|
||
MEAN 368427 2327 | ||
MEAN 330738 3925 | ||
|
||
*--------------------------*alloca()*--------------------------* | ||
Power Buffer size (bytes) Allocation (ns) | ||
0 1 108 | ||
1 2 115 | ||
2 4 92 | ||
3 8 80 | ||
4 16 103 | ||
5 32 85 | ||
6 64 90 | ||
7 128 96 | ||
8 256 98 | ||
9 512 95 | ||
10 1024 80 | ||
11 2048 95 | ||
12 4096 4182 | ||
13 8192 3719 | ||
14 16384 3736 | ||
15 32768 3407 | ||
16 65536 5579 | ||
17 131072 4074 | ||
18 262144 4447 | ||
19 524288 5853 | ||
20 1048576 4167 | ||
21 2097152 5172 | ||
|
||
MEAN 2066 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can You explain why allocation of 2^25 bytes faster than allocation of 2^24 bytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe in linux calloc function uses simple allocation and memset in cases, where we need lesser than the certain amount of bytes. So, in another cases it switches to the more efficient way for getting zero-initialized memory. For example - zeroed pages (2^24 bytes - 4096 pages, 1 page - 4096 bytes), but this method needs more time than I measured. I'd glad to receive Your opinion about this result