Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why peers are heavyw./slow if they are native/optimized&already in memory?  RSS feed

 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read hundreds times that AWT is awkward, slow because they are using native peers. But I always thought that perforamnce in Java by definition is worse because it runs thru JVM, interplatform, secure, etc. and apparently shd be anyway slower while native classes are optimized for specific OS, profile, code, not overburdened with interplatform compatibility and other globalistic issues. Then what does it means OS is big (and therefore makes AWT components heavy)? it is anyway already in memory
I also remember that it is advised to those who does not need platform compatibility it is possible to use native code for boosting performance.
So what I am missing here?
[This message has been edited by G Vanin (edited November 19, 2001).]
 
Suresh Bansal
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While in awt, we have to create a OS specific peer which takes up extra memory, while in swing we have light weight peer which run inside jvm itself.
So for a gui in swing will have very few processes running as most of the components will have there implementation running inside the single jvm while the same code in awt will have many processes running.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!