[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Firefox:
245 ms map(parseFloat)(JSON.parse([str,str,str...]))
191 ms map(parseFloat)(JSON.parse([str,str,str...]))
191 ms map(parseFloat)(JSON.parse([str,str,str...]))
188 ms map(parseFloat)(JSON.parse([str,str,str...]))
253 ms map(parseFloat)(JSON.parse([str,str,str...]))
268 ms map(parseFloat)(JSON.parse([str,str,str...]))
189 ms map(parseFloat)(JSON.parse([str,str,str...]))
188 ms map(parseFloat)(JSON.parse([str,str,str...]))
189 ms map(parseFloat)(JSON.parse([str,str,str...]))
164 ms parseFloat(JSON.parse([str,str,str...]))
237 ms parseFloat(JSON.parse([str,str,str...]))
238 ms parseFloat(JSON.parse([str,str,str...]))
159 ms parseFloat(JSON.parse([str,str,str...]))
158 ms parseFloat(JSON.parse([str,str,str...]))
152 ms parseFloat(JSON.parse([str,str,str...]))
159 ms parseFloat(JSON.parse([str,str,str...]))
251 ms parseFloat(JSON.parse([str,str,str...]))
196 ms parseFloat(JSON.parse([str,str,str...]))
182 ms JSON.parse([num,num,num,num])
136 ms JSON.parse([num,num,num,num])
134 ms JSON.parse([num,num,num,num])
132 ms JSON.parse([num,num,num,num])
134 ms JSON.parse([num,num,num,num])
133 ms JSON.parse([num,num,num,num])
130 ms JSON.parse([num,num,num,num])
135 ms JSON.parse([num,num,num,num])
136 ms JSON.parse([num,num,num,num])
Chrome: about half speed of Firefox (in my experience this means it is not utilizing multiple processors); factor of 1.5? difference parseFloat/strings or nums; half speed with map/let/strings
641 ms map(parseFloat)(JSON.parse([str,str,str...]))
588 ms map(parseFloat)(JSON.parse([str,str,str...]))
471 ms map(parseFloat)(JSON.parse([str,str,str...]))
470 ms map(parseFloat)(JSON.parse([str,str,str...]))
511 ms map(parseFloat)(JSON.parse([str,str,str...]))
723 ms map(parseFloat)(JSON.parse([str,str,str...]))
473 ms map(parseFloat)(JSON.parse([str,str,str...]))
485 ms map(parseFloat)(JSON.parse([str,str,str...]))
467 ms map(parseFloat)(JSON.parse([str,str,str...]))
242 ms parseFloat(JSON.parse([str,str,str...]))
398 ms parseFloat(JSON.parse([str,str,str...]))
298 ms parseFloat(JSON.parse([str,str,str...]))
326 ms parseFloat(JSON.parse([str,str,str...]))
320 ms parseFloat(JSON.parse([str,str,str...]))
302 ms parseFloat(JSON.parse([str,str,str...]))
302 ms parseFloat(JSON.parse([str,str,str...]))
673 ms parseFloat(JSON.parse([str,str,str...]))
292 ms parseFloat(JSON.parse([str,str,str...]))
263 ms JSON.parse([num,num,num,num])
247 ms JSON.parse([num,num,num,num])
244 ms JSON.parse([num,num,num,num])
247 ms JSON.parse([num,num,num,num])
244 ms JSON.parse([num,num,num,num])
254 ms JSON.parse([num,num,num,num])
247 ms JSON.parse([num,num,num,num])
245 ms JSON.parse([num,num,num,num])
251 ms JSON.parse([num,num,num,num])
Edge: no difference parseFloat/strings or nums; half speed with map/let/strings
392 ms map(parseFloat)(JSON.parse([str,str,str...]))
279 ms map(parseFloat)(JSON.parse([str,str,str...]))
312 ms map(parseFloat)(JSON.parse([str,str,str...]))
345 ms map(parseFloat)(JSON.parse([str,str,str...]))
329 ms map(parseFloat)(JSON.parse([str,str,str...]))
305 ms map(parseFloat)(JSON.parse([str,str,str...]))
274 ms map(parseFloat)(JSON.parse([str,str,str...]))
320 ms map(parseFloat)(JSON.parse([str,str,str...]))
315 ms map(parseFloat)(JSON.parse([str,str,str...]))
154 ms parseFloat(JSON.parse([str,str,str...]))
171 ms parseFloat(JSON.parse([str,str,str...]))
195 ms parseFloat(JSON.parse([str,str,str...]))
167 ms parseFloat(JSON.parse([str,str,str...]))
189 ms parseFloat(JSON.parse([str,str,str...]))
191 ms parseFloat(JSON.parse([str,str,str...]))
176 ms parseFloat(JSON.parse([str,str,str...]))
189 ms parseFloat(JSON.parse([str,str,str...]))
154 ms parseFloat(JSON.parse([str,str,str...]))
221 ms JSON.parse([num,num,num,num])
155 ms JSON.parse([num,num,num,num])
151 ms JSON.parse([num,num,num,num])
222 ms JSON.parse([num,num,num,num])
153 ms JSON.parse([num,num,num,num])
175 ms JSON.parse([num,num,num,num])
194 ms JSON.parse([num,num,num,num])
184 ms JSON.parse([num,num,num,num])
150 ms JSON.parse([num,num,num,num])
--
Reply to: [list | sender only]
Re: CIF-JSON new draft
- Subject: Re: CIF-JSON new draft
- From: Robert Hanson <hansonr@xxxxxxxxxx>
- Date: Tue, 2 May 2017 08:10:46 -0500
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stolaf.edu; s=stolaf;h=mime-version:in-reply-to:references:from:date:message-id:subject:to;bh=zQWygXcNUZg9LtnSUMwNNF6+UdR7UCJSOswrUpCHLVY=;b=zHxH4d801stjQmOF3wt3oKtkOdt1ybYhsSYmQLOeLaebT7RYu3QtjzO2OUhO89UsvLXu3mTM9T2c7i62jwvIs71nJfI0XqYH/p3GRDT5llyU0HmennAsnG5oSrzGOhZ+V4hbEyc0aankZDEi5nRDCd14MnDGDhBYl1VyRCjNlQU=
- In-Reply-To: <CACaHzQWP3wnYfHskVT-XXFmf7=d35G7BFKyU_bMT_zinD1-hLQ@mail.gmail.com>
- References: <CAM+dB2ey9kKLoZY=WE7Uy-fiWTGhQaFx7fcgODcYfhrNPwXkQw@mail.gmail.com><CACaHzQU-NPvorqZzARhnsTLaAU_tqpp9v56fJss9C9NG--ps0A@mail.gmail.com><MWHPR04MB051226521AF5A8F60AA4BC67E0140@MWHPR04MB0512.namprd04.prod.outlook.com><CACaHzQV8yQFetF-oLv6nhn6VtAjfkYUsNrgwjfCZoDo10Drh=w@mail.gmail.com><CAF_YUvUEOaCiPpoZ8d96HpxScgiJsGBQAO2RA7jVMFBUmWEU_w@mail.gmail.com><CACaHzQXZLL77jBMdKhfJHXg8JkxUkwH29MGKyGsYfdfK_2BABA@mail.gmail.com><CAF_YUvUeKG-WSf+yZuNtVUdDBd7Yn=_PnJOKYuzOJACff6V1SA@mail.gmail.com><CAM+dB2c-h9ZHMWiPhdfb4Hym4ynSVmS3_8B4QA777N_N9f4NDg@mail.gmail.com><CACaHzQWP3wnYfHskVT-XXFmf7=d35G7BFKyU_bMT_zinD1-hLQ@mail.gmail.com>
Marcin, that was Firefox/ Windows 10 / 4-processor i5 laptop.
James, totally aside -- it's not every day someone shows me something in JavaScript I've never heard of! map/let? Wow. I compared your map/let syntax with more common for/parseFloat and it looks like the optimizers maybe do a slightly better job with the simpler for/parseFloat, maybe. Anyway, just for fun:
Firefox:
245 ms map(parseFloat)(JSON.parse([str,str,str...]))
191 ms map(parseFloat)(JSON.parse([str,str,str...]))
191 ms map(parseFloat)(JSON.parse([str,str,str...]))
188 ms map(parseFloat)(JSON.parse([str,str,str...]))
253 ms map(parseFloat)(JSON.parse([str,str,str...]))
268 ms map(parseFloat)(JSON.parse([str,str,str...]))
189 ms map(parseFloat)(JSON.parse([str,str,str...]))
188 ms map(parseFloat)(JSON.parse([str,str,str...]))
189 ms map(parseFloat)(JSON.parse([str,str,str...]))
164 ms parseFloat(JSON.parse([str,str,str...]))
237 ms parseFloat(JSON.parse([str,str,str...]))
238 ms parseFloat(JSON.parse([str,str,str...]))
159 ms parseFloat(JSON.parse([str,str,str...]))
158 ms parseFloat(JSON.parse([str,str,str...]))
152 ms parseFloat(JSON.parse([str,str,str...]))
159 ms parseFloat(JSON.parse([str,str,str...]))
251 ms parseFloat(JSON.parse([str,str,str...]))
196 ms parseFloat(JSON.parse([str,str,str...]))
182 ms JSON.parse([num,num,num,num])
136 ms JSON.parse([num,num,num,num])
134 ms JSON.parse([num,num,num,num])
132 ms JSON.parse([num,num,num,num])
134 ms JSON.parse([num,num,num,num])
133 ms JSON.parse([num,num,num,num])
130 ms JSON.parse([num,num,num,num])
135 ms JSON.parse([num,num,num,num])
136 ms JSON.parse([num,num,num,num])
641 ms map(parseFloat)(JSON.parse([str,str,str...]))
588 ms map(parseFloat)(JSON.parse([str,str,str...]))
471 ms map(parseFloat)(JSON.parse([str,str,str...]))
470 ms map(parseFloat)(JSON.parse([str,str,str...]))
511 ms map(parseFloat)(JSON.parse([str,str,str...]))
723 ms map(parseFloat)(JSON.parse([str,str,str...]))
473 ms map(parseFloat)(JSON.parse([str,str,str...]))
485 ms map(parseFloat)(JSON.parse([str,str,str...]))
467 ms map(parseFloat)(JSON.parse([str,str,str...]))
242 ms parseFloat(JSON.parse([str,str,str...]))
398 ms parseFloat(JSON.parse([str,str,str...]))
298 ms parseFloat(JSON.parse([str,str,str...]))
326 ms parseFloat(JSON.parse([str,str,str...]))
320 ms parseFloat(JSON.parse([str,str,str...]))
302 ms parseFloat(JSON.parse([str,str,str...]))
302 ms parseFloat(JSON.parse([str,str,str...]))
673 ms parseFloat(JSON.parse([str,str,str...]))
292 ms parseFloat(JSON.parse([str,str,str...]))
263 ms JSON.parse([num,num,num,num])
247 ms JSON.parse([num,num,num,num])
244 ms JSON.parse([num,num,num,num])
247 ms JSON.parse([num,num,num,num])
244 ms JSON.parse([num,num,num,num])
254 ms JSON.parse([num,num,num,num])
247 ms JSON.parse([num,num,num,num])
245 ms JSON.parse([num,num,num,num])
251 ms JSON.parse([num,num,num,num])
392 ms map(parseFloat)(JSON.parse([str,str,str...]))
279 ms map(parseFloat)(JSON.parse([str,str,str...]))
312 ms map(parseFloat)(JSON.parse([str,str,str...]))
345 ms map(parseFloat)(JSON.parse([str,str,str...]))
329 ms map(parseFloat)(JSON.parse([str,str,str...]))
305 ms map(parseFloat)(JSON.parse([str,str,str...]))
274 ms map(parseFloat)(JSON.parse([str,str,str...]))
320 ms map(parseFloat)(JSON.parse([str,str,str...]))
315 ms map(parseFloat)(JSON.parse([str,str,str...]))
154 ms parseFloat(JSON.parse([str,str,str...]))
171 ms parseFloat(JSON.parse([str,str,str...]))
195 ms parseFloat(JSON.parse([str,str,str...]))
167 ms parseFloat(JSON.parse([str,str,str...]))
189 ms parseFloat(JSON.parse([str,str,str...]))
191 ms parseFloat(JSON.parse([str,str,str...]))
176 ms parseFloat(JSON.parse([str,str,str...]))
189 ms parseFloat(JSON.parse([str,str,str...]))
154 ms parseFloat(JSON.parse([str,str,str...]))
221 ms JSON.parse([num,num,num,num])
155 ms JSON.parse([num,num,num,num])
151 ms JSON.parse([num,num,num,num])
222 ms JSON.parse([num,num,num,num])
153 ms JSON.parse([num,num,num,num])
175 ms JSON.parse([num,num,num,num])
194 ms JSON.parse([num,num,num,num])
184 ms JSON.parse([num,num,num,num])
150 ms JSON.parse([num,num,num,num])
On Tue, May 2, 2017 at 3:24 AM, Marcin Wojdyr <wojdyr@gmail.com> wrote:
Bob: point taken, the difference is not significant here. What browser
was it, just for the record?
James: if you do b.map(parseFloat)
you're creating a second list. That's the main difference with Bob's benchmark.
The simpler solution would be to just write in the spec that CIF
numbers can be represented either as strings or as numbers in JSON.
Marcin
_______________________________________________
cif-developers mailing list
cif-developers@iucr.org
http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif- developers
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- References:
- CIF-JSON new draft (James Hester)
- Re: CIF-JSON new draft (Marcin Wojdyr)
- RE: CIF-JSON new draft (Bollinger, John C)
- Re: CIF-JSON new draft (Marcin Wojdyr)
- Re: CIF-JSON new draft (Robert Hanson)
- Re: CIF-JSON new draft (Marcin Wojdyr)
- Re: CIF-JSON new draft (Robert Hanson)
- Re: CIF-JSON new draft (James Hester)
- Re: CIF-JSON new draft (Marcin Wojdyr)
- Prev by Date: Re: CIF-JSON new draft
- Next by Date: RE: CIF-JSON new draft
- Prev by thread: Re: CIF-JSON new draft
- Next by thread: RE: CIF-JSON new draft
- Index(es):