SlideShare a Scribd company logo

Common Pitfalls of Functional Programming and How to Avoid Them: A Mobile Gaming Platform Case Study

gree_tech
gree_tech

This material is presented on CUFP 2013. Functional programming is already an established technology is many areas. However, the lack of skilled developers has been a challenging hurdle in the adoption of such languages. It is easy for an inexperienced programmer to fall into the many traps of functional programming, resulting in a loss of productivity and bad software quality. Resource leaks caused by Haskell's lazy evaluation, for instance, are only the tip of the iceberg. Knowledge sharing and a mature tool-assisted development process are ways to avoid such pitfalls. At GREE, one of the largest mobile gaming companies, we use Haskell and Scala to develop major components of our platform, such as a distributed NoSQL solution, or an image storage infrastructure. However, only 11 programmers use functional programming on their daily task. In this talk, we will describe some unexpected functional programming issues we ran into, how we solved them and how we hope to avoid them in the future. We have developed a system testing framework to enhance regression testing, spent lots of time documenting pitfalls and introduced technical reviews. Recently, we even started holding lunchtime presentations about functional programming in order to attract beginners and prevent them from falling into the same traps.

1 of 29
Download to read offline
Common Pitfalls of Functional
Programming and How to Avoid Them:
A Mobile Gaming Platform Case Study
Sep 22, 2013

GREE, Inc.
Yasuaki Takebe

Copyright © GREE, Inc. All Rights Reserved.
Introduction
• Why Functional Programming?
•
•
•

Reliability: Eliminate runtime type error, implicit state, ...
High performance: 20-60 times faster than Perl, PHP, Ruby, ...
Productivity: Powerful and elegant, a vast number of libraries, ...

• However...
•

Memory leak

•
•
•

Data lost
Performance degradation
Crash

Copyright © GREE, Inc. All Rights Reserved.
Contents
• About ourselves
•

What we developed using functional programming

• Examples of pitfalls
• How to avoid them
•
•
•
•

Testing tool
Documentation
Technical review
Education

Copyright © GREE, Inc. All Rights Reserved.
About GREE (1/3)
• Overview of GREE's services
•
•

One of the largest mobile game platforms
37.2M users, 2000 games (as of Jun. 2013)

• Business
•
•
•
•
•
•

Social games
Platform: SNS, 3rd party games
Social media: mail magazine, news
Advertising and ad network
Licensing and merchandising
Venture capital

Copyright © GREE, Inc. All Rights Reserved.
About GREE (2/3)
• Example of GREE's products / services

• Social games
•
•
•

Modern War: War simulation game
Miniature Garden: Wonder Mail and Animal Island: Gardening game
...

• SNS app
Features
- Game portal
- See what friends are
playing
- Share updates, photos and
videos
- Notification from friends
when they like your posts

Copyright © GREE, Inc. All Rights Reserved.
About GREE (3/3)
• Company
•
•

Founded: Dec 7, 2004
Employees: 2582 (group, as of Jun. 2013)

• Common architecture
•
•

Client: Java, Objective-C, JavaScript, Unity/C#, ...
Server: PHP, MySQL, Flare (KVS), ...
•

Develop middleware for ourselves

• Functional programming
•
•

Started: Jun, 2012 (a Haskell project)
Engineers: Haskell: 4, Scala: 6

Copyright © GREE, Inc. All Rights Reserved.
What We Developed Using FP (1/2)
• KVS management system
•
•

Setup / destroy KVS nodes in response to hardware fault / sudden access
spike
Used in a social game app

• Components developed in Haskell
•
•
•

Frontend
Control server
Web admin
server

Copyright © GREE, Inc. All Rights Reserved.
What We Developed Using FP (2/2)
• Image storage gateway
•
•
•

Convert WebDAV to memcached / S3 API
Used in SNS photo uploader
Developed using Warp and http-conduit
Upload

PHP
WebDAV
Image
Storage
Gateway

Download

memcached

S3 API

SNS App
Flare Cluster

Flare

OpenStack Swift Cluster
storage
storage
Swift

storage
storage
Swift

Copyright © GREE, Inc. All Rights Reserved.
Examples of Pitfalls

Copyright © GREE, Inc. All Rights Reserved.
Pitfall 1: Leak by Lazy Evaluation
• Issue: Memory leak

• Cause
•
•

Frontend server keeps a list of active thread IDs in TVar for monitoring
Delete from thread ID list
modifyTVar' requestThreads $ ¥threads -> filter (tid /=) threads

•

But this reduces thread ID list only to WHNF
Copyright © GREE, Inc. All Rights Reserved.
Pitfall 1: Leak by Lazy Evaluation (Cont.)
• How to fix
•
•

Evaluate to normal form (or evaluate filters in this case)
In this case we fixed by evaluating length of threads as follows:
modifyTVar requestThreads $ ¥threads ->
let thread' = filter (tid /=) threads
in seq (length threads') threads'

• Pitfall
•
•

It is easy to mix up write to TVar / MVar with other IO operations, which
evaluate value to normal form
Easy to mix up modityTVar', strict version of modifyTVar, with other IO
operations which evaluate the value to normal form

Copyright © GREE, Inc. All Rights Reserved.
Pitfall 2: Race Condition
• Issue: Data put in a queue (very rarely) lost
• Cause
•
•
•

Queue is implemented using TQueue, which has two TVars of list
Dequeue from TQueue is wrapped by timeout, as readTQueue blocks
forever when no item in queue
Definition of timeout
timeout n f = do
pid <- myThreadId
ex <- fmap Timeout newUnique
handleJust (¥e -> if e == ex then Just () else Nothing)
(¥_ -> return Nothing)
(bracket (forkIO (threadDelay n >> throwTo pid ex))
(killThread)
(¥_ -> fmap Just f))

•
•

timeout invokes another thread which wait n microseconds and an
exception to throws current thread
Exception might be thrown when evaluation of f (IO action wrapped by
timeout) just finished
Copyright © GREE, Inc. All Rights Reserved.
Pitfall 2: Race Condition (Cont.)
• How to fix
•

Do not change state of queue in timeout
readRequest q = do
mRequest <- timeout 10 $ atomically $ do
request <- peekTQueue q
return request
case mRequest of
Just _ -> atomically $ tryReadTQueue q
Nothing -> return Nothing

• Pitfall
•
•

Because timeout is implemented as a higher-order function, it is easy to
compose with IO action without taking care of internal implementation
timeout can be used safely only with IO action which does not change
data, such as accept and connectTo

Copyright © GREE, Inc. All Rights Reserved.
Pitfall 3: Library Misuse
• Issue: Performance degradation

• Cause
•

This program uses http-conduit to connect to backend HTTP servers
periodically for health check
manager <- newManager def
http req manager

•
•

newManager forks thread to repeatedly collect stale connections
To finish this thread, closeManager must be called (from version 1.2.0)
Copyright © GREE, Inc. All Rights Reserved.
Pitfall 3: Library Misuse (Cont.)
• How to fix
•

Call closeManager or use withManager
withManager $ (¥manager -> http req manager)

• Pitfall
•
•

Specification of newManager was changed from 1.2.0
Haskell libraries are often developed very actively

Copyright © GREE, Inc. All Rights Reserved.
How to Avoid Pitfalls

Copyright © GREE, Inc. All Rights Reserved.
How to Avoid Pitfalls
• Overview of recurrence prevention method
Pitfall
Documentation

Requirement
analysis
&
Design

Technical
review

Coding

Unit testing

System
testing

Operation
&
Maintenance

System
testing
tool
Functional Programming Education

Copyright © GREE, Inc. All Rights Reserved.
System Testing Tool (1/4)
• Haskell has great unit testing framework
•

HUnit, QuickCheck

• Unit testing is not enough to find critical bugs
•
•
•

System testing
Stress testing
Aging testing (long-running stress testing)

• test-sandbox
•
•
•

System testing framework
Write system tests using HUnit or QuickCheck
Can be used for network applications and CUI tools

Copyright © GREE, Inc. All Rights Reserved.
System Testing Tool (2/4)
• Example: memcached test (HUnit)
setup = do
-- Register memcached using free TCP port to env
port <- getPort "memcached"
register "memcached" "/usr/bin/memcached" [ "-p", show port ] def
test1 = sandboxTest "Store" $ do
-- Send commant through registered TCP port
output <- sendTo "memcached" "set key 0 0 5¥r¥nvalue¥r¥n" 1
assertEqual "item is stored" "STORED¥r¥n" output
main =
defaultMain
[ sandboxTests "Example" $ do
setup
-- Setup env accessible from all tests
start "memcached"
sandboxTestGroup "All" [ test1, test2, ... ]
]

Copyright © GREE, Inc. All Rights Reserved.
System Testing Tool (3/4)
• Example: memcached test (QuickCheck)
•

For any string s, get(set s) == s

sandboxTest "Get and set" $ quickCheck $ do
-- Take any string
str <- pick arbitrary :: PropertyM Sandbox String

-- Get and set string
_ <- run $ sendTo "memcached"
(printf "set key 0 0 %d¥r¥n%s¥r¥n" (length str) str) 20
output <- run $ sendTo "memcached" "get key¥r¥n" 20
-- Check that we get the same string
assert $ printf "VALUE key 0 %d¥r¥n%s¥r¥nEND¥r¥n" (length str) str
== output

Copyright © GREE, Inc. All Rights Reserved.
System Testing Tool (4/4)
• Applied to
•
•

KVS management system
Flare (KVS written in C++)

• # of tests
•

Frontend server
•
•

•

Control server
•
•

•

49 property tests
103 system tests
45 system tests
5000+ assertions

Flare
•
•

Found many bugs
> 7000 tests

http://hackage.haskell.org/package/test-sandbox

Copyright © GREE, Inc. All Rights Reserved.
Documentation of Pitfalls (1/4)
• Problem report
•
•

Describe details of problem
Linked from bug tracking system

•
•
•
•
•
•

Timeline of issue
Temporary measure
Extent of influence
Detailed cause and how to fix
Recurrence prevention
...

•

Scattered among a lot of other problem reports

• Other FP programmers don't read them

Copyright © GREE, Inc. All Rights Reserved.
Documentation of Pitfalls (2/4)
• Aggregated document
•
•
•

Collect problems caused by functional programming
Summarize cause and how to fix for each item
"Writing Middleware in Haskell"

• Contents
•
•
•
•
•
•

Lazy evaluation and memory leak
Preforking and load balancing
Concurrent programming
Libraries
Profiling and optimization
Test and debug

• Other FP programmers still won't read it

Copyright © GREE, Inc. All Rights Reserved.
Documentation of Pitfalls (3/4)
• Automated check using hlint
•
•

Customize hlint to check pitfall
Put item number of aggregated document in hlint comment

warn "Non-strict TVar [1.1]" = modifyTVar ==> modifyTVar'
warn "Should not use timeout with STM [3.1]" =
timeout x (atomically f) ==> somethingElse
•

Check from Emacs

Copyright © GREE, Inc. All Rights Reserved.
Documentation of Pitfalls (4/4)
• Problems of hlint method
•
•
•

Not all pitfalls can be detected by hlint
High level design issue
Library issue (Ex. Version of http-conduit, hashable)

Copyright © GREE, Inc. All Rights Reserved.
Technical Review
• Established technical review process
•

Check feasibility of new technologies such as functional programming by
managements and other teams

Copyright © GREE, Inc. All Rights Reserved.
Education
• Brown bag FP meeting
•
•
•

Once or twice in a month
Scala and Haskell topics
"Make GREE a better place
through the power of FP"

• Education program for
new graduate
•

Haskell code puzzle from
Project Euler

Copyright © GREE, Inc. All Rights Reserved.
Conclusion
• Functional programming is great
•

We develop some key components of our services using FP

• But there are many pitfalls
•

Lazy evaluation, race condition, library misuse, ...

• We should avoid them
•
•
•
•

Testing tool
Documentation
Technical review
Education

Copyright © GREE, Inc. All Rights Reserved.
Copyright © GREE, Inc. All Rights Reserved.

Recommended

Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitDimitry Snezhkov
 
LISA2010 visualizations
LISA2010 visualizationsLISA2010 visualizations
LISA2010 visualizationsBrendan Gregg
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware styleSander Demeester
 
How Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for PerformanceBrendan Gregg
 
Freeze Drying for Capturing Environment-Sensitive Malware Alive
Freeze Drying for Capturing Environment-Sensitive Malware AliveFreeze Drying for Capturing Environment-Sensitive Malware Alive
Freeze Drying for Capturing Environment-Sensitive Malware AliveFFRI, Inc.
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Brendan Gregg
 
TFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU DelegatesTFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU DelegatesKoan-Sin Tan
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 

More Related Content

What's hot

JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsBrendan Gregg
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at ScaleAntony Messerl
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
Introduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementIntroduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementSasha Goldshtein
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingNikhil Mittal
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Pythoninfodox
 
Developping drivers on small machines
Developping drivers on small machinesDevelopping drivers on small machines
Developping drivers on small machinesAnne Nicolas
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patternsPeter Hlavaty
 
Performance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudPerformance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudBrendan Gregg
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Peter Hlavaty
 
YOW2021 Computing Performance
YOW2021 Computing PerformanceYOW2021 Computing Performance
YOW2021 Computing PerformanceBrendan Gregg
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel ExploitationzeroSteiner
 
Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10Honorary_BoT
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...InfinIT - Innovationsnetværket for it
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android BenchmarksKoan-Sin Tan
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringGeorg Schönberger
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Amazon Web Services
 

What's hot (20)

Attack on the Core
Attack on the CoreAttack on the Core
Attack on the Core
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Introduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementIntroduction to .NET Performance Measurement
Introduction to .NET Performance Measurement
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple Teaming
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Python
 
Developping drivers on small machines
Developping drivers on small machinesDevelopping drivers on small machines
Developping drivers on small machines
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
 
Performance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudPerformance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloud
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
 
YOW2021 Computing Performance
YOW2021 Computing PerformanceYOW2021 Computing Performance
YOW2021 Computing Performance
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel Exploitation
 
Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
 

Similar to Common Pitfalls of Functional Programming and How to Avoid Them: A Mobile Gaming Platform Case Study

DockerCon Europe 2018 Monitoring & Logging Workshop
DockerCon Europe 2018 Monitoring & Logging WorkshopDockerCon Europe 2018 Monitoring & Logging Workshop
DockerCon Europe 2018 Monitoring & Logging WorkshopBrian Christner
 
Early Software Development through Palladium Emulation
Early Software Development through Palladium EmulationEarly Software Development through Palladium Emulation
Early Software Development through Palladium EmulationRaghav Nayak
 
How to accelerate docker adoption with a simple and powerful user experience
How to accelerate docker adoption with a simple and powerful user experienceHow to accelerate docker adoption with a simple and powerful user experience
How to accelerate docker adoption with a simple and powerful user experienceDocker, Inc.
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsAnthony D Hendricks
 
Coverage Solutions on Emulators
Coverage Solutions on EmulatorsCoverage Solutions on Emulators
Coverage Solutions on EmulatorsDVClub
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...Yuji Kubota
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Pavel Chunyayev
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsGraham Dumpleton
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018The Linux Foundation
 
19-reliabilitytesting.ppt
19-reliabilitytesting.ppt19-reliabilitytesting.ppt
19-reliabilitytesting.pptAnilteaser
 
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...rschuppe
 
Open source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packagesOpen source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packagesRogue Wave Software
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyserAlex Moskvin
 
Mock cli with Python unittest
Mock cli with Python unittestMock cli with Python unittest
Mock cli with Python unittestSong Jin
 

Similar to Common Pitfalls of Functional Programming and How to Avoid Them: A Mobile Gaming Platform Case Study (20)

DockerCon Europe 2018 Monitoring & Logging Workshop
DockerCon Europe 2018 Monitoring & Logging WorkshopDockerCon Europe 2018 Monitoring & Logging Workshop
DockerCon Europe 2018 Monitoring & Logging Workshop
 
Early Software Development through Palladium Emulation
Early Software Development through Palladium EmulationEarly Software Development through Palladium Emulation
Early Software Development through Palladium Emulation
 
How to accelerate docker adoption with a simple and powerful user experience
How to accelerate docker adoption with a simple and powerful user experienceHow to accelerate docker adoption with a simple and powerful user experience
How to accelerate docker adoption with a simple and powerful user experience
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shells
 
Coverage Solutions on Emulators
Coverage Solutions on EmulatorsCoverage Solutions on Emulators
Coverage Solutions on Emulators
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Next-gen Automation Framework
Next-gen Automation FrameworkNext-gen Automation Framework
Next-gen Automation Framework
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
 
19-reliabilitytesting.ppt
19-reliabilitytesting.ppt19-reliabilitytesting.ppt
19-reliabilitytesting.ppt
 
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
 
Open source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packagesOpen source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packages
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Mock cli with Python unittest
Mock cli with Python unittestMock cli with Python unittest
Mock cli with Python unittest
 

More from gree_tech

アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜gree_tech
 
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介gree_tech
 
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表gree_tech
 
アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~gree_tech
 
長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化gree_tech
 
Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介gree_tech
 
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介gree_tech
 
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現についてSINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現についてgree_tech
 
海外展開と負荷試験
海外展開と負荷試験海外展開と負荷試験
海外展開と負荷試験gree_tech
 
翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組み翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組みgree_tech
 
組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違い組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違いgree_tech
 
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介gree_tech
 
データエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件についてデータエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件についてgree_tech
 
シェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジーシェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジーgree_tech
 
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-gree_tech
 
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話gree_tech
 
比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)gree_tech
 
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行gree_tech
 
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜gree_tech
 
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)gree_tech
 

More from gree_tech (20)

アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
 
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
 
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
 
アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~
 
長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化
 
Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介
 
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
 
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現についてSINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
 
海外展開と負荷試験
海外展開と負荷試験海外展開と負荷試験
海外展開と負荷試験
 
翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組み翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組み
 
組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違い組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違い
 
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
 
データエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件についてデータエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件について
 
シェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジーシェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジー
 
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
 
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
 
比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)
 
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
 
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
 
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
 

Recently uploaded

Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...ShapeBlue
 
AMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarAMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarThousandEyes
 
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...ShapeBlue
 
Mastering Play Store App Listing and Optimization
Mastering Play Store App Listing and OptimizationMastering Play Store App Listing and Optimization
Mastering Play Store App Listing and OptimizationAppsthentic Technology
 
AGFM - Toyota Coaster 1HZ Install Guide.pdf
AGFM - Toyota Coaster 1HZ Install Guide.pdfAGFM - Toyota Coaster 1HZ Install Guide.pdf
AGFM - Toyota Coaster 1HZ Install Guide.pdfRodneyThomas28
 
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfQ4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfTejal81
 
Improving IT Investment Decisions and Business Outcomes with Integrated Enter...
Improving IT Investment Decisions and Business Outcomes with Integrated Enter...Improving IT Investment Decisions and Business Outcomes with Integrated Enter...
Improving IT Investment Decisions and Business Outcomes with Integrated Enter...Cprime
 
GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...
GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...
GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...James Anderson
 
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024BookNet Canada
 
New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024ThousandEyes
 
AI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptxAI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptxUdaiappa Ramachandran
 
Java Optional (Kitworks Team Study 김성호 발표)
Java Optional (Kitworks Team Study 김성호 발표)Java Optional (Kitworks Team Study 김성호 발표)
Java Optional (Kitworks Team Study 김성호 발표)Wonjun Hwang
 
Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...
Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...
Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...2toLead Limited
 
Achieving Excellence IESVE for HVAC Simulation.pdf
Achieving Excellence IESVE for HVAC Simulation.pdfAchieving Excellence IESVE for HVAC Simulation.pdf
Achieving Excellence IESVE for HVAC Simulation.pdfIES VE
 
Establishing data sharing standards to promote global industry development
Establishing data sharing standards to promote global industry developmentEstablishing data sharing standards to promote global industry development
Establishing data sharing standards to promote global industry developmentThorsten Huelsmann
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceVijayananda Mohire
 
Boosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUG
Boosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUGBoosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUG
Boosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUGRick Ossendrijver
 
Key projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AIKey projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AIVijayananda Mohire
 
Geospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & EsriGeospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & EsriSafe Software
 
PrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5CompanyPrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5CompanyMustafa Kuğu
 

Recently uploaded (20)

Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
Elevating Cloud Infrastructure with Object Storage, DRS, VM Scheduling, and D...
 
AMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarAMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes Webinar
 
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
 
Mastering Play Store App Listing and Optimization
Mastering Play Store App Listing and OptimizationMastering Play Store App Listing and Optimization
Mastering Play Store App Listing and Optimization
 
AGFM - Toyota Coaster 1HZ Install Guide.pdf
AGFM - Toyota Coaster 1HZ Install Guide.pdfAGFM - Toyota Coaster 1HZ Install Guide.pdf
AGFM - Toyota Coaster 1HZ Install Guide.pdf
 
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfQ4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
 
Improving IT Investment Decisions and Business Outcomes with Integrated Enter...
Improving IT Investment Decisions and Business Outcomes with Integrated Enter...Improving IT Investment Decisions and Business Outcomes with Integrated Enter...
Improving IT Investment Decisions and Business Outcomes with Integrated Enter...
 
GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...
GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...
GDG Cloud Southlake 30 Brian Demers Breeding 10x Developers with Developer Pr...
 
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
Trending now: Book subjects on the move in the Canadian market - Tech Forum 2024
 
New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024
 
AI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptxAI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptx
 
Java Optional (Kitworks Team Study 김성호 발표)
Java Optional (Kitworks Team Study 김성호 발표)Java Optional (Kitworks Team Study 김성호 발표)
Java Optional (Kitworks Team Study 김성호 발표)
 
Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...
Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...
Microsoft x 2toLead Webinar Session 2 - How Employee Learning and Development...
 
Achieving Excellence IESVE for HVAC Simulation.pdf
Achieving Excellence IESVE for HVAC Simulation.pdfAchieving Excellence IESVE for HVAC Simulation.pdf
Achieving Excellence IESVE for HVAC Simulation.pdf
 
Establishing data sharing standards to promote global industry development
Establishing data sharing standards to promote global industry developmentEstablishing data sharing standards to promote global industry development
Establishing data sharing standards to promote global industry development
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial Intelligence
 
Boosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUG
Boosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUGBoosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUG
Boosting Developer Effectiveness with a Java platform team 1.4 - ArnhemJUG
 
Key projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AIKey projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AI
 
Geospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & EsriGeospatial Synergy: Amplifying Efficiency with FME & Esri
Geospatial Synergy: Amplifying Efficiency with FME & Esri
 
PrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5CompanyPrismCRM-RealEstate-SalesCRM_byCode5Company
PrismCRM-RealEstate-SalesCRM_byCode5Company
 

Common Pitfalls of Functional Programming and How to Avoid Them: A Mobile Gaming Platform Case Study

  • 1. Common Pitfalls of Functional Programming and How to Avoid Them: A Mobile Gaming Platform Case Study Sep 22, 2013 GREE, Inc. Yasuaki Takebe Copyright © GREE, Inc. All Rights Reserved.
  • 2. Introduction • Why Functional Programming? • • • Reliability: Eliminate runtime type error, implicit state, ... High performance: 20-60 times faster than Perl, PHP, Ruby, ... Productivity: Powerful and elegant, a vast number of libraries, ... • However... • Memory leak • • • Data lost Performance degradation Crash Copyright © GREE, Inc. All Rights Reserved.
  • 3. Contents • About ourselves • What we developed using functional programming • Examples of pitfalls • How to avoid them • • • • Testing tool Documentation Technical review Education Copyright © GREE, Inc. All Rights Reserved.
  • 4. About GREE (1/3) • Overview of GREE's services • • One of the largest mobile game platforms 37.2M users, 2000 games (as of Jun. 2013) • Business • • • • • • Social games Platform: SNS, 3rd party games Social media: mail magazine, news Advertising and ad network Licensing and merchandising Venture capital Copyright © GREE, Inc. All Rights Reserved.
  • 5. About GREE (2/3) • Example of GREE's products / services • Social games • • • Modern War: War simulation game Miniature Garden: Wonder Mail and Animal Island: Gardening game ... • SNS app Features - Game portal - See what friends are playing - Share updates, photos and videos - Notification from friends when they like your posts Copyright © GREE, Inc. All Rights Reserved.
  • 6. About GREE (3/3) • Company • • Founded: Dec 7, 2004 Employees: 2582 (group, as of Jun. 2013) • Common architecture • • Client: Java, Objective-C, JavaScript, Unity/C#, ... Server: PHP, MySQL, Flare (KVS), ... • Develop middleware for ourselves • Functional programming • • Started: Jun, 2012 (a Haskell project) Engineers: Haskell: 4, Scala: 6 Copyright © GREE, Inc. All Rights Reserved.
  • 7. What We Developed Using FP (1/2) • KVS management system • • Setup / destroy KVS nodes in response to hardware fault / sudden access spike Used in a social game app • Components developed in Haskell • • • Frontend Control server Web admin server Copyright © GREE, Inc. All Rights Reserved.
  • 8. What We Developed Using FP (2/2) • Image storage gateway • • • Convert WebDAV to memcached / S3 API Used in SNS photo uploader Developed using Warp and http-conduit Upload PHP WebDAV Image Storage Gateway Download memcached S3 API SNS App Flare Cluster Flare OpenStack Swift Cluster storage storage Swift storage storage Swift Copyright © GREE, Inc. All Rights Reserved.
  • 9. Examples of Pitfalls Copyright © GREE, Inc. All Rights Reserved.
  • 10. Pitfall 1: Leak by Lazy Evaluation • Issue: Memory leak • Cause • • Frontend server keeps a list of active thread IDs in TVar for monitoring Delete from thread ID list modifyTVar' requestThreads $ ¥threads -> filter (tid /=) threads • But this reduces thread ID list only to WHNF Copyright © GREE, Inc. All Rights Reserved.
  • 11. Pitfall 1: Leak by Lazy Evaluation (Cont.) • How to fix • • Evaluate to normal form (or evaluate filters in this case) In this case we fixed by evaluating length of threads as follows: modifyTVar requestThreads $ ¥threads -> let thread' = filter (tid /=) threads in seq (length threads') threads' • Pitfall • • It is easy to mix up write to TVar / MVar with other IO operations, which evaluate value to normal form Easy to mix up modityTVar', strict version of modifyTVar, with other IO operations which evaluate the value to normal form Copyright © GREE, Inc. All Rights Reserved.
  • 12. Pitfall 2: Race Condition • Issue: Data put in a queue (very rarely) lost • Cause • • • Queue is implemented using TQueue, which has two TVars of list Dequeue from TQueue is wrapped by timeout, as readTQueue blocks forever when no item in queue Definition of timeout timeout n f = do pid <- myThreadId ex <- fmap Timeout newUnique handleJust (¥e -> if e == ex then Just () else Nothing) (¥_ -> return Nothing) (bracket (forkIO (threadDelay n >> throwTo pid ex)) (killThread) (¥_ -> fmap Just f)) • • timeout invokes another thread which wait n microseconds and an exception to throws current thread Exception might be thrown when evaluation of f (IO action wrapped by timeout) just finished Copyright © GREE, Inc. All Rights Reserved.
  • 13. Pitfall 2: Race Condition (Cont.) • How to fix • Do not change state of queue in timeout readRequest q = do mRequest <- timeout 10 $ atomically $ do request <- peekTQueue q return request case mRequest of Just _ -> atomically $ tryReadTQueue q Nothing -> return Nothing • Pitfall • • Because timeout is implemented as a higher-order function, it is easy to compose with IO action without taking care of internal implementation timeout can be used safely only with IO action which does not change data, such as accept and connectTo Copyright © GREE, Inc. All Rights Reserved.
  • 14. Pitfall 3: Library Misuse • Issue: Performance degradation • Cause • This program uses http-conduit to connect to backend HTTP servers periodically for health check manager <- newManager def http req manager • • newManager forks thread to repeatedly collect stale connections To finish this thread, closeManager must be called (from version 1.2.0) Copyright © GREE, Inc. All Rights Reserved.
  • 15. Pitfall 3: Library Misuse (Cont.) • How to fix • Call closeManager or use withManager withManager $ (¥manager -> http req manager) • Pitfall • • Specification of newManager was changed from 1.2.0 Haskell libraries are often developed very actively Copyright © GREE, Inc. All Rights Reserved.
  • 16. How to Avoid Pitfalls Copyright © GREE, Inc. All Rights Reserved.
  • 17. How to Avoid Pitfalls • Overview of recurrence prevention method Pitfall Documentation Requirement analysis & Design Technical review Coding Unit testing System testing Operation & Maintenance System testing tool Functional Programming Education Copyright © GREE, Inc. All Rights Reserved.
  • 18. System Testing Tool (1/4) • Haskell has great unit testing framework • HUnit, QuickCheck • Unit testing is not enough to find critical bugs • • • System testing Stress testing Aging testing (long-running stress testing) • test-sandbox • • • System testing framework Write system tests using HUnit or QuickCheck Can be used for network applications and CUI tools Copyright © GREE, Inc. All Rights Reserved.
  • 19. System Testing Tool (2/4) • Example: memcached test (HUnit) setup = do -- Register memcached using free TCP port to env port <- getPort "memcached" register "memcached" "/usr/bin/memcached" [ "-p", show port ] def test1 = sandboxTest "Store" $ do -- Send commant through registered TCP port output <- sendTo "memcached" "set key 0 0 5¥r¥nvalue¥r¥n" 1 assertEqual "item is stored" "STORED¥r¥n" output main = defaultMain [ sandboxTests "Example" $ do setup -- Setup env accessible from all tests start "memcached" sandboxTestGroup "All" [ test1, test2, ... ] ] Copyright © GREE, Inc. All Rights Reserved.
  • 20. System Testing Tool (3/4) • Example: memcached test (QuickCheck) • For any string s, get(set s) == s sandboxTest "Get and set" $ quickCheck $ do -- Take any string str <- pick arbitrary :: PropertyM Sandbox String -- Get and set string _ <- run $ sendTo "memcached" (printf "set key 0 0 %d¥r¥n%s¥r¥n" (length str) str) 20 output <- run $ sendTo "memcached" "get key¥r¥n" 20 -- Check that we get the same string assert $ printf "VALUE key 0 %d¥r¥n%s¥r¥nEND¥r¥n" (length str) str == output Copyright © GREE, Inc. All Rights Reserved.
  • 21. System Testing Tool (4/4) • Applied to • • KVS management system Flare (KVS written in C++) • # of tests • Frontend server • • • Control server • • • 49 property tests 103 system tests 45 system tests 5000+ assertions Flare • • Found many bugs > 7000 tests http://hackage.haskell.org/package/test-sandbox Copyright © GREE, Inc. All Rights Reserved.
  • 22. Documentation of Pitfalls (1/4) • Problem report • • Describe details of problem Linked from bug tracking system • • • • • • Timeline of issue Temporary measure Extent of influence Detailed cause and how to fix Recurrence prevention ... • Scattered among a lot of other problem reports • Other FP programmers don't read them Copyright © GREE, Inc. All Rights Reserved.
  • 23. Documentation of Pitfalls (2/4) • Aggregated document • • • Collect problems caused by functional programming Summarize cause and how to fix for each item "Writing Middleware in Haskell" • Contents • • • • • • Lazy evaluation and memory leak Preforking and load balancing Concurrent programming Libraries Profiling and optimization Test and debug • Other FP programmers still won't read it Copyright © GREE, Inc. All Rights Reserved.
  • 24. Documentation of Pitfalls (3/4) • Automated check using hlint • • Customize hlint to check pitfall Put item number of aggregated document in hlint comment warn "Non-strict TVar [1.1]" = modifyTVar ==> modifyTVar' warn "Should not use timeout with STM [3.1]" = timeout x (atomically f) ==> somethingElse • Check from Emacs Copyright © GREE, Inc. All Rights Reserved.
  • 25. Documentation of Pitfalls (4/4) • Problems of hlint method • • • Not all pitfalls can be detected by hlint High level design issue Library issue (Ex. Version of http-conduit, hashable) Copyright © GREE, Inc. All Rights Reserved.
  • 26. Technical Review • Established technical review process • Check feasibility of new technologies such as functional programming by managements and other teams Copyright © GREE, Inc. All Rights Reserved.
  • 27. Education • Brown bag FP meeting • • • Once or twice in a month Scala and Haskell topics "Make GREE a better place through the power of FP" • Education program for new graduate • Haskell code puzzle from Project Euler Copyright © GREE, Inc. All Rights Reserved.
  • 28. Conclusion • Functional programming is great • We develop some key components of our services using FP • But there are many pitfalls • Lazy evaluation, race condition, library misuse, ... • We should avoid them • • • • Testing tool Documentation Technical review Education Copyright © GREE, Inc. All Rights Reserved.
  • 29. Copyright © GREE, Inc. All Rights Reserved.