SlideShare una empresa de Scribd logo
1 de 52
Descargar para leer sin conexión
MobaSiF::Template
 DeNA - Tadashi Matsuda - bobpp
    bobpp+yapc@bobpp.jp

  YAPC::Asia 2009 - 2009.09.10
•
• MobaSiF::Template   /

•
•
•
•            (                )

• bobpp (           )

• http://bobpp.jp/
•( )
  •           (http://mbok.jp)
YAPC!

• YAPC
•

•
Check this!

•Twitter: BoBpp
 •
MobaSiF
Moba* Simple
 Framework
Moba*
•
    • 2003
•
    •5   PV/day

• and more...
Moba* Simple
 Framework
Mobile Simple
 Framework
YAPC::Asia 2008
MobaSiF::Template
MTemplate

• MobaSiF::Template
• MobaSiF
•
MobaSiF::Template
•          (MobaSiF::*)

• github
• CPAN
•
  •
•
    • MobaSiF::Template
•
    • MobaSiF::Template::Compiler
•
HTML
Template

(*.html)
HTML
                  Template

                  (*.html)




MobaSiF::Template::PreCompiler   MobaSiF:::Template::Compiler
          precompile                        compile




      Include
     Template

   (*.txt/html)
HTML                                 Compiled
                  Template                              Template

                  (*.html)                                 (*.bin)




MobaSiF::Template::PreCompiler   MobaSiF:::Template::Compiler
          precompile                        compile




      Include
     Template

   (*.txt/html)
HTML                                 Compiled
                  Template                              Template

                  (*.html)                                 (*.bin)




MobaSiF::Template::PreCompiler   MobaSiF:::Template::Compiler        MobaSiF::Template
          precompile                        compile                   insert / render




      Include
                                                                         Output
     Template
                                                                         (*.html)
   (*.txt/html)
HTML
                     HTML                               Compiled
                      HTML
                       HTML
                  Template
                   Template                             Template
                    Template
                     Template
                   (*.html)
                    (*.html)                               (*.bin)
                     (*.html)
                      (*.html)



MobaSiF::Template::PreCompiler   MobaSiF:::Template::Compiler        MobaSiF::Template
          precompile                        compile                   insert / render




      Include
                                                                         Output
     Template
                                       Compile Command                   (*.html)
   (*.txt/html)
•       •
    •       •
    •       • URL Encode
•
$ cpan
cpan> install MobaSiF::Template
<                            :   >

<!-- Escape            -->
$=h:escape_string$

<!-- Escape              (bypass) -->
$=b:not_escape_data$

<!-- URL Encode              -->
$=e:url_encode_string$
<            :   >
$ if (val > 10) { $
     val 10
$ } elsif (val > 5) { $
     val 5
$ } else { $
     val 5
$}$
<                     :     >


$ loop (list) { $
     $=h:id$ / $=h:key$ / $=h:value$
$}$
<                        >
use MobaSiF::Template::Compiler;
MobaSiF::Template::Compiler::compile(
     “/path/to/template_file.html”,
     “/path/to/compiled_binary_file.bin”
);
<         >
use MobaSiF::Template;
my $param = +{ hoge => 1, fuga => [
   +{ id => 1, value => ‘A’ },
   +{ id => 2, value => ‘B’ },
] };
print MobaSiF::Template::insert(
            “/path/to/compiled_binary_file.bin”, $param);
use MobaSiF::Template;
my $param = +{...};
$MobaSiF::Template::DEVELOP = 1;
print MobaSiF::Template::render(
           “/path/to/template_file.html”,
            “/path/to/compiled_binary_file.bin”, $param);
use MobaSiF::Template;                         0
my $param = +{...};
$MobaSiF::Template::DEVELOP = 1;
print MobaSiF::Template::render(
           “/path/to/template_file.html”,
            “/path/to/compiled_binary_file.bin”, $param);
use MobaSiF::Template;
            1       down                       0
my $param = +{...};
$MobaSiF::Template::DEVELOP = 1;
print MobaSiF::Template::render(
           “/path/to/template_file.html”,
            “/path/to/compiled_binary_file.bin”, $param);
Benchmark! <Rivals>

• Template Toolkit
• Tenjin
• HTML::Template::Pro
• MobaSiF::Template
Benchmark

•     /



• 10,000        qps
Machine

• MacBook
• OS X 10.5 Leopard
• perl v.5.8.9
• 2.4GHz Core2 Duo
• 4GB Memory
Result.
          Benchmark#1
Result.
                                                             Benchmark#1
                       0          5000.00       10000.00   15000.00        20000.00

  Template Toolkit    585.8


             Tenjin           2421.3


HTML::Template::Pro
                                       6451.6

  MobaSiF::Template

                                                                      17543.9
binary template / XS
binary template

•               (option)...

•
    •     XS
XS

• mmap
•
NULL
PLAIN


  REPLACE


 IF/ELSE


LOOP / etc.



     NULL
•
•   View(Template)
                     =
• Pre-Compiler
• Mobile Pre-Compiler
• compile files command
• tests!
•
•
•
CPAN / github

• http://search.cpan.org/~bobpp/MobaSiF-
  Template/
• http://github.com/bobpp/perl-MobaSiF-
  Template/
MobaSiF::Template Introduction

Más contenido relacionado

Similar a MobaSiF::Template Introduction

SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++Uilian Ries
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
All about Erubis (English)
All about Erubis (English)All about Erubis (English)
All about Erubis (English)kwatch
 
Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]Benny Siegert
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)jeresig
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4Wim Godden
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindSam Keen
 
Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Jeffrey Clark
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
Introduction to Xamarin.Forms
Introduction to Xamarin.FormsIntroduction to Xamarin.Forms
Introduction to Xamarin.FormsBrad Pillow
 
From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to LaravelJason McCreary
 
Tuning web performance
Tuning web performanceTuning web performance
Tuning web performanceGeorge Ang
 

Similar a MobaSiF::Template Introduction (20)

SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
All about Erubis (English)
All about Erubis (English)All about Erubis (English)
All about Erubis (English)
 
Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)
 
php 1
php 1php 1
php 1
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
HPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptxHPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptx
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Merb
MerbMerb
Merb
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
PHP
PHPPHP
PHP
 
Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
The Skinny on Slim
The Skinny on SlimThe Skinny on Slim
The Skinny on Slim
 
Introduction to Xamarin.Forms
Introduction to Xamarin.FormsIntroduction to Xamarin.Forms
Introduction to Xamarin.Forms
 
From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to Laravel
 
Tuning web performance
Tuning web performanceTuning web performance
Tuning web performance
 

Último

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

MobaSiF::Template Introduction

  • 1. MobaSiF::Template DeNA - Tadashi Matsuda - bobpp bobpp+yapc@bobpp.jp YAPC::Asia 2009 - 2009.09.10
  • 3. ( ) • bobpp ( ) • http://bobpp.jp/ •( ) • (http://mbok.jp)
  • 8. Moba* • • 2003 • •5 PV/day • and more...
  • 11.
  • 15. MobaSiF::Template • (MobaSiF::*) • github • CPAN • •
  • 16. • MobaSiF::Template • • MobaSiF::Template::Compiler •
  • 17.
  • 19. HTML Template (*.html) MobaSiF::Template::PreCompiler MobaSiF:::Template::Compiler precompile compile Include Template (*.txt/html)
  • 20. HTML Compiled Template Template (*.html) (*.bin) MobaSiF::Template::PreCompiler MobaSiF:::Template::Compiler precompile compile Include Template (*.txt/html)
  • 21. HTML Compiled Template Template (*.html) (*.bin) MobaSiF::Template::PreCompiler MobaSiF:::Template::Compiler MobaSiF::Template precompile compile insert / render Include Output Template (*.html) (*.txt/html)
  • 22. HTML HTML Compiled HTML HTML Template Template Template Template Template (*.html) (*.html) (*.bin) (*.html) (*.html) MobaSiF::Template::PreCompiler MobaSiF:::Template::Compiler MobaSiF::Template precompile compile insert / render Include Output Template Compile Command (*.html) (*.txt/html)
  • 23. • • • • • URL Encode •
  • 24. $ cpan cpan> install MobaSiF::Template
  • 25. < : > <!-- Escape --> $=h:escape_string$ <!-- Escape (bypass) --> $=b:not_escape_data$ <!-- URL Encode --> $=e:url_encode_string$
  • 26. < : > $ if (val > 10) { $ val 10 $ } elsif (val > 5) { $ val 5 $ } else { $ val 5 $}$
  • 27. < : > $ loop (list) { $ $=h:id$ / $=h:key$ / $=h:value$ $}$
  • 28. < > use MobaSiF::Template::Compiler; MobaSiF::Template::Compiler::compile( “/path/to/template_file.html”, “/path/to/compiled_binary_file.bin” );
  • 29. < > use MobaSiF::Template; my $param = +{ hoge => 1, fuga => [ +{ id => 1, value => ‘A’ }, +{ id => 2, value => ‘B’ }, ] }; print MobaSiF::Template::insert( “/path/to/compiled_binary_file.bin”, $param);
  • 30. use MobaSiF::Template; my $param = +{...}; $MobaSiF::Template::DEVELOP = 1; print MobaSiF::Template::render( “/path/to/template_file.html”, “/path/to/compiled_binary_file.bin”, $param);
  • 31. use MobaSiF::Template; 0 my $param = +{...}; $MobaSiF::Template::DEVELOP = 1; print MobaSiF::Template::render( “/path/to/template_file.html”, “/path/to/compiled_binary_file.bin”, $param);
  • 32. use MobaSiF::Template; 1 down 0 my $param = +{...}; $MobaSiF::Template::DEVELOP = 1; print MobaSiF::Template::render( “/path/to/template_file.html”, “/path/to/compiled_binary_file.bin”, $param);
  • 33.
  • 34.
  • 35. Benchmark! <Rivals> • Template Toolkit • Tenjin • HTML::Template::Pro • MobaSiF::Template
  • 36. Benchmark • / • 10,000 qps
  • 37. Machine • MacBook • OS X 10.5 Leopard • perl v.5.8.9 • 2.4GHz Core2 Duo • 4GB Memory
  • 38. Result. Benchmark#1
  • 39. Result. Benchmark#1 0 5000.00 10000.00 15000.00 20000.00 Template Toolkit 585.8 Tenjin 2421.3 HTML::Template::Pro 6451.6 MobaSiF::Template 17543.9
  • 40.
  • 42. binary template • (option)... • • XS
  • 44.
  • 45. NULL
  • 46. PLAIN REPLACE IF/ELSE LOOP / etc. NULL
  • 47. • • View(Template) =
  • 48. • Pre-Compiler • Mobile Pre-Compiler • compile files command • tests! •
  • 49.
  • 51. CPAN / github • http://search.cpan.org/~bobpp/MobaSiF- Template/ • http://github.com/bobpp/perl-MobaSiF- Template/