Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: Source/bindings/generated_bindings.gyp

Issue 184233005: Pre-cache PLY yacc parse table and use optimized mode (45% build time improvement) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # 1 #
2 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl', 112 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl',
113 ], 113 ],
114 114
115 115
116 # Python source 116 # Python source
117 'jinja_module_files': [ 117 'jinja_module_files': [
118 # jinja2/__init__.py contains version string, so sufficient for package 118 # jinja2/__init__.py contains version string, so sufficient for package
119 '<(DEPTH)/third_party/jinja2/__init__.py', 119 '<(DEPTH)/third_party/jinja2/__init__.py',
120 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep 120 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
121 ], 121 ],
122 'idl_compiler_files': [ 122 'idl_lexer_parser_files': [
123 'scripts/idl_compiler.py',
124 # PLY (Python Lex-Yacc) 123 # PLY (Python Lex-Yacc)
125 '<(DEPTH)/third_party/ply/lex.py', 124 '<(DEPTH)/third_party/ply/lex.py',
126 '<(DEPTH)/third_party/ply/yacc.py', 125 '<(DEPTH)/third_party/ply/yacc.py',
127 # Web IDL lexer/parser (base parser) 126 # Web IDL lexer/parser (base parser)
128 '<(DEPTH)/tools/idl_parser/idl_lexer.py', 127 '<(DEPTH)/tools/idl_parser/idl_lexer.py',
129 '<(DEPTH)/tools/idl_parser/idl_node.py', 128 '<(DEPTH)/tools/idl_parser/idl_node.py',
130 '<(DEPTH)/tools/idl_parser/idl_parser.py', 129 '<(DEPTH)/tools/idl_parser/idl_parser.py',
131 # Blink IDL lexer/parser/constructor 130 # Blink IDL lexer/parser/constructor
132 'scripts/blink_idl_lexer.py', 131 'scripts/blink_idl_lexer.py',
133 'scripts/blink_idl_parser.py', 132 'scripts/blink_idl_parser.py',
133 ],
134 'idl_compiler_files': [
135 'scripts/idl_compiler.py',
136 # Blink IDL front end (ex-lexer/parser)
134 'scripts/idl_definitions.py', 137 'scripts/idl_definitions.py',
135 'scripts/idl_reader.py', 138 'scripts/idl_reader.py',
136 'scripts/idl_validator.py', 139 'scripts/idl_validator.py',
137 'scripts/interface_dependency_resolver.py', 140 'scripts/interface_dependency_resolver.py',
138 # V8 code generator 141 # V8 code generator
139 'scripts/code_generator_v8.py', 142 'scripts/code_generator_v8.py',
140 'scripts/v8_attributes.py', 143 'scripts/v8_attributes.py',
141 'scripts/v8_callback_interface.py', 144 'scripts/v8_callback_interface.py',
142 'scripts/v8_globals.py', 145 'scripts/v8_globals.py',
143 'scripts/v8_interface.py', 146 'scripts/v8_interface.py',
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', 277 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle',
275 '--event-names-file', 278 '--event-names-file',
276 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in', 279 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
277 '<@(write_file_only_if_changed)', 280 '<@(write_file_only_if_changed)',
278 ], 281 ],
279 'message': 'Generating list of Event interfaces', 282 'message': 'Generating list of Event interfaces',
280 }] 283 }]
281 }, 284 },
282 ################################################################################ 285 ################################################################################
283 { 286 {
287 # A separate pre-caching step is *not required* to use parse table caching
288 # in PLY, as the cache is concurrency-safe.
289 # However, pre-caching ensures that all compiler processes use the cached
290 # file (hence maximizing speed), instead of early processes building the
291 # table themselves (as it's not yet been written by the time they start).
292 'target_name': 'cached_yacc_tables',
293 'type': 'none',
294 'actions': [{
295 'action_name': 'cache_yacc_tables',
296 'inputs': [
297 '<@(idl_lexer_parser_files)',
298 ],
299 'outputs': [
300 '<(bindings_output_dir)/parsetab.pickle',
haraken 2014/03/05 06:18:04 parsed_yacc_table.pickle ?
Nils Barth (inactive) 2014/03/05 06:28:05 "parsetab.pickle" is the PLY standard name. (Simil
301 ],
302 'action': [
303 'python',
304 'scripts/blink_idl_parser.py',
305 '<(bindings_output_dir)',
306 ],
307 'message': 'Caching PLY yacc parse tables',
308 }],
309 },
310 ################################################################################
311 {
284 # A separate pre-caching step is *required* to use bytecode caching in 312 # A separate pre-caching step is *required* to use bytecode caching in
285 # Jinja (which improves speed significantly), as the bytecode cache is 313 # Jinja (which improves speed significantly), as the bytecode cache is
286 # not concurrency-safe on write; details in code_generator_v8.py. 314 # not concurrency-safe on write; details in code_generator_v8.py.
287 'target_name': 'cached_jinja_templates', 315 'target_name': 'cached_jinja_templates',
288 'type': 'none', 316 'type': 'none',
289 'actions': [{ 317 'actions': [{
290 'action_name': 'cache_jinja_templates', 318 'action_name': 'cache_jinja_templates',
291 'inputs': [ 319 'inputs': [
292 '<@(jinja_module_files)', 320 '<@(jinja_module_files)',
293 'scripts/code_generator_v8.py', 321 'scripts/code_generator_v8.py',
(...skipping 13 matching lines...) Expand all
307 }, 335 },
308 ################################################################################ 336 ################################################################################
309 { 337 {
310 'target_name': 'individual_generated_bindings', 338 'target_name': 'individual_generated_bindings',
311 'type': 'none', 339 'type': 'none',
312 # The 'binding' rule generates .h files, so mark as hard_dependency, per: 340 # The 'binding' rule generates .h files, so mark as hard_dependency, per:
313 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependenci es 341 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependenci es
314 'hard_dependency': 1, 342 'hard_dependency': 1,
315 'dependencies': [ 343 'dependencies': [
316 'interfaces_info', 344 'interfaces_info',
345 'cached_yacc_tables',
317 'cached_jinja_templates', 346 'cached_jinja_templates',
318 '../core/core_generated.gyp:generated_testing_idls', 347 '../core/core_generated.gyp:generated_testing_idls',
319 ], 348 ],
320 'sources': [ 349 'sources': [
321 '<@(interface_idl_files)', 350 '<@(interface_idl_files)',
322 ], 351 ],
323 'rules': [{ 352 'rules': [{
324 'rule_name': 'binding', 353 'rule_name': 'binding',
325 'extension': 'idl', 354 'extension': 'idl',
326 'msvs_external_rule': 1, 355 'msvs_external_rule': 1,
327 'inputs': [ 356 'inputs': [
357 '<@(idl_lexer_parser_files)', # to be explicit (covered by parsetab)
328 '<@(idl_compiler_files)', 358 '<@(idl_compiler_files)',
359 '<(bindings_output_dir)/parsetab.pickle',
329 '<(bindings_output_dir)/cached_jinja_templates.stamp', 360 '<(bindings_output_dir)/cached_jinja_templates.stamp',
330 'IDLExtendedAttributes.txt', 361 'IDLExtendedAttributes.txt',
331 # If the dependency structure or public interface info (e.g., 362 # If the dependency structure or public interface info (e.g.,
332 # [ImplementedAs]) changes, we rebuild all files, since we're not 363 # [ImplementedAs]) changes, we rebuild all files, since we're not
333 # computing dependencies file-by-file in the build. 364 # computing dependencies file-by-file in the build.
334 # This data is generally stable. 365 # This data is generally stable.
335 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', 366 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle',
336 # Further, if any dependency (partial interface or implemented 367 # Further, if any dependency (partial interface or implemented
337 # interface) changes, rebuild everything, since every IDL potentially 368 # interface) changes, rebuild everything, since every IDL potentially
338 # depends on them, because we're not computing dependencies 369 # depends on them, because we're not computing dependencies
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 'type': 'none', 425 'type': 'none',
395 'dependencies': [ 426 'dependencies': [
396 'aggregate_generated_bindings', 427 'aggregate_generated_bindings',
397 'event_interfaces', 428 'event_interfaces',
398 'individual_generated_bindings', 429 'individual_generated_bindings',
399 ], 430 ],
400 }, 431 },
401 ################################################################################ 432 ################################################################################
402 ], # targets 433 ], # targets
403 } 434 }
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/blink_idl_parser.py » ('j') | Source/bindings/scripts/idl_reader.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698