哪个更好,更少的编码行或更多的代码行? [英] which is better, less coding lines or more lines of code ?

查看:80
本文介绍了哪个更好,更少的编码行或更多的代码行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,

我在上一天的采访中提出的一个问题,即提供更好的性能。

1.代码行数越少或代码行越多。

2.如果您已分配到应用程序进行性能测试,如何提高应用程序的性能。





我无法通过我的答案满足面试官的要求。



所以请告诉我如何提高应用程序性能的一些想法

和更少的代码是更好或更多的代码行。







先谢谢。 。



问候,

Kumar Aryan。

Hello Everyone,
A question asked in my last day interview that which gives the better performance.
1. The less lines of code or the more lines of code.
2. How to improve the performance of application if you have assigned to an application for performance testing.


I was not able to satisfy the interviewer by my answers.

So please suggest me some ideas how to improve the performance of an application
and less code is better or more lines of code.



Thanks in Advance..

Regards,
Kumar Aryan.

推荐答案

不是一个规则,但最好的性能语言(如C / C ++)通常更冗长。

这是有道理的:为了从硬件中获得最佳性能,你需要更多的控制,所以你将要去细节深处。

你当然可以我总是选择在高性能代码和优雅代码之间做出良好的权衡,因为:你编写的代码行更多,你需要维护更多的东西: - )
It is not a rule, but best performant languages (like C/C++) are usually more verbose.
That's makes sense: in order the get the best performance from the hardware you need more control so you are going to go deep in details.
Of course you should always choose a good tradeoff between performant and elegant code, because: "more lines of code you write, more mess you have to maintain" :-)






性能:

它不取决于代码行,但它取决于变量的使用及其生命周期范围,如果你将批处理过程分成不同的功能,然后它将提高您的性能。



Web和桌面应用程序的方法不同。



性能在设计时取决于需求和环境,如果你找不到适当的技术来定位环境,那么这将是一个完全混乱,现在你需要了解并优先处理你的过程以获得更好的性能。



你能做什么?

1.并行处理

2.缓存

等...



这是一个很好的链接,它可以让你对应用程序性能的提升有所了解: http://msdn.microsoft.com/en-in/library/ff647813.aspx [ ^ ]



更好地利用您的资源将获得最佳性能。
Hi,

Performance :
Its not depends on lines of code, but it depends on use of variables and their lifetime scope, if you split your batch process in different function then it will boost your performance.

Approach would be different for Web and desktop application.

Performance is depends on requirement and environment in the time of designing if you could not find proper technology to target environment then it would be a total mess, now you need to understand and prioritize your process to get better performance.

What you can do ?
1. Parallel Processing
2. Caching
etc...

Here is good link which will provide you a good idea about application performance boosting : http://msdn.microsoft.com/en-in/library/ff647813.aspx[^]

Better utilize your resource will give best performance.


据我所知,性能不是依赖性ds编码行数,但是您在应用程序生命周期中如何执行操作和资源数量,以及在不使用时释放它们。



第二件事我想告诉你,可以通过可用的性能测量工具分析应用程序来完成性能提升,然后对应用程序代码进行适当的更改以满足要求。



如果您遵循上述因素,那么它将自动最小化代码行,这样您就可以说更好的代码将不依赖于代码行但它完全是取决于您如何以最佳的技术使用方式进行操作。
As far as my knowledge is concern, performance is not depends on number of coding lines but how you performing operation and number of resources you are using during your application lifetime and releasing them when they are not in use.

Second thing i want to tell you that performance increase can be done through analysis of application through performance measurement tools available and then make appropriate changes to your application code to meet the requirement.

If you follow above factor then it will automatically minmize the line of code so you can say that better code will have no dependency on line of code but it totally depends on how you are carried out your operation with best usages of technology.


这篇关于哪个更好,更少的编码行或更多的代码行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆