[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: CIF-JSON new draft
- Subject: Re: CIF-JSON new draft
- From: Robert Hanson <hansonr@xxxxxxxxxx>
- Date: Mon, 1 May 2017 15:32:11 -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=KXnhPWAJHhhxFLpgaTZzAbqSeQS6h6/PEUxOeRiFqh4=;b=rx/IPAtmLFXGif8oHJkl5NxxpyHKFAsMtIFycVv9q4gwgOV8khLQwRJIMzRy9RJcVj2vqP7sZlPigpuuVMJ8DCsff7JLeQBy3cXn5VQH748/sE9YST9+wwEIzM7eZ1u7STvF9Vs9StdGfCJXt/iYJctkflrbJE1pw7go/OTmL3A=
- In-Reply-To: <CAF_YUvUeKG-WSf+yZuNtVUdDBd7Yn=_PnJOKYuzOJACff6V1SA@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>
Another quick test. In this case, we only convert 50% of the strings to numbers based on the idea that, for example, we don't care about anisotropies. But the JSON.parse of course has to convert them all:
402 ms parseFloat(JSON.parse([str,str,str...]))
364 ms parseFloat(JSON.parse([str,str,str...]))
367 ms parseFloat(JSON.parse([str,str,str...]))
368 ms parseFloat(JSON.parse([str,str,str...]))
598 ms JSON.parse([num,num,num,num])
553 ms JSON.parse([num,num,num,num])
555 ms JSON.parse([num,num,num,num])
557 ms JSON.parse([num,num,num,num])
My conclusion is that it is better to deliver numbers as strings, which also allows easy incorporation of "(xx)" uncertainties, although I am not checking for that here.402 ms parseFloat(JSON.parse([str,str,str...]))
364 ms parseFloat(JSON.parse([str,str,str...]))
367 ms parseFloat(JSON.parse([str,str,str...]))
368 ms parseFloat(JSON.parse([str,str,str...]))
598 ms JSON.parse([num,num,num,num])
553 ms JSON.parse([num,num,num,num])
555 ms JSON.parse([num,num,num,num])
557 ms JSON.parse([num,num,num,num])
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- Follow-Ups:
- Re: CIF-JSON new draft (Robert Hanson)
- 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)
- 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):