Hardware acceleration in VS 11

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Steve Maughan
Posts: 1221
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Hardware acceleration in VS 11

Post by Steve Maughan »

Does this have any relevancy for computer chess?

http://betanews.com/2012/02/03/microsof ... +Feed+-+BN

Steve
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: Hardware acceleration in VS 11

Post by Aleks Peshkov »

I hate Microsoft for Babylonian chaos in programmer's technologies for years.
User avatar
towforce
Posts: 11588
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Hardware acceleration in VS 11

Post by towforce »

At first glance, it looks as though it could result in hardware specific code.

More sensible would be to provide a VM which manages parallel processing efficiently, and code for that.

In the USA, there is now an Android tablet computer available for $99 which has a multi-touch capacitative display. On Amazon, buyers have complained that many Android apps won't run on it because it doesn't use the ARM CPU that most Android devices use. I wondered why this would be a problem - and when I investigated, I found that many apps use the Android equivalent of JNI (Java Native Interface) to run code directly on the processor.

If these developers had just stuck to using Java, the problem wouldn't exist - SO WHY ON EARTH DO THEY DO IT???
Writing is the antidote to confusion.
It's not "how smart you are", it's "how are you smart".
Your brain doesn't work the way you want, so train it!
rbarreira
Posts: 900
Joined: Tue Apr 27, 2010 3:48 pm

Re: Hardware acceleration in VS 11

Post by rbarreira »

towforce wrote: If these developers had just stuck to using Java, the problem wouldn't exist - SO WHY ON EARTH DO THEY DO IT???
I'm guessing it's this "pesky" thing called performance and the goal of having low power usage...
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: Hardware acceleration in VS 11

Post by Ron Murawski »

towforce wrote:... I found that many apps use the Android equivalent of JNI (Java Native Interface) to run code directly on the processor.

If these developers had just stuck to using Java, the problem wouldn't exist - SO WHY ON EARTH DO THEY DO IT???
Besides the performance issue, developers often want to protect their code. Any code that runs on the jvm can be reverse-engineered into Java source. Take a look at JD-Core, Cavaj Java Decompiler, and all the other Java decompilers. You won't get a perfect Java translation, but you generally get working Java code.
User avatar
towforce
Posts: 11588
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: Hardware acceleration in VS 11

Post by towforce »

Ron Murawski wrote:Besides the performance issue, developers often want to protect their code. Any code that runs on the jvm can be reverse-engineered into Java source. Take a look at JD-Core, Cavaj Java Decompiler, and all the other Java decompilers. You won't get a perfect Java translation, but you generally get working Java code.
These are good points - but if processor choices proliferate, then your code becomes the "high maintenance" one that has to be kept up to date for an ever increasing number of devices.

IMO most programmers would be better of sticking to pure Java. With newer phones/tablets and newer versions of Android (especially V4), the difference in performance won't be worth the extra work for most applications.
Writing is the antidote to confusion.
It's not "how smart you are", it's "how are you smart".
Your brain doesn't work the way you want, so train it!
abulmo
Posts: 151
Joined: Thu Nov 12, 2009 6:31 pm

Re: Hardware acceleration in VS 11

Post by abulmo »

Ron Murawski wrote: Besides the performance issue, developers often want to protect their code. Any code that runs on the jvm can be reverse-engineered into Java source. Take a look at JD-Core, Cavaj Java Decompiler, and all the other Java decompilers. You won't get a perfect Java translation, but you generally get working Java code.
Two remarks :
- Android applications do not use the jvm, but Dalvik. So instead of Cavaj, you have to use kivlad to reverse-engineered the code.
- Any code can be reverse-engineered, so I do not see the point of not using java here.
Richard
User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Hardware acceleration in VS 11

Post by jshriver »

towforce wrote:At first glance, it looks as though it could result in hardware specific code.
Isn't that what PGO is for? Will gladly stand corrected as I'm not entirely sure.
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: Hardware acceleration in VS 11

Post by Ron Murawski »

abulmo wrote:
Ron Murawski wrote: Besides the performance issue, developers often want to protect their code. Any code that runs on the jvm can be reverse-engineered into Java source. Take a look at JD-Core, Cavaj Java Decompiler, and all the other Java decompilers. You won't get a perfect Java translation, but you generally get working Java code.
Two remarks :
- Android applications do not use the jvm, but Dalvik. So instead of Cavaj, you have to use kivlad to reverse-engineered the code.
Good point.
abulmo wrote:- Any code can be reverse-engineered, so I do not see the point of not using java here.
I was not advocating the use of native code rather than Java, I was just trying to answer Paul Gift's question of *why* a developer would choose to use native code rather than Java.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Hardware acceleration in VS 11

Post by lucasart »

towforce wrote:If these developers had just stuck to using Java, the problem wouldn't exist - SO WHY ON EARTH DO THEY DO IT???
Perhaps because Java is a piece of crap...

The best way to achieve both efficiency and portability is C.