[wp-trac] [WordPress Trac] #24152: Use JSON as alternative to headers
WordPress Trac
noreply at wordpress.org
Mon Oct 12 18:02:01 UTC 2015
#24152: Use JSON as alternative to headers
-----------------------------+------------------------------
Reporter: ryanve | Owner:
Type: feature request | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: close | Focuses:
-----------------------------+------------------------------
Comment (by swalkinshaw):
Replying to [comment:24 nacin]:
> Replying to [comment:17 swalkinshaw]:
>
> Are these numbers based on the average or the sum of 10000 iterations?
>
> I'd identify one problem with these benchmarks. `get_file_data()` and
`parse_ini_file()` both hit the filesystem. `json_decode()` does not. If
you didn't account for that, well, that I/O hit is pretty significant. If
you did account for it, then I'd suggest that benchmarking this at high
iterations isn't all that useful, since it'd only ever be run a few times
on a pageload anyway.
They were the sum of all iterations. However '''all''' of them did hit the
filesystem. I'd be glad to benchmark more real world numbers. If you could
contribute some statistics about the number of plugins from wordpress.com
hosting such as average, median, p10, p90, etc, then those could be run to
see the actual overhead.
>
> > * '''Uniformity''': since JSON has a spec and built-in parsers in
basically every language, it doesn't necessarily matter how you format
whitespace for example. But with the current file headers, there's no
uniformity and it can cause problems. Here's an example from the bug
above:
>
> I don't really have a problem with this. Only WP needs to do this
parsing.
I don't understand this. Most configuration files are only parsed by their
own application/framework and nothing externally, yet they all choose a
sane standard.
>
> As I indicated originally, I totally understand the desire and the use
case. I just don't believe it is a complexity we have any need to
introduce right now, regardless of format (json v yaml).
Let's be realistic here: if you were starting from scratch, JSON is less
complex. I'm assuming you're talking about the complexity of migrating to
a new solution and obviously that's not easy.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/24152#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list