Article View: comp.lang.java
Article #541Re: Advanced question need help
From: Marshall Spight
Date: Tue, 09 Oct 2001 16:14
Date: Tue, 09 Oct 2001 16:14
26 lines
2519 bytes
2519 bytes
"jochem" <jmelis@cs.uct.ac.za> wrote in message news:9psqh3$33k$1@news.adamastor.ac.za... > Hi There, > > I am trying to find out the relative costs of bitshifting vs casting in java > (on primitive types). > Can anyone give me any suggestions? if you can give me just the cost of > cast that would be brilliant I wrote an appalingly extensive article on the cost of casting. It comes down to roughly 4-9 clock cycles, depending on the situation, and zero in some cases. I had it up on my website. If some non-bankrupt ISP ever decides to offer the capability of hosting a website in my neighborhood, it'll be up again. I'd imagine bitshifting was similarly cheap, or maybe even cheaper, but this is pure speculation. My advice? Write whichever way is cleaner and easier to code; the difference in efficiency will not matter under any circumstances that are likely to occur. Marshall
Technical Details
Message-ID:
<3oFw7.19592$IY3.13456043@news1.rdc1.sfba.home.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mailReferences:
<9psqh3$33k$1@news.adamastor.ac.za>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fe48c,1c3cb8145935e364 X-Google-Attributes: gidfe48c,public X-Google-Thread: 113ae9,1c3cb8145935e364 X-Google-Attributes: gid113ae9,public X-Google-Thread: f5d71,1c3cb8145935e364 X-Google-Attributes: gidf5d71,public X-Google-Thread: f74b3,1c3cb8145935e364 X-Google-Attributes: gidf74b3,public X-Google-Thread: 10a146,1c3cb8145935e364 X-Google-Attributes: gid10a146,public X-Google-Thread: 10bb9b,1c3cb8145935e364 X-Google-Attributes: gid10bb9b,public X-Google-ArrivalTime: 2001-10-09 09:14:56 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: "Marshall Spight" <mspight@dnai.com> Newsgroups: comp.lang.java,comp.lang.java.help,borland.public.jbuilder.java.language,comp.lang.java.machine,comp.lang.java.programmer,microsoft.public.java.vm References: <9psqh3$33k$1@news.adamastor.ac.za> Subject: Re: Advanced question need help Lines: 29 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <3oFw7.19592$IY3.13456043@news1.rdc1.sfba.home.com> Date: Tue, 09 Oct 2001 16:14:55 GMT NNTP-Posting-Host: 24.250.153.52 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 1002644095 24.250.153.52 (Tue, 09 Oct 2001 09:14:55 PDT) NNTP-Posting-Date: Tue, 09 Oct 2001 09:14:55 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster