In terms of runtime performance, how expensive it is to cast int to short in Java? There may be thousands of such casting, hence I wonder if it would impact the performance or not. Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. It won’t impact performances. It is a single simple operation.
When you want to analize performances of a software you better focus on the computational cost of algorithmic operations based on the size of input.