如何向老板解释代码/资源优化很重要? [英] How to explain at your boss that code/resources optimization is important?

查看:112
本文介绍了如何向老板解释代码/资源优化很重要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

啊,每次都很沮丧.

我们在托管公司中有专用的服务器,每次我不得不写下一个新应用程序(或添加到先前存在的应用程序中)时,我都会花很多时间来优化许多行为的代码(减少数据库查询,优化数据库结构,减少带宽等).取决于应用程序应该执行的操作.

We have a dedicated server in our hosting company, and everytime i have to write down a new app (or an add to an pre-existing app), i use to 'lose' some time to optimize the code for many behaviors (reducing the db query, optimizing the db structure, reducing the bandwith, etc..) depending on what the app is supposed to do.

很明显,关键不是我编写错误的代码然后重新构建它,而仅仅是在项目完成之后,我总是找到可以做得更好的事情.

Obviously, is the point is not that i write bad code and then rebuild it, its just that after the project is complete, i allways find somethings that could be done better.

每一次,如果我的老板抓住我这样做,他就会说:您在浪费时间!如果应用程序需要更多资源,我们会购买更多RAM,更多CPU或更多带宽!".

And everytime, if my boss catch me doing this, he say 'Your wasting your time! if the application need more resources, we buy more RAM, more CPU, or more bandwith!'.

什么是最好的(也是最简单的)方式来说明优化仍然很重要,而这不是那么容易或无法自动升级(生产!)服务器的硬件?

What is the best (and simplyest) way to explain he that optimization is still important, and that is not so easy or automagically upgrating the hardware of an (production!) server?

编辑:我不是在谈论数据库优化,而是应用程序的各个方面

EDIT: im not talking just about database optimization, but every aspect of an application

推荐答案

下次您移动/升级服务器时,请保留详细的说明和时间表,并记录由此产生的每分钟工作量(包括几周内的工作情况)后).然后,您将有确凿的证据表明升级成本很高,而优化有助于延迟投资.

Keep detailed notes and time sheets the next time you make a server move/upgrade, and protocol every minute of work that arose from it (including things in the weeks after). Then you'll have hard evidence that upgrading is expensive, and optimizations help delay the investment.

在当前情况下,您可以按照以下基准对基准和统计信息执行某些操作:如果没有我的优化,服务器将达到90%的容量,用户数量为X.通过我的优化,我们可以满足是我们的用户,在我们不得不购买一台新机器之前."

In the current situation, you might be able to do something with benchmarks and statistics along the line of "without my optimization, the server will be at 90% capacity with X number of users. With my optimization, we can cater for Y users more, before we have to get a new machine."

另一方面,优化和过度优化之间的界限很窄.虽然编写不浪费资源的代码是一种精湛的工艺,应该是一项人权,但如今,RAM和磁盘空间非常便宜.优化还倾向于使代码更加复杂,而其他代码则难以维护.当您控制自己的硬件时,代码优化可能不一定总是首要目标.

On the other hand, the line between optimization and over-optimization is thin. While writing code that doesn't waste resources is good craftsmanship and should be a human right, RAM and disk space are awfully cheap these days. Optimizations also tend to make code more complicated, and harder to maintain for others. When you control your own hardware, code optimization may not always be the top goal.

这篇关于如何向老板解释代码/资源优化很重要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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