Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CIF-JSON new draft

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.

cif-developers mailing list

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.