Re: Prefs overhaul

2018-03-12 Thread Nicholas Nethercote
The old code read the entire file into memory before starting parsing. In
one place it did this with URLPreloader::ReadZip() (for default pref
files), and in another place it did this with
URLPreloader::ReadFile() (for user pref files). It was simplest to leave
that code unchanged.

Nick


On Mon, Mar 12, 2018 at 9:16 PM, David Teller  wrote:

> Out of curiosity, why is the read handled by C++ code?
>
> On 12/03/2018 10:38, Nicholas Nethercote wrote:
> > I don't know. But libpref's file-reading is done by C++ code, which
> passes
> > a string to the Rust code for parsing.
> >
> > Nick
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
> >
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Prefs overhaul

2018-03-12 Thread David Teller
Out of curiosity, why is the read handled by C++ code?

On 12/03/2018 10:38, Nicholas Nethercote wrote:
> I don't know. But libpref's file-reading is done by C++ code, which passes
> a string to the Rust code for parsing.
> 
> Nick
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
> 
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Prefs overhaul

2018-03-12 Thread Nicholas Nethercote
On Sun, Mar 11, 2018 at 4:24 AM, ISHIKAWA,chiaki 
wrote:

>
> I have noticed that you mentioned rewrite in Rust.
>
> Does the I/O primitive Rust uses handle the following "short read" case
> niciely?
>

I don't know. But libpref's file-reading is done by C++ code, which passes
a string to the Rust code for parsing.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Prefs overhaul

2018-03-10 Thread ISHIKAWA,chiaki

On 2018/03/07 12:08, Nicholas Nethercote wrote:

Hi,

I've been doing a lot of work to improve libpref recently, and there is
more in the pipeline. I've written a brief roadmap that might be of
interest to people: https://wiki.mozilla.org/Platform/PrefsOverhaul

I'd be happy to hear feedback, via this list or other means. Thanks.

Nick


I have noticed that you mentioned rewrite in Rust.

Does the I/O primitive Rust uses handle the following "short read" case 
niciely?


Suppose, prefs file (user profile) is stored on a remote file server.
Based on the network congestion and/or server load, the remote file 
server may end up returning shorter than requested octet strings.

(This can happen for real.)
Under linux, the I/O primitive does not read the remaining octets.
Under Windows, the I/O primitive seems to automagically handles the 
reading of remaining octets as far as the remote file server is CIFS. (I 
don't know about NFS.)


Does libpres under linux handles such short-read cases?

I have filed a few bugzilla for TB's failure to tackle this situation 
(under linux), but I have noticed the issue is deep within M-C portion 
of the code, too.


Bugzilla:
Bug 1170646 - A few M-C fixes to handle short read in Cache code ( from 
[META] Failure to deal with short read)


and related bugs there.

Bug 1170578 - RFC: Buggy NSS dbm code ought to be updated
1170606  <--- this is C-C TB side noted below.
Bug 1170668 - Failure to handle short read: the case of reading a JSON 
file into JavaScript 'String' type. ( [META] Failure to deal with short 
read)


1172304 <-- fixed.

On the purely C-C TB side:

Bug 1170606 - C-C T-B fixes to take care of short read (part of [META] 
Failure to deal with short read)

and 1170646 mentioned there.

cf. My comment about short write of PR_Write() in the currently last 
comment  of

https://bugzilla.mozilla.org/show_bug.cgi?id=1170564
may be misguided.
I found that PR_Write() is automatically retried even under Linux.

PPS: MS-Windows seems to handle this under the hood: the I/O routines 
are mapped to MS syscalls and they seem to handle the short read issue 
on the OS side very well.



___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Prefs overhaul

2018-03-08 Thread Bobby Holley
This looks like great work - I'm very glad to see us investing in
improvements to core infrastructure like this. Thanks Nick!

On Tue, Mar 6, 2018 at 7:08 PM, Nicholas Nethercote 
wrote:

> Hi,
>
> I've been doing a lot of work to improve libpref recently, and there is
> more in the pipeline. I've written a brief roadmap that might be of
> interest to people: https://wiki.mozilla.org/Platform/PrefsOverhaul
>
> I'd be happy to hear feedback, via this list or other means. Thanks.
>
> Nick
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Prefs overhaul

2018-03-07 Thread Kris Maglione

On Wed, Mar 07, 2018 at 02:08:59PM +1100, Nicholas Nethercote wrote:

Hi,

I've been doing a lot of work to improve libpref recently, and there is
more in the pipeline. I've written a brief roadmap that might be of
interest to people: https://wiki.mozilla.org/Platform/PrefsOverhaul

I'd be happy to hear feedback, via this list or other means. Thanks.


Related to this (and particularly in the light of bug 1425613), 
I've been thinking it's about time to migrate the preference 
service bindings to WebIDL, and kill the XPIDL/XPCOM bindings 
altogether.


The XPC overhead on the JS side is pretty bad given how much we 
use the service, and a WebIDL implementation would make it 
easier to add certain optimizations (like native lazy pref 
getters) on top of the ones we'd automatically get from the 
conversion.


From the native side, accessing the pref service via 
do_GetService adds a bunch of get service overhead, and then a 
bunch of virtual call overhead for each method call. We do have 
already have a non-virtual API. We should just make that the 
only option.

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Prefs overhaul

2018-03-06 Thread Nicholas Nethercote
Hi,

I've been doing a lot of work to improve libpref recently, and there is
more in the pipeline. I've written a brief roadmap that might be of
interest to people: https://wiki.mozilla.org/Platform/PrefsOverhaul

I'd be happy to hear feedback, via this list or other means. Thanks.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform