Skip to content
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

Add semaphore speed test #240

Closed
skliper opened this issue Sep 30, 2019 · 10 comments
Closed

Add semaphore speed test #240

skliper opened this issue Sep 30, 2019 · 10 comments
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Sep 30, 2019

During discussions of the NG architecture, a recurring concern was regarding the additional function calls and possible increase in overhead related to this.

Rather than act on assumptions, it is better to actually benchmark the code in question to determine if optimizations are necessary, and if so, where those optimizations should be done.

@skliper skliper added this to the osal-5.0.0 milestone Sep 30, 2019
@skliper skliper self-assigned this Sep 30, 2019
@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Imported from trac issue 217. Created by jphickey on 2019-05-29T14:27:29, last modified: 2019-07-26T15:13:27

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2019-05-29 14:47:50:

Ready for CCB review: commit [changeset:afd25dc] branch trac-217-sem-speed-test

The impetus of this was just to see if the "posix-ng" implementation was substantially worse than the original "posix" implementation due to its additional error checking and function calls.

As it turns out, the NG is substantially faster, because it does not need to change signal masks. In the original POSIX, most of the actual time in the semaphore give/take call is in the "rt_sigprocmask" system call, related to changing the signal mask. The posix-ng implementation does not need to do this, because it manages signals differently. Therefore NG is about 60-70% faster.

The information gleaned from this exercise was valuable, in particular the ability to run this in conjunction with profiling tools to determine areas for optimization. Instead of keeping this as a one time test, it is probably a good idea to include this as an additional test within the OSAL.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jhageman on 2019-05-30 11:54:30:

Note traced using strace, either -c -p on child tasks or with -f. NG is entirely using the "futex" syscall, whereas old posix is about 40% futex and 60% rt_sigprocmask.

Tagged for CCB review.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jhageman on 2019-06-05 12:46:08:

CCB 6/5/19 - code reviewed and approved, recommend addition of license and copyright info in comment block

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jhageman on 2019-06-13 08:58:04:

Recommended comment block (lifted from osapi-time.c):

{{{
/*

  •  Copyright (c) 2018, United States government as represented by the
    
  •  administrator of the National Aeronautics Space Administration.
    
  •  All rights reserved. This software was created at NASA Glenn
    
  •  Research Center pursuant to government contracts.
    
  •  This is governed by the NASA Open Source Agreement and may be used,
    
  •  distributed and modified only according to the terms of that agreement.
    

*/
}}}

Exact duplication simplifies release updates.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jhageman on 2019-07-03 13:39:20:

Moved 4.2.2 tickets planned to close to 4.3.0

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2019-07-08 22:24:46:

Merged into ic-2019-07-08 (along with header change as requested)

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jhageman on 2019-07-10 13:23:34:

CCB 07/10/2019 - Approved for merge to dev

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2019-07-11 11:40:01:

Merged to development branch

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jhageman on 2019-07-26 15:13:27:

Milestone renamed

@skliper skliper closed this as completed Sep 30, 2019
@skliper skliper modified the milestones: osal-5.0.0, 5.0.0 Sep 30, 2019
@skliper skliper removed their assignment Sep 30, 2019
jphickey added a commit to jphickey/osal that referenced this issue Aug 10, 2022
Manually merged to resolve conflicts.

From branch jphickey/fix-263-msgid-api:

Fix nasa#245, Consistent use of MsgId type
Fix nasa#263, Expose CFE_SB_IsValidMsgId() API

From branch dmknutsen/issue_240:

Fixes nasa#240, removes MESSAGE_FORMAT_IS_CCSDS ifdefs from code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant