Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8516
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| From | Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> |
| Subject | Re: slow as molasses |
| References | <e160619b-d172-4986-8e05-880d27473c5f@k15g2000yqd.googlegroups.com> |
| Reply-To | avl@logic.at |
| User-Agent | slrn/pre0.9.9-111 (Linux) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| Message-ID | <slrnj8lrea.6gl.avl@gamma.logic.tuwien.ac.at> (permalink) |
| Date | 04 Oct 2011 11:28:10 GMT |
| Lines | 25 |
| NNTP-Posting-Host | gamma.logic.tuwien.ac.at |
| X-Trace | 1317727690 tunews.univie.ac.at 11354 128.130.175.3 |
| X-Complaints-To | abuse@tuwien.ac.at |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8516 |
Show key headers only | View raw
bob <bob@coolgroups.com> wrote:
> So, I wrote some code, but it is slow as molasses. Any easy ways to
> speed this up?
> float[] getVertices(String filename) {
> try {
> AssetManager am = this.getResources().getAssets();
> InputStream is = am.open(filename);
Just speculating:
Involving some of the Buffered* stream-wrappers here might help big time.
> Scanner s = new Scanner(is);
> long numfloats = s.nextLong();
> float[] f = new float[(int) numfloats];
> for (int ctr = 0; ctr < f.length; ctr++) {
> f[ctr] = s.nextFloat();
> }
> return f;
>
> } catch (IOException e) {
> e.printStackTrace();
> return null;
> }
>
> }
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
slow as molasses bob <bob@coolgroups.com> - 2011-10-04 02:16 -0700
Re: slow as molasses Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-10-04 11:28 +0000
Re: slow as molasses Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-04 07:47 -0700
Re: slow as molasses Patricia Shanahan <pats@acm.org> - 2011-10-04 08:42 -0700
Re: slow as molasses "John B. Matthews" <nospam@nospam.invalid> - 2011-10-04 13:30 -0400
Re: slow as molasses bob <bob@coolgroups.com> - 2011-10-04 14:19 -0700
csiph-web