🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.java
Article #154045

Re: Prędkość Java kontra C#

#154045
From: Borneq
Date: Tue, 15 Jul 2014 18:02
28 lines
1860 bytes
W dniu 2014-07-15 19:42, Borneq pisze:
> Znowu zaskoczenie, z tworzeniem obiektów C# radzi sobie nawet lepiej niż
> Java, ale gorzej ze zwykłą arytmetyką. Choć w moim algorytmie była
> jeszcze większa różnica na niekorzyść C#

Okazuje się że słabą stroną C# jest wołanie procedur
     public static boolean callinc(int x, int y)
     {
         for (int i = 0; i < 100; i++)
         {
             x = inc(y);
             y = inc(x);
         }
         return x > y;
     }

     public static int inc(int x)
     {
         return x+1;
     }
Java:
time=95,6
C# Studio:time=2640
Xamarin z NET:time=1578
Xamarin z Mono:time=1581 (dwa takie same, czyżby zawsze było Mono?)

Widać kolosalną różnicę, czyżby Java inliniowało funkcje? Natomiast C# 
ma pewnie jakiś narzut w wykonaniu
Technical Details
Message-ID: <lq3qb3$jl6$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <lpv1t6$363$1@node2.news.atman.pl> <lpv236$363$2@node2.news.atman.pl> <lq002d$3i7$1@news.dialog.net.pl> <lq01a6$u1c$1@node2.news.atman.pl> <lq3p5v$iff$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.lang.java
Subject: Re: Prędkość Java kontra C#
Date: Tue, 15 Jul 2014 20:02:00 +0200
Organization: ATMAN - ATM S.A.
Lines: 28
Message-ID: <lq3qb3$jl6$1@node2.news.atman.pl>
References: <lpv1t6$363$1@node2.news.atman.pl> <lpv236$363$2@node2.news.atman.pl> <lq002d$3i7$1@news.dialog.net.pl> <lq01a6$u1c$1@node2.news.atman.pl> <lq3p5v$iff$1@node2.news.atman.pl>
NNTP-Posting-Host: 91.239.205.62
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1405447331 20134 91.239.205.62 (15 Jul 2014 18:02:11 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Tue, 15 Jul 2014 18:02:11 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To: <lq3p5v$iff$1@node2.news.atman.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit