On Tue, Feb 16, 2010 at 3:32 PM, Scott Blum <sco...@google.com> wrote:

> On Fri, Feb 12, 2010 at 7:00 PM, Lex Spoon <sp...@google.com> wrote:
>
>> On Fri, Feb 12, 2010 at 9:50 AM, Alex Moffat <alex.mof...@gmail.com>wrote:
>>
>>> Where can I read a description of what -XshardPrecompile, or see the
>>> code for it, it sounds very useful to me personally?
>>
>>
>> -XshardPrecompile is an experiment that everyone wants to change, so it
>> seems unlikely to be released in its current form.  We can talk about it if
>> it helps, but I would propose that we focus more on what we want to do for
>> real.
>>
>
> It seemed relevant because it sounded like you propose to essentially make
> -XshardPrecompile the default (only?) behavior for Precompile?  Or did I
> misread?
>

No, that's the idea.




> The reason that makes me cautious has to do with a desire for a future
> change to the Generator API to support things like minimal rebuild.  I
> imagine a world where the work each Generator does could be sharded out in a
> way that's independent of the number of permutations.
>

Are you saying that you want to not have to shard, with future developments?
 I don't think that should be a problem with this patch.  As a case in
point, the Compiler entry point *could* shard out generating and linking,
but it chooses not to.  We have the flexibility to play around with these
choices over time.


- I'm not sure why development mode wouldn't run a sharded link first.
>>>  Wouldn't it make sense if development mode works just like production
>>> compile, it just runs a single "development mode" permutation shard link
>>> before running the final link?
>>>
>>
>> Sure, we can do that. Note, though, that they will be running against an
>> empty ArtifactSet, because there aren't any compiles for them to look at.
>>  Thus, they won't typically do anything.
>>
>
> Do public resources and generated resources show up during the sharded
> phase?
>

Everyone is happy, I think, with having dev mode run a single on-shard
linking step.  So, these are just details.  FWIW, here is how it is in the
patch:

1. Resources are available via ResourceOracle.
2. Public artifacts are be there.  They are identical on all permutations,
so they aren't added to the artifact set until the final link step.
3. Generated artifacts are there for compilation, but not for development
mode.  With development mode, all linking is done before the generators run,
and generators run on demand.


----------- you write (gmail just messed up my reply quotes): ----
 Now that I am thinking along those lines, it almost begs the question.  If
we are willing to break the world, is this the best possible way to model
new link process?  In other words, it seems worth re-examining the design
without regard to the existing API and asking ourselves if it's the thing
we'd have designed from scratch.  Maybe you guys all already did that and
I'm the only one late to the party.

For example, if we're going from scratch, then we could avoid the transition
entirely and just mandate what the new rules are.  We wouldn't need a
@Shardable annotation since all linkers would need to be sharding aware.  We
might rather have two separate methods for sharded vs. non-sharded link than
a boolean parameter.  We might revisit the whole PRE, PRIMARY, POST thing
with regards to sharding and decide the right answer is SHARD, PRE, PRIMARY,
POST.  Or something.  I don't know what the right answers are.  All I'm
saying is, breaking things is awesome when you're doing something
revolutionary and the end result is awesome.  I just want to be sure, if
we're going to break things, that we believe we'll end up somewhere
revolutionary and awesome as opposed to evolutionary and incremental, but
less than awesome.
--------------------------------------------------------------------------------


I initially proposed simply breaking the world.  However, at your
encouragement, this patch has developed to be backwards compatible.  As
things stand, this patch both gets a large improvement and is evolutionary.

On those specific changes:

1. @Shardable can certainly be dropped after a deprecation period.  Is there
any urgency to drop it immediately?

2. Two separate methods versus one with a boolean looks fine to me.  It's
changed back and forth as the patch developed.

3.PRE/PRIMARY/POST still appear to be useful.  All linkers care whether they
are primary or not, because there is one primary linker and it must deal
with generating a selection script.  Additionally, a few linkers care
whether they go before or after the primary linker.

4. SHARD as a separate linker order is very tempting but turns out to have
some problems. First, many linkers have both an on-shard and on-final part,
and if SHARD was a separate order then those linkers would have to be
subdivided into two linkers.  Instead of IframeLinker, we'd have to have
IframeShardLinker and IframeFinalLinker.  Second, the SHARD part also has
PRE/PRIMARY/POST, so you really have six linker orders, not four.  It's
tidier to represent the six as two times three.

Lex

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to