VBScript性能问题 [英] VBScript performance issue

查看:57
本文介绍了VBScript性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我继承了一个每1分钟运行一次的VBScript,它会导致100%的CPU使用率.我无法修改代码,因为它是生产服务器,并且没有测试环境.因此,在提出更改之前,我想征求您的意见.

基本上,该脚本循环遍历源文件夹中的所有文件(大约7000个文件),并检查文件名,如果脚本以"D__"开头,它将把文件复制到目标文件夹.我注意到脚本正在运行:mid(ucase()),我认为更好,就像ucase(mid))或什至left()="D__"或left()="d__"一样,以避免字符串操作.

它还会检查文件是否存在于目标位置中,因为在copyfile()中将覆盖标志设置为false,这是没有用的.

如果进行这些更改,会不会有任何效果?例如,如果我用C#编写一个小型应用程序,它将运行得更快还是不是VBScript的限制?

谢谢

Hi,

I''ve inherited a VBScript that runs every 1 minute and causes 100% CPU usage. I can''t modify the code as it''s a production server and there is no testing environment. So I''d like to have your opinion before I propose the change.

Basically the script loops through all files in the source folder (around 7000 files)checking file names and if it starts with "D__" it will copy the file to destination folder. I notice the script runs: mid(ucase()) which is better, I think, as ucase(mid)) or even left()="D__" or left()="d__" to avoid string manipulation.

It also checks if the file exists in the destination which is no use since the overwrite flag is set to false in copyfile().

If I make these changes, will there be any performance? and if I write a small app in C# for example, will it run faster or it isn''t VBScript limitation?

Thanks

推荐答案

0)我们不知道,因为我们不熟悉您的硬件配置或作为编码器的能力.

1)试试看.

顺便说一句,如果它在生产服务器上,我会怀疑他们是否会让您部署未经验证的应用程序来处理似乎很关键的任务.
0) We don''t know because we aren''t familiar with your hardware configuiration or abilities as a coder.

1) Try it and see.

By the way, if it''s on a production server, I doubt if they''ll let you deploy an unproven application ton it to handle what appears to be a critical task.


听起来像是最肮脏的解决方案.摆脱它,直到还不算太晚.查看正在执行的脚本并决定要执行的操作.整个事情看起来并不合理.任何不是由真实事件驱动的定期任务都不应使用.

—SA
It sounds like a most dirty solution. Get rid of it until it''s not too late. Look at what script is doing and decide what to do. Whole thing does not look reasonable. Any periodic task not driven by real events should not be used.

—SA


通过搜索google或任何搜索引擎网站.
By searching google or any search engine site.


这篇关于VBScript性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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