Feng Yuan Principal Software Development Engineer Microsoft Corporation.

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
demo Default WANGPSLookup Default WANGPS.

Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Adrian Ford Program Manager Microsoft Corporation PC15.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
 Paul Vick Principal Architect Microsoft Corporation  Lucian Wischik Software Engineer Microsoft Corporation.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Ian Ellison-Taylor General Manager Microsoft Corporation PC27.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Details On The Longhorn Spool File Format. Outline Metro Packages Reach Package Structure Reach Markup Other Topics.

IoCompleteRequest (Irp);... p = NULL; …f(p);
Ctrl-K, X Ctrl-K, S
Возможности Excel 2010, о которых следует знать
Title of Presentation 11/22/2018 3:34 PM
Title of Presentation 12/2/2018 3:48 PM
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

Feng Yuan Principal Software Development Engineer Microsoft Corporation

Raise awareness of XPS document performance issues Demonstrate how to measure XPS documents Demonstrate how to optimize XPS documents

Performance issues with XPS documents Metrics for XPS documents XPS measuring tool Optimizing XPS documents FixedPageFontImage Call To Action

GenerationTransmissionArchivingSearchingViewingPrintingDiscarding

Transmission Zip container decoding Stream decompression Object model building Document structure construction RenderingConversionSearching

Larger storage requirement Larger network bandwidth requirement Slower downloading Slower viewing Slower printing Unable to view or print

XPS document size Loading time Memory consumption Rendering time Searching time

Container: Original size, compression, number of streams, order of streams, interleaving Markup: Number of elements, number of attributes, nesting of opacity, area of opacity, sharing of objects Image: Resolution, pixel format, file format, compression Font: Tables, glyphs

XPS Package Relationships Common Package Parts Document Structure Font Thumbnail Resource Dictionary Core Properties Thumbnail Signature Origin Signature X509 Certificate Fixed Document Sequence Fixed Document FixedPage FixedPage Resources OptionalParts Required or RecommendedParts Relationship Image

TypeCountOriginalCompressedRatio fixedpage453116,521,0065,912,47495% package.relationships434573,558164,87171% properties % fixeddocument1289,70213,75695% opentype201,647,572576,14465% Image4921,042,993992,6815% fixeddocumentsequence % documentstructure1179,19413,15493% /[Content_Types]11, % ZIP Structure 195,978 0% Summary1,410120,452,0197,869,89193%

Main contributor for long document Compression ratio: 95% 500 elements for normal page 10K to million elements for complex page PageSizeGlyphsPathImageOpacityMask 1.fpage1,690,254571,0371, fpage fpage237, Summary116,521,00687,179111,59311,6535,690

Main contributor for short document Compression ratio: 40% to 90% Larger document if not embeddable TypefaceSizeCompSizeElements Char Used Original Glyphs Verdana Italic60,66821,7653, Arial Bold81,35616, [32]1,674 Courier New Regular71,82441,56919, ,318 MS Mincho Regular209,84419, ,807 Wingdings Regular24,0529,62311[232]226 Verdana Regular73,02029,07549,

Contributing to all documents Compression ratio: 0% to 5% Implementing non-embeddable text Choose right size, format, compression ImageSizeCompSizeWidthHeightFormatUsageColor thumbnail.jpeg6,5385, Bgr image_0.png Bgra324black image_2.png Bgra image_348.jpg33,57933, Bgr241 image_96.png10,56810, Indexed81121

Use simple syntax Solid Color Brush: Fill=“#FFFFFF” Path: Data=“M0,0 h100v100h-100z” Use less costly representation Single color image  solid color Same color gradient  solid color Image with same rows/columns  single row/column Remove non-visible elements Empty path, glyph elements Opacity=0, totally clipped, out of bound, totally covered

Remove default value/redundancy Opacity, BidiLevel, TileMode, StyleSimulation, IsSideways Clipping larger than elements, same as paper bounds Canvas with single child, no attributes Glyphs.Indices optional for simple mapping and layout Remove redundant paths/points in path geometry Reuse elements and attributes Resource and remote resource dictionary Brushes, MatrixTransform, Path, Glyphs, Canvas Use RenderTransform to create more reusable parts

Remove default value/redundancy Opacity, BidiLevel, TileMode, StyleSimulation, IsSideways Clipping larger than elements, same as paper bounds Canvas with single child, no attributes Glyphs.Indices optional for simple mapping and layout Remove redundant paths/points in path geometry Reuse elements and attributes Resource and remote resource dictionary Brushes, MatrixTransform, Path, Glyphs, Canvas Use RenderTransform to create more reusable parts

Merge Glyphs/Path elements Merge same size/font glyphs on the same line Merge simple paths with the same stroking/filling Merge tiled images Replace simulated gradient fill with real gradient More complex optimization Brush algebra: (red, 0.5) * (red, 0.5) = (red, 0.75) opacity1 * (rgb, opacity2) = (rgb, opacity1 * opacity2) Selective rasterization VisualBrush for hatching, stencils

<RadialGradientBrush x:Key="black" Center="0.5,0.5" <RadialGradientBrush x:Key="black" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5" GradientOrigin="0.2,0.2"> RadiusX="0.5" RadiusY="0.5" GradientOrigin="0.2,0.2"> <PathGeometry x:Key="circle" <PathGeometry x:Key="circle" Figures="M0,-0.5 A0.5, ,0.5 A0.5, ,-0.5" /> Figures="M0,-0.5 A0.5, ,0.5 A0.5, ,-0.5" /> <PathGeometry x:Key="grid33" <PathGeometry x:Key="grid33" Figures="m0,0h2 M0,1h2 M0,2h2 M0,0v2 M1,0v2 M2,0v2" /> Figures="m0,0h2 M0,1h2 M0,2h2 M0,0v2 M1,0v2 M2,0v2" /> <Path Data="{StaticResource grid33}" Stroke="#000000“ <Path Data="{StaticResource grid33}" Stroke="#000000“ StrokeThickness="0.03" RenderTransform="1, 0, 0, 1, 1, 1"/> StrokeThickness="0.03" RenderTransform="1, 0, 0, 1, 1, 1"/> <Path Data="{StaticResource circle}" Fill="{StaticResource black}“ <Path Data="{StaticResource circle}" Fill="{StaticResource black}“ RenderTransform="0.9, 0, 0, 0.9, 1, 1"/> RenderTransform="0.9, 0, 0, 0.9, 1, 1"/></Canvas>

Subset fonts, preferably per document Remove/replace barely used fonts Substitute fonts when not embeddable Share glyph bitmaps/outlines Font tables of limited usage GSUB, GPOS, kern EBDT, hdmx, vdmx Consider rearrange glyph indices

Vista, simkai.ttf, 28,562 glyphs, 11 mb Subset with 围棋, 183k, 55k compressed hmtx 58k, loca 57k, vmtx 57k, glyf 690b Convert to path geometry: 1148b+1260b

Share duplicated images (crc32) Stitch banded images Single color/same row/same column image Pick the right size, trim image Pick the right color depth Pick the right image format Adjust compression OpacityMask merge with brush, remove rgb

<Path Data="M 15.6,91.56 L 199.8,91.56 L 199.8,186 L 15.6,186 Z" Clip="M 0,0 L 720,0 L 720,540 L 0,540 Z "> <ImageBrush ImageSource=“image_3.png" Viewbox="0,0,512,262" TileMode="None" ViewboxUnits="Absolute" ViewportUnits="Absolute" Viewport="0,0,1,1"> <ImageBrush ImageSource=“image_4.png" Viewbox="0,0,512,262" TileMode="None" ViewboxUnits="Absolute" ViewportUnits="Absolute" Viewport="0,0,1,1">

NameQualityFormatSize image_3.png1,132 bgra47,934 Image_4.png1,132 bgra47,877 Merge.png1,132 bgra36,805 Merge.wmp1,132 bgra62,908 Merge.wmp0.8,132 bgra35,535 Merge.wmp0.8,0.832 bgra2,774 Merge.tiff1,132 bgra53,262 Merge.png1,18 indexed19,388 <ImageBrush ImageSource="merge256.png" Viewbox="0,0,512,262" ViewboxUnits="Absolute“ Viewbox="0,0,512,262" ViewboxUnits="Absolute“ ViewportUnits="Absolute" Viewport="0,0,1,1" /> ViewportUnits="Absolute" Viewport="0,0,1,1" />

Read OPC/XPS specifications Measure current XPS documents Experiment with alternatives Design/implement better XPS generation Design/implement XPS optimization

XPS Related Web Resources Specification, white papers, download: Blog: Forum: Related Sessions CLN-T370XPSDrv: Best Practices using Print Verifier CLN-C369Print Verifier and XPSDrv Development Best Practices CLN-C372XPS Document Optimization and Best Practices Technical Support microsoft.com microsoft.com

© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.