做控制台应用程序运行速度比GUI应用快? [英] Do console apps run faster than GUI apps?

查看:115
本文介绍了做控制台应用程序运行速度比GUI应用快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是比较新的编程世界。我有几个的性能问题:


  1. 执行控制台应用程序的运行速度比用的应用程序图形用户界面更快?


  2. 是像C和Pascal语言的速度比像C ++和Delphi面向对象的语言?我知道语言的速度取决于不是语言本身更多的编译器,但对程序语言的编译器产生更快的code比OO的人(包括可产生C code C ++编译器)?



解决方案

  

做的控制台应用程序的运行速度比基于Windows的应用程序更快


简短的回答:

长一点的回答:

在一个控制台基于应用,就没有GUI线程需要重画的窗口和接受用户输入,所以在这个意义上,一个控制台应用程序可以是稍快(因为它有一个较少的螺纹窃取远CPU周期)。然而,由于现代操作系统同时运行多个进程,反正控制台应用程序将仍然争夺系统中的其它进程的CPU,所以没有


  

是语言,如C,比像C ++和delphi的面向对象的语言PASCAL更快?


简短的回答:

长一点的回答:

在C和C ++

等同方案执行大致相同。虽然编程语言肯定能在性能上发挥作用,通常你需要担心的主要事情是算法(你是什么样的前pressing与应用程序的逻辑),而不是语言的算法是codeD起来

I am relatively new to world of programming. I have a few performance questions:

  1. Do console apps run faster than apps with a graphical user interface?

  2. Are languages like C and Pascal faster than object oriented languages like C++ and Delphi? I know language speed depends more on compiler than on language itself, but do compilers for procedural languages produce faster code than OO ones (including C++ compilers that can produce C code)?

解决方案

do console apps run faster than windows based app

Short answer: No
Long answer:

In a console based application, there is no GUI thread that needs to repaint the windows and accept user input, so in that sense, a console application may be slightly faster (since it has one fewer thread stealing away CPU cycles). However, since modern operating systems run multiple processes concurrently, anyway, a console application would still be contending for the CPU with other processes in the system, so no.

are languages like c and pascal faster than object oriented languages like c++ and delphi?

Short answer: No
Long answer:

Equivalent programs in C and C++ perform roughly the same. Although programming languages certainly can play a role in performance, generally the main thing you need to worry about is the algorithm (what you are expressing with your application's logic) and not the language the algorithm is coded up in.

这篇关于做控制台应用程序运行速度比GUI应用快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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