(Ebook) High Performance Python by Micha
Gorelick, Ian Ozsvald download
https://ebooknice.com/product/high-performance-python-42370716
Download more ebook instantly today at https://ebooknice.com
Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...
Start reading on any device today!
(Ebook) High Performance Python: Practical Performant Programming for Humans by
Micha Gorelick, Ian Ozsvald ISBN 9781492055020, 1492055026
https://ebooknice.com/product/high-performance-python-practical-performant-
programming-for-humans-24064792
ebooknice.com
(Ebook) Python High Performance by Gabriele Lanaro ISBN 9781787282896, 1787282899
https://ebooknice.com/product/python-high-performance-6781574
ebooknice.com
(Ebook) Python High Performance Programming by Gabriele Lanaro ISBN 9781783288458,
1783288450
https://ebooknice.com/product/python-high-performance-programming-43140680
ebooknice.com
(Ebook) Mastering Python High Performance by Fernando Doglio ISBN 9781783989300,
1783989300
https://ebooknice.com/product/mastering-python-high-performance-6809374
ebooknice.com
(Ebook) Python High Performance Programming by Gabriele Lanaro ISBN 9781783288458,
1783288450
https://ebooknice.com/product/python-high-performance-programming-43192998
ebooknice.com
(Ebook) Python High Performance Programming: Boost the performance of your Python
programs using advanced techniques by Gabriele Lanaro ISBN 9781783288458,
9781782163367, 9781782161523, 9781782163923, 9781782171249, 1783288450, 1782163360,
178216152X, 1782163921
https://ebooknice.com/product/python-high-performance-programming-boost-the-
performance-of-your-python-programs-using-advanced-techniques-4769998
ebooknice.com
(Ebook) Fast Python: High performance techniques for large datasets (MEAP V10) by
Tiago Rodrigues Antao ISBN 9781617297939, 1617297933
https://ebooknice.com/product/fast-python-high-performance-techniques-for-large-
datasets-meap-v10-47525652
ebooknice.com
(Ebook) Performance Through Learning: Knowledge Management in Practice (Improving
Human Performance) by Carol Gorelick, Kurt April, Ph.D., Nick Milton ISBN
9780750675826, 9781417537303, 0750675829, 1417537302
https://ebooknice.com/product/performance-through-learning-knowledge-management-
in-practice-improving-human-performance-1778048
ebooknice.com
(Ebook) High-Performance Web Apps with FastAPI: The Asynchronous Web Framework Based
on Modern Python by Malhar Lathkar ISBN 9781484291771, 1484291778
https://ebooknice.com/product/high-performance-web-apps-with-fastapi-the-
asynchronous-web-framework-based-on-modern-python-48333936
ebooknice.com
1. Foreword
2. Preface
a. Who This Book Is For
b. Who This Book Is Not For
c. What You’ll Learn
d. Python 3
e. Changes from Python 2.7
f. License
g. How to Make an Attribution
h. Errata and Feedback
i. Conventions Used in This Book
j. Using Code Examples
k. O’Reilly Online Learning
l. How to Contact Us
m. Acknowledgments
3. 1. Understanding Performant Python
a. The Fundamental Computer System
i. Computing Units
ii. Memory Units
iii. Communications Layers
b. Putting the Fundamental Elements Together
i. Idealized Computing Versus the Python
Virtual Machine
c. So Why Use Python?
d. How to Be a Highly Performant Programmer
i. Good Working Practices
ii. Some Thoughts on Good Notebook
Practice
iii. Getting the Joy Back into Your Work
4. 2. Profiling to Find Bottlenecks
a. Profiling Efficiently
b. Introducing the Julia Set
c. Calculating the Full Julia Set
d. Simple Approaches to Timing—print and a
Decorator
e. Simple Timing Using the Unix time Command
f. Using the cProfile Module
g. Visualizing cProfile Output with SnakeViz
h. Using line_profiler for Line-by-Line
Measurements
i. Using memory_profiler to Diagnose Memory
Usage
j. Introspecting an Existing Process with PySpy
k. Bytecode: Under the Hood
i. Using the dis Module to Examine
CPython Bytecode
ii. Different Approaches, Different
Complexity
l. Unit Testing During Optimization to Maintain
Correctness
i. No-op @profile Decorator
m. Strategies to Profile Your Code Successfully
n. Wrap-Up
5. 3. Lists and Tuples
a. A More Efficient Search
b. Lists Versus Tuples
i. Lists as Dynamic Arrays
ii. Tuples as Static Arrays
c. Wrap-Up
6. 4. Dictionaries and Sets
a. How Do Dictionaries and Sets Work?
i. Inserting and Retrieving
ii. Deletion
iii. Resizing
iv. Hash Functions and Entropy
b. Dictionaries and Namespaces
c. Wrap-Up
7. 5. Iterators and Generators
a. Iterators for Infinite Series
b. Lazy Generator Evaluation
c. Wrap-Up
8. 6. Matrix and Vector Computation
a. Introduction to the Problem
b. Aren’t Python Lists Good Enough?
i. Problems with Allocating Too Much
c. Memory Fragmentation
i. Understanding perf
ii. Making Decisions with perf’s Output
iii. Enter numpy
d. Applying numpy to the Diffusion Problem
i. Memory Allocations and In-Place
Operations
ii. Selective Optimizations: Finding What
Needs to Be Fixed
e. numexpr: Making In-Place Operations Faster
and Easier
f. A Cautionary Tale: Verify “Optimizations”
(scipy)
g. Lessons from Matrix Optimizations
h. Pandas
i. Pandas’s Internal Model
ii. Applying a Function to Many Rows of
Data
iii. Building DataFrames and Series from
Partial Results Rather than
Concatenating
iv. There’s More Than One (and Possibly a
Faster) Way to Do a Job
v. Advice for Effective Pandas
Development
i. Wrap-Up
9. 7. Compiling to C
a. What Sort of Speed Gains Are Possible?
b. JIT Versus AOT Compilers
c. Why Does Type Information Help the Code
Run Faster?
d. Using a C Compiler
e. Reviewing the Julia Set Example
f. Cython
i. Compiling a Pure Python Version
Using Cython
g. pyximport
i. Cython Annotations to Analyze a Block
of Code
ii. Adding Some Type Annotations
h. Cython and numpy
i. Parallelizing the Solution with OpenMP
on One Machine
i. Numba
i. Numba to Compile NumPy for Pandas
j. PyPy
i. Garbage Collection Differences
ii. Running PyPy and Installing Modules
k. A Summary of Speed Improvements
l. When to Use Each Technology
i. Other Upcoming Projects
m. Graphics Processing Units (GPUs)
i. Dynamic Graphs: PyTorch
ii. Basic GPU Profiling
iii. Performance Considerations of GPUs
iv. When to Use GPUs
n. Foreign Function Interfaces
i. ctypes
ii. cffi
iii. f2py
iv. CPython Module
o. Wrap-Up
10. 8. Asynchronous I/O
a. Introduction to Asynchronous Programming
b. How Does async/await Work?
i. Serial Crawler
ii. Gevent
iii. tornado
iv. aiohttp
c. Shared CPU–I/O Workload
i. Serial
ii. Batched Results
iii. Full Async
d. Wrap-Up
11. 9. The multiprocessing Module
a. An Overview of the multiprocessing Module
b. Estimating Pi Using the Monte Carlo Method
c. Estimating Pi Using Processes and Threads
i. Using Python Objects
ii. Replacing multiprocessing with Joblib
iii. Random Numbers in Parallel Systems
iv. Using numpy
d. Finding Prime Numbers
i. Queues of Work
e. Verifying Primes Using Interprocess
Communication
i. Serial Solution
ii. Naive Pool Solution
iii. A Less Naive Pool Solution
iv. Using Manager.Value as a Flag
v. Using Redis as a Flag
vi. Using RawValue as a Flag
vii. Using mmap as a Flag
viii. Using mmap as a Flag Redux
f. Sharing numpy Data with multiprocessing
g. Synchronizing File and Variable Access
i. File Locking
ii. Locking a Value
h. Wrap-Up
12. 10. Clusters and Job Queues
a. Benefits of Clustering
b. Drawbacks of Clustering
i. $462 Million Wall Street Loss Through
Poor Cluster Upgrade Strategy
ii. Skype’s 24-Hour Global Outage
c. Common Cluster Designs
d. How to Start a Clustered Solution
e. Ways to Avoid Pain When Using Clusters
f. Two Clustering Solutions
i. Using IPython Parallel to Support
Research
ii. Parallel Pandas with Dask
g. NSQ for Robust Production Clustering
i. Queues
ii. Pub/sub
iii. Distributed Prime Calculation
h. Other Clustering Tools to Look At
i. Docker
i. Docker’s Performance
ii. Advantages of Docker
j. Wrap-Up
13. 11. Using Less RAM
a. Objects for Primitives Are Expensive
i. The array Module Stores Many
Primitive Objects Cheaply
ii. Using Less RAM in NumPy with
NumExpr
b. Understanding the RAM Used in a Collection
c. Bytes Versus Unicode
d. Efficiently Storing Lots of Text in RAM
i. Trying These Approaches on 11 Million
Tokens
e. Modeling More Text with Scikit-Learn’s
FeatureHasher
f. Introducing DictVectorizer and FeatureHasher
i. Comparing DictVectorizer and
FeatureHasher on a Real Problem
g. SciPy’s Sparse Matrices
h. Tips for Using Less RAM
i. Probabilistic Data Structures
i. Very Approximate Counting with a 1-
Byte Morris Counter
ii. K-Minimum Values
iii. Bloom Filters
iv. LogLog Counter
v. Real-World Example
14. 12. Lessons from the Field
a. Streamlining Feature Engineering Pipelines
with Feature-engine
i. Feature Engineering for Machine
Learning
ii. The Hard Task of Deploying Feature
Engineering Pipelines
iii. Leveraging the Power of Open Source
Python Libraries
iv. Feature-engine Smooths Building and
Deployment of Feature Engineering
Pipelines
v. Helping with the Adoption of a New
Open Source Package
vi. Developing, Maintaining, and
Encouraging Contribution to Open
Source Libraries
b. Highly Performant Data Science Teams
i. How Long Will It Take?
ii. Discovery and Planning
iii. Managing Expectations and Delivery
c. Numba
i. A Simple Example
ii. Best Practices and Recommendations
iii. Getting Help
d. Optimizing Versus Thinking
e. Adaptive Lab’s Social Media Analytics (2014)
i. Python at Adaptive Lab
ii. SoMA’s Design
iii. Our Development Methodology
iv. Maintaining SoMA
v. Advice for Fellow Engineers
f. Making Deep Learning Fly with
RadimRehurek.com (2014)
i. The Sweet Spot
ii. Lessons in Optimizing
iii. Conclusion
g. Large-Scale Productionized Machine Learning
at Lyst.com (2014)
i. Cluster Design
ii. Code Evolution in a Fast-Moving Start-
Up
iii. Building the Recommendation Engine
iv. Reporting and Monitoring
v. Some Advice
h. Large-Scale Social Media Analysis at Smesh
(2014)
i. Python’s Role at Smesh
ii. The Platform
iii. High Performance Real-Time String
Matching
iv. Reporting, Monitoring, Debugging, and
Deployment
i. PyPy for Successful Web and Data Processing
Systems (2014)
i. Prerequisites
ii. The Database
iii. The Web Application
iv. OCR and Translation
v. Task Distribution and Workers
vi. Conclusion
j. Task Queues at Lanyrd.com (2014)
i. Python’s Role at Lanyrd
ii. Making the Task Queue Performant
iii. Reporting, Monitoring, Debugging, and
Deployment
iv. Advice to a Fellow Developer
15. Index
High Performance Python
SECOND EDITION
Practical Performant Programming for
Humans
Micha Gorelick and Ian Ozsvald
High Performance Python
by Micha Gorelick and Ian Ozsvald
Copyright © 2020 Micha Gorelick and Ian Ozsvald. All rights
reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway
North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or
sales promotional use. Online editions are also available for
most titles (http://oreilly.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Acquisitions Editor: Tyler Ortman Indexer: Potomac Indexing, LLC
Development Editor: Sarah Grey Interior Designer: David Futato
Production Editor: Christopher
Faucher
Cover Designer: Karen
Montgomery
Copyeditor: Arthur Johnson Illustrator: Rebecca Demarest
Proofreader: Sharon Wilkey
September 2014: First Edition
May 2020: Second Edition
Revision History for the Second Edition
2020-04-30: First release
See http://oreilly.com/catalog/errata.csp?isbn=9781492055020
for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media,
Inc. High Performance Python, the cover image, and related
trade dress are trademarks of O’Reilly Media, Inc.
The views expressed in this work are those of the authors, and
do not represent the publisher’s views. While the publisher and
the authors have used good faith efforts to ensure that the
information and instructions contained in this work are
accurate, the publisher and the authors disclaim all
responsibility for errors or omissions, including without
limitation responsibility for damages resulting from the use of or
reliance on this work. Use of the information and instructions
contained in this work is at your own risk. If any code samples
or other technology this work contains or describes is subject
to open source licenses or the intellectual property rights of
others, it is your responsibility to ensure that your use thereof
complies with such licenses and/or rights.
High Performance Python is available under the Creative
Commons Attribution-NonCommercial-NoDerivs 3.0
International License.
978-1-492-05502-0
[LSI]
Foreword
When you think about high performance computing, you might
imagine giant clusters of machines modeling complex weather
phenomena or trying to understand signals in data collected
about far-off stars. It’s easy to assume that only people building
specialized systems should worry about the performance
characteristics of their code. By picking up this book, you’ve
taken a step toward learning the theory and practices you’ll
need to write highly performant code. Every programmer can
benefit from understanding how to build performant systems.
There are an obvious set of applications that are just on the
edge of possible, and you won’t be able to approach them
without writing optimally performant code. If that’s your
practice, you’re in the right place. But there is a much broader
set of applications that can benefit from performant code.
We often think that new technical capabilities are what drives
innovation, but I’m equally fond of capabilities that increase the
accessibility of technology by orders of magnitude. When
something becomes ten times cheaper in time or compute
costs, suddenly the set of applications you can address is
wider than you imagined.
The first time this principle manifested in my own work was
over a decade ago, when I was working at a social media
company, and we ran an analysis over multiple terabytes of
data to determine whether people clicked on more photos of
cats or dogs on social media.
It was dogs, of course. Cats just have better branding.
This was an outstandingly frivolous use of compute time and
infrastructure at the time! Gaining the ability to apply
techniques that had previously been restricted to sufficiently
high-value applications, such as fraud detection, to a
seemingly trivial question opened up a new world of now-
accessible possibilities. We were able to take what we learned
from these experiments and build a whole new set of products
in search and content discovery.
For an example that you might encounter today, consider a
machine-learning system that recognizes unexpected animals
or people in security video footage. A sufficiently performant
system could allow you to embed that model into the camera
itself, improving privacy or, even if running in the cloud, using
significantly less compute and power—benefiting the
environment and reducing your operating costs. This can free
up resources for you to look at adjacent problems, potentially
building a more valuable system.
We all desire to create systems that are effective, easy to
understand, and performant. Unfortunately, it often feels like
we have to pick two (or one) out of the three! High
Performance Python is a handbook for people who want to
make things that are capable of all three.
This book stands apart from other texts on the subject in three
ways. First, it’s written for us—humans who write code. You’ll
find all of the context you need to understand why you might
make certain choices. Second, Gorelick and Ozsvald do a
wonderful job of curating and explaining the necessary theory
to support that context. Finally, in this updated edition, you’ll
learn the specific quirks of the most useful libraries for
implementing these approaches today.
This is one of a rare class of programming books that will
change the way you think about the practice of programming.
I’ve given this book to many people who could benefit from the
additional tools it provides. The ideas that you’ll explore in its
pages will make you a better programmer, no matter what
language or environment you choose to work in.
Enjoy the adventure.
Hilary Mason,
Data Scientist in Residence at Accel
Preface
Python is easy to learn. You’re probably here because now that
your code runs correctly, you need it to run faster. You like the
fact that your code is easy to modify and you can iterate with
ideas quickly. The trade-off between easy to develop and runs
as quickly as I need is a well-understood and often-bemoaned
phenomenon. There are solutions.
Some people have serial processes that have to run faster.
Others have problems that could take advantage of multicore
architectures, clusters, or graphics processing units. Some
need scalable systems that can process more or less as
expediency and funds allow, without losing reliability. Others
will realize that their coding techniques, often borrowed from
other languages, perhaps aren’t as natural as examples they
see from others.
In this book we will cover all of these topics, giving practical
guidance for understanding bottlenecks and producing faster
and more scalable solutions. We also include some war stories
from those who went ahead of you, who took the knocks so
you don’t have to.
Python is well suited for rapid development, production
deployments, and scalable systems. The ecosystem is full of
people who are working to make it scale on your behalf,
leaving you more time to focus on the more challenging tasks
around you.
Who This Book Is For
You’ve used Python for long enough to have an idea about why
certain things are slow and to have seen technologies like
Cython, numpy, and PyPy being discussed as possible
solutions. You might also have programmed with other
languages and so know that there’s more than one way to
solve a performance problem.
While this book is primarily aimed at people with CPU-bound
problems, we also look at data transfer and memory-bound
solutions. Typically, these problems are faced by scientists,
engineers, quants, and academics.
We also look at problems that a web developer might face,
including the movement of data and the use of just-in-time (JIT)
compilers like PyPy and asynchronous I/O for easy-win
performance gains.
It might help if you have a background in C (or C++, or maybe
Java), but it isn’t a prerequisite. Python’s most common
interpreter (CPython—the standard you normally get if you type
python at the command line) is written in C, and so the hooks
and libraries all expose the gory inner C machinery. There are
lots of other techniques that we cover that don’t assume any
knowledge of C.
You might also have a lower-level knowledge of the CPU,
memory architecture, and data buses, but again, that’s not
strictly necessary.
Who This Book Is Not For
This book is meant for intermediate to advanced Python
programmers. Motivated novice Python programmers may be
able to follow along as well, but we recommend having a solid
Python foundation.
We don’t cover storage-system optimization. If you have a SQL
or NoSQL bottleneck, then this book probably won’t help you.
What You’ll Learn
Your authors have been working with large volumes of data, a
requirement for I want the answers faster! and a need for
scalable architectures, for many years in both industry and
academia. We’ll try to impart our hard-won experience to save
you from making the mistakes that we’ve made.
At the start of each chapter, we’ll list questions that the
following text should answer. (If it doesn’t, tell us and we’ll fix it
in the next revision!)
We cover the following topics:
Background on the machinery of a computer so you
know what’s happening behind the scenes
Lists and tuples—the subtle semantic and speed
differences in these fundamental data structures
Dictionaries and sets—memory allocation strategies
and access algorithms in these important data
structures
Iterators—how to write in a more Pythonic way and
open the door to infinite data streams using iteration
Pure Python approaches—how to use Python and its
modules effectively
Matrices with numpy—how to use the beloved numpy
library like a beast
Compilation and just-in-time computing—processing
faster by compiling down to machine code, making
sure you’re guided by the results of profiling
Concurrency—ways to move data efficiently
multiprocessing—various ways to use the built-in
multiprocessing library for parallel computing and
to efficiently share numpy matrices, and some costs
and benefits of interprocess communication (IPC)
Cluster computing—convert your multiprocessing
code to run on a local or remote cluster for both
research and production systems
Using less RAM—approaches to solving large
problems without buying a humungous computer
Lessons from the field—lessons encoded in war stories
from those who took the blows so you don’t have to
Python 3
Python 3 is the standard version of Python as of 2020, with
Python 2.7 deprecated after a 10-year migration process. If
you’re still on Python 2.7, you’re doing it wrong—many libraries
are no longer supported for your line of Python, and support
will become more expensive over time. Please do the
community a favor and migrate to Python 3, and make sure
that all new projects use Python 3.
In this book, we use 64-bit Python. Whilst 32-bit Python is
supported, it is far less common for scientific work. We’d
expect all the libraries to work as usual, but numeric precision,
which depends on the number of bits available for counting, is
likely to change. 64-bit is dominant in this field, along with *nix
environments (often Linux or Mac). 64-bit lets you address
larger amounts of RAM. *nix lets you build applications that can
be deployed and configured in well-understood ways with well-
understood behaviors.
If you’re a Windows user, you’ll have to buckle up. Most of
what we show will work just fine, but some things are OS-
specific, and you’ll have to research a Windows solution. The
biggest difficulty a Windows user might face is the installation
of modules: research in sites like Stack Overflow should give
you the solutions you need. If you’re on Windows, having a
virtual machine (e.g., using VirtualBox) with a running Linux
installation might help you to experiment more freely.
Windows users should definitely look at a packaged solution
like those available through Anaconda, Canopy, Python(x,y), or
Sage. These same distributions will make the lives of Linux
and Mac users far simpler too.
Changes from Python 2.7
If you’ve upgraded from Python 2.7, you might not be aware of
a few relevant changes:
/ meant integer division in Python 2.7, whereas it
performs float division in Python 3.
str and unicode were used to represent text data in
Python 2.7; in Python 3, everything is a str, and these
are always Unicode. For clarity, a bytes type is used if
we’re using unencoded byte sequences.
If you’re in the process of upgrading your code, two good
guides are “Porting Python 2 Code to Python 3” and
“Supporting Python 3: An in-depth guide”. With a distribution
like Anaconda or Canopy, you can run both Python 2 and
Python 3 simultaneously—this will simplify your porting.
License
This book is licensed under Creative Commons Attribution-
NonCommercial-NoDerivs 3.0.
You’re welcome to use this book for noncommercial purposes,
including for noncommercial teaching. The license allows only
for complete reproductions; for partial reproductions, please
contact O’Reilly (see “How to Contact Us”). Please attribute the
book as noted in the following section.
We negotiated that the book should have a Creative Commons
license so the contents could spread further around the world.
We’d be quite happy to receive a beer if this decision has
helped you. We suspect that the O’Reilly staff would feel
similarly about the beer.
How to Make an Attribution
The Creative Commons license requires that you attribute your
use of a part of this book. Attribution just means that you
should write something that someone else can follow to find
this book. The following would be sensible: “High Performance
Python, 2nd ed., by Micha Gorelick and Ian Ozsvald (O’Reilly).
Copyright 2020 Micha Gorelick and Ian Ozsvald, 978-1-492-
05502-0.”
Errata and Feedback
We encourage you to review this book on public sites like
Amazon—please help others understand if they would benefit
from this book! You can also email us at
feedback@highperformancepython.com.
We’re particularly keen to hear about errors in the book,
successful use cases where the book has helped you, and high
performance techniques that we should cover in the next
edition. You can access the web page for this book at
https://oreil.ly/high-performance-python-2e.
Complaints are welcomed through the instant-complaint-
transmission-service > /dev/null.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames,
and file extensions.
Constant width
Used for program listings, as well as within paragraphs to
refer to program elements such as variable or function
names, databases, datatypes, environment variables,
statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally
by the user.
Constant width italic
Shows text that should be replaced with user-supplied
values or by values determined by context.
TIP
This element signifies a tip, suggestion, or critical thinking question.
NOTE
This element signifies a general note.
WARNING
This element indicates a warning or caution.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is
available for download at
https://github.com/mynameisfiber/high_performance_python_2
e.
If you have a technical question or a problem using the code
examples, please send email to bookquestions@oreilly.com.
This book is here to help you get your job done. In general, if
example code is offered with this book, you may use it in your
programs and documentation. You do not need to contact us
for permission unless you’re reproducing a significant portion of
the code. For example, writing a program that uses several
chunks of code from this book does not require permission.
Selling or distributing examples from O’Reilly books does
require permission. Answering a question by citing this book
and quoting example code does not require permission.
Incorporating a significant amount of example code from this
book into your product’s documentation does require
permission.
If you feel your use of code examples falls outside fair use or
the permission given above, feel free to contact us at
permissions@oreilly.com.
O’Reilly Online Learning
NOTE
For more than 40 years, O’Reilly Media has provided technology and
business training, knowledge, and insight to help companies succeed.
Our unique network of experts and innovators share their
knowledge and expertise through books, articles, and our
online learning platform. O’Reilly’s online learning platform
gives you on-demand access to live training courses, in-depth
learning paths, interactive coding environments, and a vast
collection of text and video from O’Reilly and 200+ other
publishers. For more information, visit http://oreilly.com.
How to Contact Us
Please address comments and questions concerning this book
to the publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
Email bookquestions@oreilly.com to comment or ask technical
questions about this book.
For news and more information about our books and courses,
see our website at http://oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://youtube.com/oreillymedia
Acknowledgments
Hilary Mason wrote our foreword—thanks for composing such
a wonderful opening narrative for our book. Giles Weaver and
Dimitri Denisjonok provided invaluable technical feedback on
this edition; great work, chaps.
Thanks to Patrick Cooper, Kyran Dale, Dan Foreman-Mackey,
Calvin Giles, Brian Granger, Jamie Matthews, John
Montgomery, Christian Schou Oxvig, Matt “snakes” Reiferson,
Balthazar Rouberol, Michael Skirpan, Luke Underwood, Jake
Vanderplas, and William Winter for invaluable feedback and
contributions.
Ian thanks his wife, Emily, for letting him disappear for another
eight months to write this second edition (thankfully, she’s
terribly understanding). Ian apologizes to his dog for sitting and
writing rather than walking in the woods quite as much as she’d
have liked.
Micha thanks Marion and the rest of his friends and family for
being so patient while he learned to write.
O’Reilly editors are rather lovely to work with; do strongly
consider talking to them if you want to write your own book.
Our contributors to the “Lessons from the Field” chapter very
kindly shared their time and hard-won lessons. We give thanks
to Soledad Galli, Linda Uruchurtu, Vanentin Haenel, and
Vincent D. Warmerdam for this edition and to Ben Jackson,
Radim Řehůřek, Sebastjan Trepca, Alex Kelly, Marko Tasic,
and Andrew Godwin for their time and effort during the
previous edition.
Chapter 1. Understanding
Performant Python
QUESTIONS YOU’LL BE ABLE TO ANSWER AFTER THIS
CHAPTER
What are the elements of a computer’s architecture?
What are some common alternate computer architectures?
How does Python abstract the underlying computer architecture?
What are some of the hurdles to making performant Python code?
What strategies can help you become a highly performant programmer?
Programming computers can be thought of as moving bits of
data and transforming them in special ways to achieve a
particular result. However, these actions have a time cost.
Consequently, high performance programming can be thought
of as the act of minimizing these operations either by reducing
the overhead (i.e., writing more efficient code) or by changing
the way that we do these operations to make each one more
meaningful (i.e., finding a more suitable algorithm).
Let’s focus on reducing the overhead in code in order to gain
more insight into the actual hardware on which we are moving
these bits. This may seem like a futile exercise, since Python
works quite hard to abstract away direct interactions with the
hardware. However, by understanding both the best way that
bits can be moved in the real hardware and the ways that
Python’s abstractions force your bits to move, you can make
progress toward writing high performance programs in Python.
The Fundamental Computer System
The underlying components that make up a computer can be
simplified into three basic parts: the computing units, the
memory units, and the connections between them. In addition,
each of these units has different properties that we can use to
understand them. The computational unit has the property of
how many computations it can do per second, the memory unit
has the properties of how much data it can hold and how fast
we can read from and write to it, and finally, the connections
have the property of how fast they can move data from one
place to another.
Using these building blocks, we can talk about a standard
workstation at multiple levels of sophistication. For example,
the standard workstation can be thought of as having a central
processing unit (CPU) as the computational unit, connected to
both the random access memory (RAM) and the hard drive as
two separate memory units (each having different capacities
and read/write speeds), and finally a bus that provides the
connections between all of these parts. However, we can also
go into more detail and see that the CPU itself has several
memory units in it: the L1, L2, and sometimes even the L3 and
L4 cache, which have small capacities but very fast speeds
(from several kilobytes to a dozen megabytes). Furthermore,
new computer architectures generally come with new
configurations (for example, Intel’s SkyLake CPUs replaced the
frontside bus with the Intel Ultra Path Interconnect and
restructured many connections). Finally, in both of these
approximations of a workstation we have neglected the
network connection, which is effectively a very slow connection
to potentially many other computing and memory units!
To help untangle these various intricacies, let’s go over a brief
description of these fundamental blocks.
Computing Units
The computing unit of a computer is the centerpiece of its
usefulness—it provides the ability to transform any bits it
receives into other bits or to change the state of the current
process. CPUs are the most commonly used computing unit;
however, graphics processing units (GPUs) are gaining
popularity as auxiliary computing units. They were originally
used to speed up computer graphics but are becoming more
applicable for numerical applications and are useful thanks to
their intrinsically parallel nature, which allows many
calculations to happen simultaneously. Regardless of its type,
a computing unit takes in a series of bits (for example, bits
representing numbers) and outputs another set of bits (for
example, bits representing the sum of those numbers). In
addition to the basic arithmetic operations on integers and real
numbers and bitwise operations on binary numbers, some
computing units also provide very specialized operations, such
as the “fused multiply add” operation, which takes in three
numbers, A, B, and C, and returns the value A * B + C.
The main properties of interest in a computing unit are the
number of operations it can do in one cycle and the number of
cycles it can do in one second. The first value is measured by
its instructions per cycle (IPC), while the latter value is
measured by its clock speed. These two measures are always
competing with each other when new computing units are
being made. For example, the Intel Core series has a very high
IPC but a lower clock speed, while the Pentium 4 chip has the
reverse. GPUs, on the other hand, have a very high IPC and
clock speed, but they suffer from other problems like the slow
communications that we discuss in “Communications Layers”.
Furthermore, although increasing clock speed almost
immediately speeds up all programs running on that
computational unit (because they are able to do more
calculations per second), having a higher IPC can also
drastically affect computing by changing the level of
vectorization that is possible. Vectorization occurs when a CPU
is provided with multiple pieces of data at a time and is able to
operate on all of them at once. This sort of CPU instruction is
known as single instruction, multiple data (SIMD).
In general, computing units have advanced quite slowly over
the past decade (see Figure 1-1). Clock speeds and IPC have
both been stagnant because of the physical limitations of
making transistors smaller and smaller. As a result, chip
1
manufacturers have been relying on other methods to gain
more speed, including simultaneous multithreading (where
multiple threads can run at once), more clever out-of-order
execution, and multicore architectures.
Hyperthreading presents a virtual second CPU to the host
operating system (OS), and clever hardware logic tries to
interleave two threads of instructions into the execution units
on a single CPU. When successful, gains of up to 30% over a
single thread can be achieved. Typically, this works well when
the units of work across both threads use different types of
execution units—for example, one performs floating-point
operations and the other performs integer operations.
Out-of-order execution enables a compiler to spot that some
parts of a linear program sequence do not depend on the
results of a previous piece of work, and therefore that both
pieces of work could occur in any order or at the same time. As
long as sequential results are presented at the right time, the
program continues to execute correctly, even though pieces of
work are computed out of their programmed order. This
enables some instructions to execute when others might be
blocked (e.g., waiting for a memory access), allowing greater
overall utilization of the available resources.
Finally, and most important for the higher-level programmer,
there is the prevalence of multicore architectures. These
architectures include multiple CPUs within the same unit, which
increases the total capability without running into barriers to
making each individual unit faster. This is why it is currently
hard to find any machine with fewer than two cores—in this
case, the computer has two physical computing units that are
connected to each other. While this increases the total number
of operations that can be done per second, it can make writing
code more difficult!
Figure 1-1. Clock speed of CPUs over time (from CPU DB)
Simply adding more cores to a CPU does not always speed up
a program’s execution time. This is because of something
known as Amdahl’s law. Simply stated, Amdahl’s law is this: if
a program designed to run on multiple cores has some
subroutines that must run on one core, this will be the limitation
for the maximum speedup that can be achieved by allocating
more cores.
For example, if we had a survey we wanted one hundred
people to fill out, and that survey took 1 minute to complete, we
could complete this task in 100 minutes if we had one person
asking the questions (i.e., this person goes to participant 1,
asks the questions, waits for the responses, and then moves to
participant 2). This method of having one person asking the
questions and waiting for responses is similar to a serial
process. In serial processes, we have operations being
satisfied one at a time, each one waiting for the previous
operation to complete.
However, we could perform the survey in parallel if we had two
people asking the questions, which would let us finish the
process in only 50 minutes. This can be done because each
individual person asking the questions does not need to know
anything about the other person asking questions. As a result,
the task can easily be split up without having any dependency
between the question askers.
Adding more people asking the questions will give us more
speedups, until we have one hundred people asking questions.
At this point, the process would take 1 minute and would be
limited simply by the time it takes a participant to answer
questions. Adding more people asking questions will not result
in any further speedups, because these extra people will have
no tasks to perform—all the participants are already being
asked questions! At this point, the only way to reduce the
overall time to run the survey is to reduce the amount of time it
takes for an individual survey, the serial portion of the problem,
to complete. Similarly, with CPUs, we can add more cores that
can perform various chunks of the computation as necessary
until we reach a point where the bottleneck is the time it takes
for a specific core to finish its task. In other words, the
bottleneck in any parallel calculation is always the smaller
serial tasks that are being spread out.
Furthermore, a major hurdle with utilizing multiple cores in
Python is Python’s use of a global interpreter lock (GIL). The
GIL makes sure that a Python process can run only one
instruction at a time, regardless of the number of cores it is
currently using. This means that even though some Python
code has access to multiple cores at a time, only one core is
running a Python instruction at any given time. Using the
previous example of a survey, this would mean that even if we
had 100 question askers, only one person could ask a question
and listen to a response at a time. This effectively removes any
sort of benefit from having multiple question askers! While this
may seem like quite a hurdle, especially if the current trend in
computing is to have multiple computing units rather than
having faster ones, this problem can be avoided by using other
standard library tools, like multiprocessing (Chapter 9),
technologies like numpy or numexpr (Chapter 6), Cython
(Chapter 7), or distributed models of computing (Chapter 10).
NOTE
Python 3.2 also saw a major rewrite of the GIL, which made the system
much more nimble, alleviating many of the concerns around the system
for single-thread performance. Although it still locks Python into running
only one instruction at a time, the GIL now does better at switching
between those instructions and doing so with less overhead.
Memory Units
Memory units in computers are used to store bits. These could
be bits representing variables in your program or bits
representing the pixels of an image. Thus, the abstraction of a
memory unit applies to the registers in your motherboard as
well as your RAM and hard drive. The one major difference
between all of these types of memory units is the speed at
which they can read/write data. To make things more
complicated, the read/write speed is heavily dependent on the
way that data is being read.
For example, most memory units perform much better when
they read one large chunk of data as opposed to many small
chunks (this is referred to as sequential read versus random
data). If the data in these memory units is thought of as pages
in a large book, this means that most memory units have better
read/write speeds when going through the book page by page
rather than constantly flipping from one random page to
another. While this fact is generally true across all memory
units, the amount that this affects each type is drastically
different.
In addition to the read/write speeds, memory units also have
latency, which can be characterized as the time it takes the
device to find the data that is being used. For a spinning hard
drive, this latency can be high because the disk needs to
physically spin up to speed and the read head must move to
the right position. On the other hand, for RAM, this latency can
be quite small because everything is solid state. Here is a short
description of the various memory units that are commonly
found inside a standard workstation, in order of read/write
speeds:
Spinning hard drive
Long-term storage that persists even when the computer is
shut down. Generally has slow read/write speeds because
the disk must be physically spun and moved. Degraded
2
performance with random access patterns but very large
capacity (10 terabyte range).
Solid-state hard drive
Similar to a spinning hard drive, with faster read/write
speeds but smaller capacity (1 terabyte range).
RAM
Used to store application code and data (such as any
variables being used). Has fast read/write characteristics
and performs well with random access patterns, but is
generally limited in capacity (64 gigabyte range).
L1/L2 cache
Extremely fast read/write speeds. Data going to the CPU
must go through here. Very small capacity (megabytes
range).
Figure 1-2 gives a graphic representation of the differences
between these types of memory units by looking at the
characteristics of currently available consumer hardware.
A clearly visible trend is that read/write speeds and capacity
are inversely proportional—as we try to increase speed,
capacity gets reduced. Because of this, many systems
implement a tiered approach to memory: data starts in its full
state in the hard drive, part of it moves to RAM, and then a
much smaller subset moves to the L1/L2 cache. This method
of tiering enables programs to keep memory in different places
depending on access speed requirements. When trying to
optimize the memory patterns of a program, we are simply
Exploring the Variety of Random
Documents with Different Content
Devas.—A Manual of Political Economy. By C. S. Devas, M.A., Cr. 8vo.,
7s. 6d. (Stonyhurst Philosophical Series.)
Jordan.—The Standard of Value. By William Leighton Jordan. Cr. 8vo.,
6s.
Lawrence.—Local Variations in Wages. By F. W. Lawrence, M.A. With
Index and 18 Maps and Diagrams. 4to., 8s. 6d.
Leslie.—Essays on Political Economy. By T. E. Cliffe Leslie, Hon. Ll.D.,
Dubl. 8vo., 10s. 6d.
Macleod (Henry Dunning).
Economics for Beginners. Crown 8vo., 2s.
The Elements of Economics. 2 vols. Crown 8vo., 3s. 6d. each.
Bimetalism. 8vo., 5s. net.
The Elements of Banking. Cr. 8vo., 3s. 6d.
The Theory and Practice Of Banking. Vol. I. 8vo., 12s. Vol. II. 14s.
The Theory of Credit. 8vo. In 1 Vol., 30s. net; or separately, Vol.
I., 10s. net. Vol. II., Part I., 10s. net. Vol II., Part II. 10s.
net.
Indian Currency. 8vo., 2s. 6d. net.
Mill.—Political Economy. By John Stuart Mill. Popular Edition. Cr. 8vo.,
3s. 6d. Library Edition. 2 vols. 8vo., 30s.
Mulhall.—Industries and Wealth of Nations. By Michael G. Mulhall,
F.S.S. With 32 Diagrams. Cr. 8vo., 8s. 6d.
Spahr.—America’s Working People. By Charles B. Spahr. Crown 8vo.,
5s. net.
Symes.—Political Economy: a Short Text-book of Political Economy.
With Problems for Solution, Hints for Supplementary Reading,
and a Supplementary Chapter on Socialism. By J. E. Symes, M.A.
Crown 8vo., 2s. 6d.
Toynbee.—Lectures on the Industrial Revolution of the 18th Century in
England. By Arnold Toynbee. 8vo., 10s. 6d.
Webb (Sidney and Beatrice).
The History of Trade Unionism. With Map and Bibliography. 8vo.,
18s.
Industrial Democracy: a Study in Trade Unionism. 2 vols. 8vo.,
25s. net.
Problems of Modern Industry: Essays. 8vo., 7s. 6d.
Evolution, Anthropology, &c.
Clodd (Edward).
The Story of Creation: a Plain Account of Evolution. With 77
Illustrations. Crown 8vo., 3s. 6d.
A Primer of Evolution: being a Popular Abridged Edition of ‘The
Story of Creation’. With Illustrations. Fcp. 8vo., 1s. 6d.
Lang (Andrew).
Custom and Myth: Studies of Early Usage and Belief. With 15
Illustrations. Crown 8vo., 3s. 6 d.
Myth, Ritual, and Religion. 2 vols. Crown 8vo., 7s.
Modern Mythology: a Reply to Professor Max Müller. 8vo., 9s.
The Making of Religion. Cr. 8vo., 5 s. net.
Lubbock.—The Origin of Civilisation, and the Primitive Condition of
Man. By Sir J. Lubbock, Bart., M.P. (Lord Avebury). With 5 Plates
and 20 Illustrations. 8vo., 18 s.
Max Müller (The Right Hon. F.).
Chips from a German Workshop. Vol. IV. Essays on Mythology and
Folk Lore. Crown 8vo., 5s.
Contributions to the Science of Mythology. 2 vols. 8vo., 32s.
Romanes (George John).
Essays. Edited by C. Lloyd Morgan. Crown 8vo., 5s. net.
Darwin, and after Darwin: an Exposition of the Darwinian Theory,
and a Discussion on Post-Darwinian Questions.
Part I. The Darwinian Theory. With Portrait of Darwin and
125 Illustrations. Crown 8vo., 10s. 6d.
Part II. Post-Darwinian Questions: Heredity and Utility. With
Portrait of the Author and 5 Illustrations. Cr. 8vo., 10s.
6d.
Part III. Post-Darwinian Questions: Isolation and
Physiological Selection. Crown 8vo., 5s.
An Examination of Weismannism. Crown 8vo., 6s.
Classical Literature, Translations, &c.
Abbott.—Hellenica. A Collection of Essays on Greek Poetry,
Philosophy, History, and Religion. Edited by Evelyn Abbott, M.A.,
LL.D. Crown 8vo., 7s. 6d.
Æschylus.—Eumenides of Æschylus. With Metrical English Translation.
By J. F. Davies. 8vo., 7s.
Aristophanes.—The Acharnians of Aristophanes, translated into
English Verse. By R. Y. Tyrrell. Crown 8vo., 1s.
Becker (W. A.), Translated by the Rev. F. Metcalfe, B.D.
Gallus: or, Roman Scenes in the Time of Augustus. With Notes
and Excursuses. With 26 Illustrations. Crown 8vo., 3s. 6d.
Charicles: or, Illustrations of the Private Life of the Ancient
Greeks. With Notes and Excursuses. With 26 Illustrations.
Crown 8vo., 3s. 6d.
Butler.—The Authoress of the Odyssey, where and when She wrote, who
She was, the Use She made of the Iliad, and how the Poem grew under
Her hands. By Samuel Butler. With 14 Illustrations and 4 Maps.
8vo., 10s. 6d.
Campbell.—Religion in Greek Literature. By the Rev. Lewis Campbell,
M.A., LL.D., Emeritus Professor of Greek, University of St.
Andrews. 8vo., 15s.
Cicero.—Cicero’s Correspondence. By R. Y. Tyrrell. Vols. I., II., III.,
8vo., each 12s. Vol. IV., 15s. Vol. V., 14s. Vol. VI., 12s. Vol. VII.
Index, 7s. 6d.
Harvard Studies in Classical Philology, 1900. Edited by a
Committee of the Classical Instructors of Harvard University. Vol.
XI. 1900. 8vo., 6s. 6d. net.
Hime.—Lucian, the Syrian Satirist. By Lieut.-Col. Henry W. L. Hime,
(late) Royal Artillery. 8vo., 5s. net.
Homer.
The Iliad of Homer. Freely rendered into English Prose for the use
of those who cannot read the original. By Samuel Butler,
Author of ‘Erewhon,’ etc. Crown 8vo., 7s. 6d.
The Odyssey. Rendered into English Prose for the use of those
that cannot read the original. By Samuel Butler. With 4 Maps
and 7 Illustrations. 8vo., 7s. 6d.
The Odyssey of Homer. Done into English Verse. By William Morris.
Crown 8vo., 6s.
Horace.—The Works of Horace, rendered into English Prose. With Life,
Introduction and Notes. By William Coutts, M.A. Crown 8vo., 5s.
net.
Lang.—Homer and the Epic. By Andrew Lang. Crown 8vo., 9s. net.
Lucan.—The Pharsalia of Lucan. Translated into Blank Verse. By Sir
Edward Ridley. 8vo., 14s.
Mackail.—Select Epigrams from the Greek Anthology. By J. W. Mackail.
Edited with a Revised Text, Introduction, Translation, and Notes.
8vo., 16s.
Rich.—A Dictionary of Roman and Greek Antiquities. By A. Rich, B.A.
With 2000 Woodcuts. Crown 8vo., 6s. net.
Sophocles.—Translated into English Verse. By Robert Whitelaw,
M.A., Assistant Master in Rugby School. Cr. 8vo., 8s. 6d.
Tyrrell.—Dublin Translations into Greek and Latin Verse. Edited by R.
Y. Tyrrell. 8vo., 6s.
Virgil.
The Poems of Virgil. Translated into English Prose by John
Conington. Crown 8vo., 6s.
The Æneid of Virgil. Translated into English Verse by John
Conington. Crown 8vo., 6s.
The Æneids of Virgil. Done into English Verse. By William Morris.
Crown 8vo., 6s.
The Æneid of Virgil, freely translated into English Blank Verse. By
W. J. Thornhill. Crown 8vo., 6s. net.
The Æneid of Virgil. Translated into English Verse by James
Rhoades. Books I.-VI. Crown 8vo., 5s. Books VII.-XII. Crown
8vo., 5s.
The Eclogues and Georgics of Virgil. Translated into English Prose
by J. W. Mackail, Fellow of Balliol College, Oxford. 16mo.,
5s.
Wilkins.—The Growth of the Homeric Poems. By G. Wilkins. 8vo., 6s.
Poetry and the Drama.
Arnold.—The Light of the World: or, The Great Consummation. By
Sir Edwin Arnold. With 14 Illustrations after Holman Hunt. Crown
8vo., 5s. net.
Bell (Mrs. Hugh).
Chamber Comedies: a Collection of Plays and Monologues for the
Drawing Room. Crown 8vo., 5s. net.
Fairy Tale Plays, and How to Act Them. With 91 Diagrams and 52
Illustrations. Crown 8vo., 3s. net.
Rumpelstiltzkin: a Fairy Play in Five Scenes (Characters, 7 Male; 1
Female). From ‘Fairy Tale Plays and How to Act Them’. With
Illustrations, Diagrams and Music. Cr. 8vo., sewed, 6d.
Bird.—Ronald’s Farewell, and other Verses. By George Bird, M.A.,
Vicar of Bradwell, Derbyshire. Fcp. 8vo., 4s. 6d. net.
Coleridge.—Selections from. With Introduction by Andrew Lang. With
18 Illustrations by Patten Wilson. Crown 8vo., 3s. 6d.
Comparetti.—The Traditional Poetry of the Finns. By Domenico
Comparetti, Socio dell’Accademia dei Lincei, Membre de
l’Académie des Inscriptions, etc. Translated by Isabella M.
Anderton. With Introduction by Andrew Lang. 8vo., 16s.
Goethe.—The First Part of the Tragedy of Faust in English. By Thos. E.
Webb, LL.D., sometime Fellow of Trinity College; Professor of
Moral Philosophy in the University of Dublin, etc. New and
Cheaper Edition, with The Death of Faust, from the Second Part.
Crown 8vo., 6s.
Ingelow (Jean).
Poetical Works. Complete in One Volume. Crown 8vo., 6s. net.
Lyrical and other Poems. Selected from the Writings of Jean
Ingelow. Fcp. 8vo., 2s. 6d. cloth plain, 3s. cloth gilt.
Lang (Andrew).
Grass of Parnassus. Fcp, 8vo., 2s. 6d. net.
The Blue Poetry Book. Edited by Andrew Lang. With 100
Illustrations. Crown 8vo., 6s.
Lecky.—Poems. By the Right Hon. W. E. H. Lecky. Fcp. 8vo., 5s.
Lytton (The Earl of), (Owen Meredith).
The Wanderer. Cr. 8vo., 10s. 6d.
Lucile. Crown 8vo., 10s. 6d.
Selected Poems. Cr. 8vo., 10s. 6d.
Macaulay.—Lays of Ancient Rome, with ‘Ivry’ and ‘The Armada’. By Lord
Macaulay.
Illustrated by G. Scharf. Fcp. 4to., 10s. 6d.
—— Bijou Edition. 18mo., 2s. 6d. gilt top.
—— Popular Edition. Fcp. 4to., 6d. sewed, 1s. cloth.
Illustrated by J. R. Weguelin. Crown 8vo., 3s. net.
Annotated Edition. Fcp. 8vo., 1s. sewed, 1s. 6d. cloth.
MacDonald (George, LL.D.).
A Book of Strife, in the Form of the Diary of an Old Soul: Poems.
18mo., 6s.
Rampolli: Growths from a Long-Planted Root: being Translations,
New and Old (mainly in verse), chiefly from the German;
along with ‘A Year’s Diary of an Old Soul’. Crown 8vo., 6s.
Moffat.—Crickety Cricket: Rhymes and Parodies. By Douglas Moffat.
With Frontispiece by the late Sir Frank Lockwood, and 53
Illustrations by the Author. Crown 8vo, 2s. 6d.
Moon.—Poems of Love and Home. By George Washington Moon, Hon.
F.R.S.L. With Portrait. 16mo., 2s. 6d.
Morris (William).
POETICAL WORKS—Library Edition. Complete in 11 volumes.
Crown 8vo., price 5s. net each.
The Earthly Paradise. 4 vols. Crown 8vo., 5s. net each.
The Life and Death of Jason. Crown 8vo., 5s. net.
The Defence of Guenevere, and other Poems. Crown 8vo., 5s. net.
The Story of Sigurd the Volsung, and The Fall of the Niblungs. Cr.
8vo., 5s. net.
Poems by the Way, and Love is Enough. Crown 8vo., 5s. net.
The Odyssey of Homer. Done into English Verse. Crown 8vo., 5s.
net.
The Æneids of Virgil. Done into English Verse. Crown 8vo., 5s.
net.
The Tale of Beowulf, sometime King of the Folk of the Wedergeats.
Translated by William Morris and A. J. Wyatt. Crown 8vo.,
5s. net.
Certain of the Poetical Works may also be had in the following
Editions:—
The Earthly Paradise.
Popular Edition. 5 vols. 12mo., 25s.; or 5s. each, sold
separately.
The same in Ten Parts, 25s.; or 2s. 6d. each, sold
separately.
Cheap Edition, in 1 vol. Crown 8vo., 6s. net.
Poems by the Way. Square crown 8vo., 6s.
⁂ For Mr. William Morris’s Prose Works, see pp. 22 and 31.
Morte Arthur: an Alliterative Poem of the Fourteenth Century.
Edited from the Thornton MS., with Introduction, Notes and
Glossary. By Mary Macleod Banks. Fcp. 8vo., 3s. 6d.
Nesbit.—Lays and Legends. By E. Nesbit (Mrs. Hubert Bland). First
Series. Crown 8vo., 3s. 6d. Second Series. With Portrait. Crown
8vo., 5s.
Pooler.—Translations, and other Verses. By C. K. Pooler, M.A. Fcp.
8vo., 3s. net.
Riley.—Old Fashioned Roses: Poems. By James Whitcomb Riley. 12mo.,
5s.
Romanes.—A Selection from the Poems of George John Romanes, M.A.,
LL.D., F.R.S. With an Introduction by T. Herbert Warren,
President of Magdalen College, Oxford. Crown 8vo., 4s. 6d.
Shakespeare.
Bowdler’s Family Shakespeare. With 36 Woodcuts. 1 vol. 8vo., 14s.
Or in 6 vols. Fcp. 8vo., 21s.
The Shakespeare Birthday Book. By Mary F. Dunbar. 32mo., 1s. 6d.
Shakespeare’s Sonnets. Reconsidered, and in part Rearranged,
with Introductory Chapters and a Reprint of the Original
1609 Edition, by Samuel Butler, Author of ‘Erewhon’. 8vo.,
10s. 6d.
Savage-Armstrong.—Ballads of Down. By G. F. Savage-Armstrong,
M.A., D.Litt. Crown 8vo., 7s. 6d.
Stevenson.—A Child’s Garden of Verses. By Robert Louis Stevenson.
Fcp. 8vo., 5s.
Wagner.—The Nibelungen Ring. Done into English Verse by Reginald
Rankin, B.A. of the Inner Temple, Barrister-at-Law. Vol. I. Rhine
Gold and Valkyrie. Fcp. 8vo., 4s. 6d.
Wordsworth.—Selected Poems. By Andrew Lang. With Photogravure
Frontispiece of Rydal Mount. With 16 Illustrations and numerous
Initial Letters. By Alfred Parsons, A.R.A. Crown 8vo., gilt edges,
3s. 6d.
Wordsworth and Coleridge.—A Description of the Wordsworth and
Coleridge Manuscripts in the Possession of Mr. T. Norton Longman.
Edited, with Notes, by W. Hale White. With 3 Facsimile
Reproductions. 4to., 10s. 6d.
Fiction, Humour, &c.
Anstey.—Voces Populi. (Reprinted from ‘Punch’.) By F. Anstey, Author
of ‘Vice Versâ’.
First Series. With 20 Illustrations by J. Bernard Partridge. Cr.
8vo., 3s. net.
Second Series. With 25 Illustrations by J. Bernard Partridge. Cr.
8vo., 3s. net.
Bailey.—My Lady of Orange: a Romance of the Netherlands in the
Days of Alva. By H. C. Bailey. With 8 Illustrations. Crown 8vo.,
6s.
Beaconsfield (The Earl of).
Novels and Tales. Complete in 11 vols. Crown 8vo., 1s. 6d. each.
Vivian Grey.
The Young Duke, etc.
Alroy, Ixion, etc.
Contarini Fleming, etc.
Tancred.
Sybil.
Henrietta Temple.
Venetia.
Coningsby.
Lothair.
Endymion.
Novels and Tales. The Hughenden Edition. With 2 Portraits and 11
Vignettes. 11 Vols. Crown 8vo., 42s.
‘Chola.’—A New Divinity, and other Stories of Hindu Life. By ‘Chola’.
Crown 8vo., 2s. 6d.
Churchill.—Savrola: a Tale of the Revolution in Laurania. By Winston
Spencer Churchill, M.P. Cr. 8vo., 6s.
Crawford.—The Autobiography of a Tramp. By J. H. Crawford. With a
Photogravure Frontispiece ‘The Vagrants,’ by Fred. Walker, and 8
other Illustrations. Crown 8vo., 5s. net.
Creed.—The Vicar of St. Luke’s: a Novel. By Sibyl Creed. Cr. 8vo., 6s.
Dougall.—Beggars All. By L. Dougall. Crown 8vo., 3s. 6d.
Doyle (A. Conan).
Micah Clarke: A Tale of Monmouth’s Rebellion. With 10
Illustrations. Cr. 8vo., 3s. 6d.
The Refugees: A Tale of the Huguenots. With 25 Illustrations. Cr.
8vo., 3s. 6d.
The Stark Munro Letters. Cr. 8vo, 3s. 6d.
The Captain of the Polestar, and other Tales. Cr. 8vo., 3s. 6d.
Farrar (F. W., Dean of Canterbury).
Darkness and Dawn: or, Scenes in the Days of Nero. An Historic
Tale. Cr. 8vo., 6s. net.
Gathering Clouds: a Tale of the Days of St. Chrysostom. Cr. 8vo.,
6s. net.
Fowler (Edith H.).
The Young Pretenders. A Story of Child Life. With 12 Illustrations
by Sir Philip Burne-Jones, Bart. Crown 8vo., 6s.
The Professor’s Children. With 24 Illustrations by Ethel Kate
Burgess. Crown 8vo., 6s.
Francis (M. E.).
Yeoman Fleetwood. Cr. 8vo., 6s.
Pastorals of Dorset. With 8 Illustrations. Crown 8vo., 6s.
Froude.—The Two Chiefs of Dunboy: an Irish Romance of the Last
Century. By James A. Froude. Cr. 8vo., 3s. 6d.
Gurdon.—Memories and Fancies: Suffolk Tales and other Stories; Fairy
Legends; Poems; Miscellaneous Articles. By the late Lady Camilla
Gurdon. Cr. 8vo., 5s.
Haggard (H. Rider).
Allan Quatermain. With 31 Illustrations. Crown 8vo., 3s. 6d.
Allan’s Wife. With 34 Illustrations. Crown 8vo., 3s. 6d.
Beatrice. With Frontispiece and Vignette. Cr. 8vo., 3s. 6d.
Black Heart and White Heart, and other Stories. With 33
Illustrations. Crown 8vo., 6s.
Cleopatra. With 29 Illustrations. Crown 8vo., 3s. 6d.
Colonel Quaritch, V.C. With Frontispiece and Vignette. Cr. 8vo.,
3s. 6d.
Dawn. With 16 Illustrations. Cr. 8vo., 3s. 6d.
Dr. Therne. Crown 8vo., 3s. 6d.
Eric Brighteyes. With 51 Illustrations. Crown 8vo., 3s. 6d.
Heart of the World. With 15 Illustrations. Crown 8vo., 3s. 6d.
Joan Haste. With 20 Illustrations. Crown 8vo., 3s. 6d.
Maiwa’s Revenge. Cr. 8vo., 1s. 6d.
Lysbeth. With 26 Illustrations. Crown 8vo., 6s.
Montezuma’s Daughter. With 24 Illustrations. Crown 8vo., 3s. 6d.
Mr. Meeson’s Will. With 16 Illustrations. Crown 8vo., 3s. 6d.
Nada the Lily. With 23 Illustrations. Crown 8vo., 3s. 6d.
She. With 32 Illustrations. Crown 8vo., 3s. 6d.
Swallow: a Tale of the Great Trek. With 8 Illustrations. Crown
8vo., 6s.
The People of the Mist. With 16 Illustrations. Crown 8vo., 3s. 6d.
The Witch’s Head. With 16 Illustrations. Crown 8vo., 3s. 6d.
Haggard and Lang.—The World’s Desire. By H. Rider Haggard and
Andrew Lang. With 27 Illustrations. Crown 8vo., 3s. 6d.
Harte.—In the Carquinez Woods. By Bret Harte. Crown 8vo., 3s. 6d.
Hope.—The Heart of Princess Osra. By Anthony Hope. With 9
Illustrations. Crown 8vo., 3s. 6d.
Howard.—The Undoing of John Brewster. By Lady Mabel Howard.
Crown 8vo., 6s.
Jerome.—Sketches in Lavender: Blue and Green. By Jerome K. Jerome,
Author of ‘Three Men in a Boat,’ etc. Crown 8vo., 3s. 6d.
Joyce.—Old Celtic Romances. Twelve of the most beautiful of the
Ancient Irish Romantic Tales. Translated from the Gaelic. By P.
W. Joyce, LL.D. Crown 8vo., 3s. 6d.
Lang.—A Monk of Fife; a Story of the Days of Joan of Arc. By Andrew
Lang. With 13 Illustrations by Selwyn Image. Crown 8vo., 3s. 6d.
Levett-Yeats.—The Chevalier D’Auriac. By S. Levett-Yeats. Crown
8vo., 3s. 6d.
Lyall (Edna).
The Autobiography of a Slander. Fcp. 8vo., 1s., sewed.
Presentation Edition. With 20 Illustrations by Lancelot Speed.
Crown 8vo., 2s. 6d. net.
The Autobiography of a Truth. Fcp. 8vo., 1s., sewed; 1s. 6d.,
cloth.
Doreen. The Story of a Singer. Crown 8vo., 6s.
Wayfaring Men. Crown 8vo., 6s.
Hope the Hermit: a Romance of Borrowdale. Crown 8vo., 6s.
Marchmont.—In the Name of a Woman: a Romance. By Arthur W.
Marchmont. With 8 Illustrations. Crown 8vo., 6s.
Mason and Lang.—Parson Kelly. By A. E. W. Mason and Andrew
Lang. Crown 8vo., 6s.
Max Müller.—Deutsche Liebe (German Love): Fragments from the
Papers of an Alien. Collected by F. Max Müller. Translated from
the German by G. A. M. Crown 8vo., 5s.
Melville (G. J. Whyte).
The Gladiators.
The Interpreter.
Good for Nothing.
The Queen’s Maries.
Holmby House.
Kate Coventry.
Digby Grand.
General Bounce.
Crown 8vo., 1s. 6d. each.
Merriman.—Flotsam: A Story of the Indian Mutiny. By Henry Seton
Merriman. With Frontispiece and Vignette by H. G. Massey. Cr.
8vo., 3s. 6d.
Morris (William).
The Sundering Flood. Cr. 8vo., 7s. 6d.
The Water of the Wondrous Isles. Crown 8vo., 7s. 6d.
The Well at the World’s End. 2 vols. 8vo., 28s.
The Wood Beyond the World. Crown 8vo, 6s. net.
The Story of the Glittering Plain, which has been also called The
Land of the Living Men, or The Acre of the Undying. Square
post 8vo., 5s. net.
The Roots of the Mountains, wherein is told somewhat of the
Lives of the Men of Burgdale, their Friends, their
Neighbours, their Foemen, and their Fellows-in-Arms.
Written in Prose and Verse. Square crown 8vo., 8s.
A Tale of the House of the Wolfings, and all the Kindreds of the
Mark. Written in Prose and Verse. Square crown 8vo., 6s.
A Dream of John Ball, and a King’s Lesson. 12mo., 1s. 6d.
News from Nowhere; or, An Epoch of Rest. Being some Chapters
from an Utopian Romance. Post 8vo., 1s. 6d.
The Story of Grettir the Strong. Translated from the Icelandic by
Eiríkr Magnússon and William Morris. Cr. 8vo., 5s. net.
Three Northern Love Stories, and Other Tales. Translated from the
Icelandic by Eiríkr Magnússon and William Morris. Crown
8vo., 6s. net.
⁂ For Mr. William Morris’s Poetical Works, see p. 19.
Newman (Cardinal).
Loss and Gain: The Story of a Convert. Crown 8vo. Cabinet
Edition, 6s.; Popular Edition, 3s. 6d.
Callista: A Tale of the Third Century. Crown 8vo. Cabinet Edition,
6s.; Popular Edition, 3s. 6d.
Phillipps-Wolley.—Snap: a Legend of the Lone Mountain. By C.
Phillipps-Wolley. With 13 Illustrations. Crown 8vo., 3s. 6d.
Raymond (Walter).
Two Men o’ Mendip. Cr. 8vo., 6s.
No Soul Above Money. Cr. 8vo., 6s.
Reader.—Priestess and Queen: a Tale of the White Race of Mexico;
being the Adventures of Ignigene and her Twenty-six Fair
Maidens. By Emily E. Reader. Illustrated by Emily K. Reader. Crown
8vo., 6s.
Ridley.—Anne Mainwaring. By Alice Ridley, Author of ‘The Story of
Aline’. Crown 8vo., 6s.
Sewell (Elizabeth M.).
A Glimpse of the World.
Laneton Parsonage.
Margaret Percival.
Katharine Ashton.
The Earl’s Daughter.
The Experience of Life.
Amy Herbert.
Cleve Hall.
Gertrude.
Home Life.
After Life.
Ursula. Ivors.
Cr. 8vo., 1s. 6d. each cloth plain. 2s. 6d. each cloth extra, gilt
edges.
Somerville (E. [OE].) and Ross (Martin).
Some Experiences of an Irish R.M. With 31 Illustrations by E. [OE].
Somerville. Crown 8vo., 6s.
The Real Charlotte. Crown 8vo., 3s. 6d.
The Silver Fox. Cr. 8vo., 3s. 6d.
Stebbing.—Probable Tales. Edited by William Stebbing. Crown 8vo.,
4s. 6d.
Stevenson (Robert Louis).
The Strange Case of Dr. Jekyll and Mr. Hyde. Fcp. 8vo., 1s. sewed.
1s. 6d. cloth.
The Strange Case of Dr. Jekyll and Mr. Hyde; with other Fables.
Crown 8vo., 3s. 6d.
More New Arabian Nights—The Dynamiter. By Robert Louis Stevenson
and Fanny van de Grift Stevenson. Crown 8vo., 3s. 6d.
The Wrong Box. By Robert Louis Stevenson and Lloyd Osbourne.
Crown 8vo., 3s. 6d.
Suttner.—Lay Down Your Arms (Die Waffen Nieder): The
Autobiography of Martha von Tilling. By Bertha von Suttner.
Translated by T. Holmes. Cr. 8vo., 1s. 6d.
Swan.—Ballast. By Myra Swan. Crown 8vo., 6s.
Taylor.—Early Italian Love-Stories. Taken from the Originals by Una
Taylor. With 13 Illustrations by Henry J. Ford. Crown 4to., 15s.
net.
Trollope (Anthony).
The Warden. Cr. 8vo., 1s. 6d.
Barchester Towers. Cr. 8vo., 1s. 6d.
Walford (L. B.).
One of Ourselves. Cr. 8vo., 6s.
The Intruders. Crown 8vo., 2s. 6d.
Leddy Marget. Crown 8vo., 2s. 6d.
Iva Kildare: a Matrimonial Problem. Crown 8vo., 2s. 6d.
Mr. Smith: a Part of his Life. Crown 8vo., 2s. 6d.
The Baby’s Grandmother. Cr. 8vo., 2s. 6d.
Cousins. Crown 8vo., 2s. 6d.
Troublesome Daughters. Cr. 8vo., 2s. 6d.
Pauline. Crown 8vo., 2s. 6d.
Dick Netherby. Cr. 8vo., 2s. 6d.
The History of a Week. Cr. 8vo., 2s. 6d.
A Stiff-necked Generation. Cr. 8vo., 2s. 6d.
Nan, and other Stories. Cr. 8vo., 2s. 6d.
The Mischief of Monica. Cr. 8vo., 2s. 6d.
The One Good Guest. Cr. 8vo., 2s. 6d.
‘Ploughed,’ and other Stories. Crown 8vo., 2s. 6d.
The Matchmaker. Cr. 8vo., 2s. 6d.
Ward.—One Poor Scruple. By Mrs. Wilfrid Ward. Crown 8vo., 6s.
West.—Edmund Fulleston; or, The Family Evil Genius. By B. B. West,
Author of ‘Half Hours with the Millionaires,’ etc. Crown 8vo., 6s.
Weyman (Stanley).
The House of the Wolf. With Frontispiece and Vignette. Crown
8vo., 3s. 6d.
A Gentleman of France. With Frontispiece and Vignette. Cr. 8vo.,
6s.
The Red Cockade. With Frontispiece and Vignette. Crown 8vo., 6s.
Shrewsbury. With 24 Illustrations by Claude A. Shepperson. Cr. 8vo.,
6s.
Sophia. With Frontispiece. Crown 8vo., 6s.
Popular Science (Natural History, &c.).
Butler.—Our Household Insects. An Account of the Insect-Pests found
in Dwelling-Houses. By Edward A. Butler, B.A., B.Sc. (Lond.).
With 113 Illustrations. Crown 8vo., 3s. 6d.
Furneaux (W.).
The Outdoor World; or The Young Collector’s Handbook. With 18
Plates (16 of which are coloured), and 549 Illustrations in
the Text. Crown 8vo., 6s. net.
Butterflies and Moths (British). With 12 coloured Plates and 241
Illustrations in the Text. Crown 8vo., 6s. net.
Life in Ponds and Streams. With 8 coloured Plates and 331
Illustrations in the Text. Crown 8vo., 6s. net.
Hartwig (George).
The Sea and its Living Wonders. With 12 Plates and 303 Woodcuts.
8vo., 7s. net.
The Tropical World. With 8 Plates and 172 Woodcuts. 8vo., 7s.
net.
The Polar World. With 3 Maps, 8 Plates and 85 Woodcuts. 8vo.,
7s. net.
The Subterranean World. With 3 Maps and 80 Woodcuts. 8vo., 7s.
net.
Heroes of the Polar World. With 19 Illustrations. Cr. 8vo., 2s.
Wonders of the Tropical Forests. With 40 Illustrations. Cr. 8vo.,
2s.
Workers under the Ground. With 29 Illustrations. Cr. 8vo., 2s.
Marvels Over our Heads. With 29 Illustrations. Cr. 8vo., 2s.
Sea Monsters and Sea Birds. With 75 Illustrations. Cr. 8vo., 2s. 6d.
Denizens of the Deep. With 117 Illustrations. Cr. 8vo., 2s. 6d.
Volcanoes and Earthquakes. With 30 Illustrations. Cr. 8vo., 2s. 6d.
Wild Animals of the Tropics. With 66 Illustrations. Cr. 8vo., 3s. 6d.
Helmholtz.—Popular Lectures on Scientific Subjects. By Hermann von
Helmholtz. With 68 Woodcuts. 2 vols. Cr. 8vo., 3s. 6d. each.
Hudson (W. H.).
Nature in Downland. With 12 Plates and 14 Illustrations in the
Text by A. D. McCormick. 8vo., 10s. 6d. net.
British Birds. With a Chapter on Structure and Classification by
Frank E. Beddard, F.R.S. With 16 Plates (8 of which are
Coloured), and over 100 Illustrations in the Text. Cr. 8vo.,
6s. net.
Birds in London. With 17 Plates and 15 Illustrations in the Text,
by Bryan Hook, A. D. McCormick, and from Photographs from
Nature, by R. B. Lodge. 8vo., 12s.
Proctor (Richard A.).
Light Science for Leisure Hours. Familiar Essays on Scientific
Subjects. Vol. I. Crown 8vo., 3s. 6d.
Rough Ways made Smooth. Familiar Essays on Scientific Subjects.
Crown 8vo., 3s. 6d.
Pleasant Ways in Science. Crown 8vo., 3s. 6d.
Nature Studies. By R. A. Proctor, Grant Allen, A. Wilson, T. Foster
and E. Clodd. Crown 8vo., 3s. 6d.
Leisure Readings. By R. A. Proctor, E. Clodd, A. Wilson, T. Foster
and A. C. Ranyard. Cr. 8vo., 3s. 6d.
⁂ For Mr. Proctor’s other books see pp. 14 and 28, and Messrs.
Longmans & Co.’s Catalogue of Scientific Works.
Stanley.—A Familiar History of Birds. By E. Stanley, D.D., formerly
Bishop of Norwich. With 160 Illustrations. Cr. 8vo., 3s. 6d.
Wood (Rev. J. G.).
Homes without Hands: A Description of the Habitations of
Animals, classed according to the Principle of Construction.
With 140 Illustrations. 8vo., 7s. net.
Insects at Home: A Popular Account of British Insects, their
Structure, Habits and Transformations. With 700
Illustrations. 8vo., 7s. net.
Out of Doors; a Selection of Original Articles on Practical Natural
History. With 11 Illustrations. Cr. 8vo., 3s. 6d.
Strange Dwellings: a Description of the Habitations of Animals,
abridged from ‘Homes without Hands’. With 60 Illustrations.
Cr. 8vo., 3s. 6d.
Petland Revisited. With 33 Illustrations. Cr. 8vo., 3s. 6d.
Bird Life of the Bible. With 32 Illustrations. Cr. 8vo., 3s. 6d.
Wonderful Nests. With 30 Illustrations. Cr. 8vo., 3s. 6d.
Homes under the Ground. With 28 Illustrations. Cr. 8vo., 3s. 6d.
Wild Animals of the Bible. With 29 Illustrations. Cr. 8vo., 3s. 6d.
Domestic Animals of the Bible. With 23 Illustrations. Cr. 8vo., 3s.
6d.
The Branch Builders. With 28 Illustrations. Cr. 8vo., 2s. 6d.
Social Habitations and Parasitic Nests. With 18 Illustrations. Cr.
8vo., 2s.
Works of Reference.
Gwilt.—An Encyclopædia of Architecture. By Joseph Gwilt, F.S.A. With
1700 Engravings. Revised (1888), with Alterations and
Considerable Additions by Wyatt Papworth. 8vo., 21s. net.
Maunder (Samuel).
Biographical Treasury. With Supplement brought down to 1889.
By Rev. James Wood. Fcp. 8vo., 6s.
Treasury of Geography, Physical, Historical, Descriptive, and
Political. With 7 Maps and 16 Plates. Fcp. 8vo., 6s.
The Treasury of Bible Knowledge. By the Rev. J. Ayre, M.A. With 5
Maps, 15 Plates, and 300 Woodcuts. Fcp. 8vo., 6s.
Treasury of Knowledge and Library of Reference. Fcp. 8vo., 6s.
Historical Treasury. Fcp. 8vo, 6s.
The Treasury of Botany. Edited by J. Lindley, F.R.S., and T. Moore,
F.L.S. With 274 Woodcuts and 20 Steel Plates. 2 vols. Fcp.
8vo., 12s.
Roget.—Thesaurus of English Words and Phrases. Classified and
Arranged so as to Facilitate the Expression of Ideas and assist in
Literary Composition. By Peter Mark Roget, M.D., F.R.S.
Recomposed throughout, enlarged and improved, partly from
the Author’s Notes, and with a full Index, by the Author’s Son,
John Lewis Roget. Crown 8vo., 10s. 6d.
Willich.—Popular Tables for giving information for ascertaining the
value of Lifehold, Leasehold, and Church Property, the Public
Funds, etc. By Charles M. Willich. Edited by H. Bence Jones.
Crown 8vo., 10s. 6d.
Children’s Books.
Brown.—The Book of Saints and Friendly Beasts. By Abbie Farwell
Brown. With 8 Illustrations by Fanny Y. Cory. Crown 8vo., 4s. 6d.
net.
Buckland.—Two Little Runaways. Adapted from the French of Louis
Desnoyers. By James Buckland. With 110 Illustrations by Cecil
Aldin. Cr. 8vo., 6s.
Corbin and Going.—Urchins of the Sea. By Marie Overton Corbin and
Charles Buxton Going. With Drawings by F. I. Bennett. Oblong
4to., 3s. 6d.
Crake (Rev. A. D.).
Edwy the Fair; or, The First Chronicle of Æscendune. Cr. 8vo., 2s.
net.
Alfgar the Dane; or, The Second Chronicle of Æscendune. Cr.
8vo., 2s. net.
The Rival Heirs: being the Third and Last Chronicle of
Æscendune. Cr. 8vo., 2s. net.
The House of Walderne. A Tale of the Cloister and the Forest in
the Days of the Barons’ Wars. Crown 8vo., 2s. net.
Brian Fitz-Count. A Story of Wallingford Castle and Dorchester
Abbey. Cr. 8vo., 2s. net.
Henty (G. A.).—Edited by.
Yule Logs: A Story-Book for Boys. By Various Authors. With 61
Illustrations. Crown 8vo., 6s.
Yule Tide Yarns: A Story-Book for Boys. By Various Authors. With
45 Illustrations. Crown 8vo., 6s.
Lang (Andrew).—Edited by.
The Blue Fairy Book. With 138 Illustrations. Crown 8vo., 6s.
The Red Fairy Book. With 100 Illustrations. Crown 8vo., 6s.
The Green Fairy Book. With 99 Illustrations. Crown 8vo., 6s.
The Grey Fairy Book. With 65 Illustrations. Crown 8vo., 6s.
The Yellow Fairy Book. With 104 Illustrations. Crown 8vo., 6s.
The Pink Fairy Book. With 67 Illustrations. Crown 8vo., 6s.
The Blue Poetry Book. With 100 Illustrations. Crown 8vo., 6s.
The True Story Book. With 66 Illustrations. Crown 8vo., 6s.
The Red True Story Book. With 100 Illustrations. Crown 8vo., 6s.
The Animal Story Book. With 67 Illustrations. Crown 8vo., 6s.
The Red Book of Animal Stories. With 65 Illustrations. Crown 8vo.,
6s.
The Arabian Nights Entertainments. With 66 Illustrations. Cr. 8vo.,
6s.
Meade (L. T.).
Daddy’s Boy. With 8 Illustrations. Crown 8vo., 3s. net.
Deb and the Duchess. With 7 Illustrations. Crown 8vo., 3s. net.
The Beresford Prize. With 7 Illustrations. Crown 8vo., 3s. net.
The House of Surprises. With 6 Illustrations. Crown 8vo., 3s. net.
Praeger (Rosamond).
The Adventures of the Three Bold Babes: Hector, Honoria and
Alisander. A Story in Pictures. With 24 Coloured Plates and
24 Outline Pictures. Oblong 4to., 3s. 6d.
The Further Doings of the Three Bold Babes. With 24 Coloured
Pictures and 24 Outline Pictures. Oblong 4to., 3s. 6d.
Stevenson.—A Child’s Garden of Verses. By Robert Louis Stevenson.
Fcp. 8vo., 5s.
Upton (Florence K. and Bertha).
The Adventures of Two Dutch Dolls and a ‘Golliwogg’. With 31
Coloured Plates and numerous Illustrations in the Text.
Oblong 4to., 6s.
The Golliwogg’s Bicycle Club. With 31 Coloured Plates and
numerous Illustrations in the Text. Oblong 4to., 6s.
The Golliwogg at the Seaside. With 31 Coloured Plates and
numerous Illustrations in the Text. Oblong 4to., 6s.
The Golliwogg in War. With 31 Coloured Plates. Oblong 4to., 6s.
The Golliwogg’s Polar Adventures. With 31 Coloured Plates.
Oblong 4to., 6s.
The Vege-Men’s Revenge. With 31 Coloured Plates and numerous
Illustrations in the Text. Oblong 4to., 6s.
The Silver Library.
Crown 8vo. 3s. 6d. each Volume.
Arnold’s (Sir Edwin) Seas and Lands. With 71 Illustrations. 3s.
6d.
Bagehot’s (W.) Biographical Studies. 3s. 6d.
Bagehot’s (W.) Economic Studies. 3s. 6d.
Bagehot’s (W.) Literary Studies. With Portrait. 3 vols, 3s. 6d.
each.
Baker’s (Sir S. W.) Eight Years in Ceylon. With 6 Illustrations.
3s. 6d.
Baker’s (Sir S. W.) Rifle and Hound in Ceylon. With 6
Illustrations. 3s. 6d.
Baring-Gould’s (Rev. S.) Curious Myths of the Middle Ages.
3s. 6d.
Baring-Gould’s (Rev. S.) Origin and Development of
Religious Belief. 2 vols. 3s. 6d. each.
Becker’s (W. A.) Gallus: or, Roman Scenes in the Time of
Augustus. With 26 Illus. 3s. 6d.
Becker’s (W. A.) Charicles: or, Illustrations of the Private Life of
the Ancient Greeks. With 26 Illustrations. 3s. 6d.
Bent’s (J. T.) The Ruined Cities of Mashonaland. With 117
Illustrations. 3s. 6d.
Brassey’s (Lady) A Voyage in the ‘Sunbeam’. With 66
Illustrations. 3s. 6d.
Churchill’s (W. Spencer) The Story of the Malakand Field
Force, 1897. With 6 Maps and Plans. 3s. 6d.
Clodd’s (E.) Story of Creation: a Plain Account of Evolution. With
77 Illustrations. 3s. 6d.
Conybeare (Rev. W. J.) and Howson’s (Very Rev. J. S.) Life
and Epistles of St. Paul. With 46 Illustrations. 3s. 6d.
Dougall’s (L.) Beggars All: a Novel. 3s. 6d.
Doyle’s (A. Conan) Micah Clarke. A Tale of Monmouth’s
Rebellion. With 10 Illusts. 3s. 6d.
Doyle’s (A. Conan) The Captain of the Polestar, and other
Tales. 3s. 6d.
Doyle’s (A. Conan) The Refugees: A Tale of the Huguenots. With
25 Illustrations. 3s. 6d.
Doyle’s (A. Conan) The Stark Munro Letters. 3s. 6d.
Froude’s (J. A.) The History of England, from the Fall of Wolsey
to the Defeat of the Spanish Armada. 12 vols. 3s. 6d. each.
Froude’s (J. A.) The English in Ireland. 3 vols. 10s. 6d.
Froude’s (J. A.) The Divorce of Catherine of Aragon. 3s. 6d.
Froude’s (J. A.) The Spanish Story of the Armada, and other
Essays. 3s. 6d.
Froude’s (J. A.) English Seamen in the Sixteenth Century. 3s.
6d.
Froude’s (J. A.) Short Studies on Great Subjects. 4 vols. 3s.
6d. each.
Froude’s (J. A.) Oceana, or England and Her Colonies. With 9
Illustrations. 3s. 6d.
Froude’s (J. A.) The Council of Trent. 3s. 6d.
Froude’s (J. A.) The Life and Letters of Erasmus. 3s. 6d.
Froude’s (J. A.) Thomas Carlyle: a History of his Life.
1795-1835. 2 vols. 7s. 1834-1881. 2 vols. 7s.
Froude’s (J. A.) Cæsar: a Sketch. 3s. 6d.
Froude’s (J. A.) The Two Chiefs of Dunboy: an Irish Romance
of the Last Century. 3s. 6d.
Gleig’s (Rev. G. R.) Life of the Duke of Wellington. With
Portrait. 3s. 6d.
Greville’s (C. C. F.) Journal of the Reigns of King George IV.,
King William IV., and Queen Victoria. 8 vols., 3s. 6d. each.
Haggard’s (H. R.) She: A History of Adventure. With 32
Illustrations. 3s. 6d.
Haggard’s (H. R.) Allan Quatermain. With 20 Illustrations. 3s.
6d.
Haggard’s (H. R.) Colonel Quaritch, V.C.: a Tale of Country Life.
With Frontispiece and Vignette. 3s. 6d.
Haggard’s (H. R.) Cleopatra. With 29 Illustrations. 3s. 6d.
Haggard’s (H. R.) Eric Brighteyes. With 51 Illustrations. 3s. 6d.
Haggard’s (H. R.) Beatrice. With Frontispiece and Vignette. 3s.
6d.
Haggard’s (H. R.) Allan’s Wife. With 34 Illustrations. 3s. 6d.
Haggard (H. R.) Heart of the World. With 15 Illustrations. 3s.
6d.
Haggard’s (H. R.) Montezuma’s Daughter. With 25 Illustrations.
3s. 6d.
Haggard’s (H. R.) The Witch’s Head. With 16 Illustrations. 3s.
6d.
Haggard’s (H. R.) Mr. Meeson’s Will. With 16 Illustrations. 3s.
6d.
Haggard’s (H. R.) Nada the Lily. With 23 Illustrations. 3s. 6d.
Haggard’s (H. R.) Dawn. With 16 Illusts. 3s. 6d.
Haggard’s (H. R.) The People of the Mist. With 16 Illustrations.
3s. 6d.
Haggard’s (H. R.) Joan Haste. With 20 Illustrations. 3s. 6d.
Haggard (H. R.) and Lang’s (A.) The World’s Desire. With 27
Illustrations. 3s. 6d.
Harte’s (Bret) In the Carquinez Woods and other Stories. 3s.
6d.
Helmholtz’s (Hermann von) Popular Lectures on Scientific
Subjects. With 68 Illustrations. 2 vols. 3s. 6d. each.
Hope’s (Anthony) The Heart of Princess Osra. With 9
Illustrations. 3s. 6d.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebooknice.com

(Ebook) High Performance Python by Micha Gorelick, Ian Ozsvald

  • 1.
    (Ebook) High PerformancePython by Micha Gorelick, Ian Ozsvald download https://ebooknice.com/product/high-performance-python-42370716 Download more ebook instantly today at https://ebooknice.com
  • 2.
    Instant digital products(PDF, ePub, MOBI) ready for you Download now and discover formats that fit your needs... Start reading on any device today! (Ebook) High Performance Python: Practical Performant Programming for Humans by Micha Gorelick, Ian Ozsvald ISBN 9781492055020, 1492055026 https://ebooknice.com/product/high-performance-python-practical-performant- programming-for-humans-24064792 ebooknice.com (Ebook) Python High Performance by Gabriele Lanaro ISBN 9781787282896, 1787282899 https://ebooknice.com/product/python-high-performance-6781574 ebooknice.com (Ebook) Python High Performance Programming by Gabriele Lanaro ISBN 9781783288458, 1783288450 https://ebooknice.com/product/python-high-performance-programming-43140680 ebooknice.com (Ebook) Mastering Python High Performance by Fernando Doglio ISBN 9781783989300, 1783989300 https://ebooknice.com/product/mastering-python-high-performance-6809374 ebooknice.com
  • 3.
    (Ebook) Python HighPerformance Programming by Gabriele Lanaro ISBN 9781783288458, 1783288450 https://ebooknice.com/product/python-high-performance-programming-43192998 ebooknice.com (Ebook) Python High Performance Programming: Boost the performance of your Python programs using advanced techniques by Gabriele Lanaro ISBN 9781783288458, 9781782163367, 9781782161523, 9781782163923, 9781782171249, 1783288450, 1782163360, 178216152X, 1782163921 https://ebooknice.com/product/python-high-performance-programming-boost-the- performance-of-your-python-programs-using-advanced-techniques-4769998 ebooknice.com (Ebook) Fast Python: High performance techniques for large datasets (MEAP V10) by Tiago Rodrigues Antao ISBN 9781617297939, 1617297933 https://ebooknice.com/product/fast-python-high-performance-techniques-for-large- datasets-meap-v10-47525652 ebooknice.com (Ebook) Performance Through Learning: Knowledge Management in Practice (Improving Human Performance) by Carol Gorelick, Kurt April, Ph.D., Nick Milton ISBN 9780750675826, 9781417537303, 0750675829, 1417537302 https://ebooknice.com/product/performance-through-learning-knowledge-management- in-practice-improving-human-performance-1778048 ebooknice.com (Ebook) High-Performance Web Apps with FastAPI: The Asynchronous Web Framework Based on Modern Python by Malhar Lathkar ISBN 9781484291771, 1484291778 https://ebooknice.com/product/high-performance-web-apps-with-fastapi-the- asynchronous-web-framework-based-on-modern-python-48333936 ebooknice.com
  • 6.
    1. Foreword 2. Preface a.Who This Book Is For b. Who This Book Is Not For c. What You’ll Learn d. Python 3 e. Changes from Python 2.7 f. License g. How to Make an Attribution h. Errata and Feedback i. Conventions Used in This Book j. Using Code Examples k. O’Reilly Online Learning l. How to Contact Us m. Acknowledgments 3. 1. Understanding Performant Python a. The Fundamental Computer System i. Computing Units ii. Memory Units iii. Communications Layers b. Putting the Fundamental Elements Together
  • 7.
    i. Idealized ComputingVersus the Python Virtual Machine c. So Why Use Python? d. How to Be a Highly Performant Programmer i. Good Working Practices ii. Some Thoughts on Good Notebook Practice iii. Getting the Joy Back into Your Work 4. 2. Profiling to Find Bottlenecks a. Profiling Efficiently b. Introducing the Julia Set c. Calculating the Full Julia Set d. Simple Approaches to Timing—print and a Decorator e. Simple Timing Using the Unix time Command f. Using the cProfile Module g. Visualizing cProfile Output with SnakeViz h. Using line_profiler for Line-by-Line Measurements i. Using memory_profiler to Diagnose Memory Usage j. Introspecting an Existing Process with PySpy k. Bytecode: Under the Hood
  • 8.
    i. Using thedis Module to Examine CPython Bytecode ii. Different Approaches, Different Complexity l. Unit Testing During Optimization to Maintain Correctness i. No-op @profile Decorator m. Strategies to Profile Your Code Successfully n. Wrap-Up 5. 3. Lists and Tuples a. A More Efficient Search b. Lists Versus Tuples i. Lists as Dynamic Arrays ii. Tuples as Static Arrays c. Wrap-Up 6. 4. Dictionaries and Sets a. How Do Dictionaries and Sets Work? i. Inserting and Retrieving ii. Deletion iii. Resizing iv. Hash Functions and Entropy b. Dictionaries and Namespaces c. Wrap-Up
  • 9.
    7. 5. Iteratorsand Generators a. Iterators for Infinite Series b. Lazy Generator Evaluation c. Wrap-Up 8. 6. Matrix and Vector Computation a. Introduction to the Problem b. Aren’t Python Lists Good Enough? i. Problems with Allocating Too Much c. Memory Fragmentation i. Understanding perf ii. Making Decisions with perf’s Output iii. Enter numpy d. Applying numpy to the Diffusion Problem i. Memory Allocations and In-Place Operations ii. Selective Optimizations: Finding What Needs to Be Fixed e. numexpr: Making In-Place Operations Faster and Easier f. A Cautionary Tale: Verify “Optimizations” (scipy) g. Lessons from Matrix Optimizations h. Pandas
  • 10.
    i. Pandas’s InternalModel ii. Applying a Function to Many Rows of Data iii. Building DataFrames and Series from Partial Results Rather than Concatenating iv. There’s More Than One (and Possibly a Faster) Way to Do a Job v. Advice for Effective Pandas Development i. Wrap-Up 9. 7. Compiling to C a. What Sort of Speed Gains Are Possible? b. JIT Versus AOT Compilers c. Why Does Type Information Help the Code Run Faster? d. Using a C Compiler e. Reviewing the Julia Set Example f. Cython i. Compiling a Pure Python Version Using Cython g. pyximport i. Cython Annotations to Analyze a Block of Code ii. Adding Some Type Annotations
  • 11.
    h. Cython andnumpy i. Parallelizing the Solution with OpenMP on One Machine i. Numba i. Numba to Compile NumPy for Pandas j. PyPy i. Garbage Collection Differences ii. Running PyPy and Installing Modules k. A Summary of Speed Improvements l. When to Use Each Technology i. Other Upcoming Projects m. Graphics Processing Units (GPUs) i. Dynamic Graphs: PyTorch ii. Basic GPU Profiling iii. Performance Considerations of GPUs iv. When to Use GPUs n. Foreign Function Interfaces i. ctypes ii. cffi iii. f2py iv. CPython Module o. Wrap-Up
  • 12.
    10. 8. AsynchronousI/O a. Introduction to Asynchronous Programming b. How Does async/await Work? i. Serial Crawler ii. Gevent iii. tornado iv. aiohttp c. Shared CPU–I/O Workload i. Serial ii. Batched Results iii. Full Async d. Wrap-Up 11. 9. The multiprocessing Module a. An Overview of the multiprocessing Module b. Estimating Pi Using the Monte Carlo Method c. Estimating Pi Using Processes and Threads i. Using Python Objects ii. Replacing multiprocessing with Joblib iii. Random Numbers in Parallel Systems iv. Using numpy d. Finding Prime Numbers i. Queues of Work
  • 13.
    e. Verifying PrimesUsing Interprocess Communication i. Serial Solution ii. Naive Pool Solution iii. A Less Naive Pool Solution iv. Using Manager.Value as a Flag v. Using Redis as a Flag vi. Using RawValue as a Flag vii. Using mmap as a Flag viii. Using mmap as a Flag Redux f. Sharing numpy Data with multiprocessing g. Synchronizing File and Variable Access i. File Locking ii. Locking a Value h. Wrap-Up 12. 10. Clusters and Job Queues a. Benefits of Clustering b. Drawbacks of Clustering i. $462 Million Wall Street Loss Through Poor Cluster Upgrade Strategy ii. Skype’s 24-Hour Global Outage c. Common Cluster Designs d. How to Start a Clustered Solution
  • 14.
    e. Ways toAvoid Pain When Using Clusters f. Two Clustering Solutions i. Using IPython Parallel to Support Research ii. Parallel Pandas with Dask g. NSQ for Robust Production Clustering i. Queues ii. Pub/sub iii. Distributed Prime Calculation h. Other Clustering Tools to Look At i. Docker i. Docker’s Performance ii. Advantages of Docker j. Wrap-Up 13. 11. Using Less RAM a. Objects for Primitives Are Expensive i. The array Module Stores Many Primitive Objects Cheaply ii. Using Less RAM in NumPy with NumExpr b. Understanding the RAM Used in a Collection c. Bytes Versus Unicode d. Efficiently Storing Lots of Text in RAM
  • 15.
    i. Trying TheseApproaches on 11 Million Tokens e. Modeling More Text with Scikit-Learn’s FeatureHasher f. Introducing DictVectorizer and FeatureHasher i. Comparing DictVectorizer and FeatureHasher on a Real Problem g. SciPy’s Sparse Matrices h. Tips for Using Less RAM i. Probabilistic Data Structures i. Very Approximate Counting with a 1- Byte Morris Counter ii. K-Minimum Values iii. Bloom Filters iv. LogLog Counter v. Real-World Example 14. 12. Lessons from the Field a. Streamlining Feature Engineering Pipelines with Feature-engine i. Feature Engineering for Machine Learning ii. The Hard Task of Deploying Feature Engineering Pipelines iii. Leveraging the Power of Open Source Python Libraries
  • 16.
    iv. Feature-engine SmoothsBuilding and Deployment of Feature Engineering Pipelines v. Helping with the Adoption of a New Open Source Package vi. Developing, Maintaining, and Encouraging Contribution to Open Source Libraries b. Highly Performant Data Science Teams i. How Long Will It Take? ii. Discovery and Planning iii. Managing Expectations and Delivery c. Numba i. A Simple Example ii. Best Practices and Recommendations iii. Getting Help d. Optimizing Versus Thinking e. Adaptive Lab’s Social Media Analytics (2014) i. Python at Adaptive Lab ii. SoMA’s Design iii. Our Development Methodology iv. Maintaining SoMA v. Advice for Fellow Engineers
  • 17.
    f. Making DeepLearning Fly with RadimRehurek.com (2014) i. The Sweet Spot ii. Lessons in Optimizing iii. Conclusion g. Large-Scale Productionized Machine Learning at Lyst.com (2014) i. Cluster Design ii. Code Evolution in a Fast-Moving Start- Up iii. Building the Recommendation Engine iv. Reporting and Monitoring v. Some Advice h. Large-Scale Social Media Analysis at Smesh (2014) i. Python’s Role at Smesh ii. The Platform iii. High Performance Real-Time String Matching iv. Reporting, Monitoring, Debugging, and Deployment i. PyPy for Successful Web and Data Processing Systems (2014) i. Prerequisites ii. The Database
  • 18.
    iii. The WebApplication iv. OCR and Translation v. Task Distribution and Workers vi. Conclusion j. Task Queues at Lanyrd.com (2014) i. Python’s Role at Lanyrd ii. Making the Task Queue Performant iii. Reporting, Monitoring, Debugging, and Deployment iv. Advice to a Fellow Developer 15. Index
  • 19.
    High Performance Python SECONDEDITION Practical Performant Programming for Humans Micha Gorelick and Ian Ozsvald
  • 20.
    High Performance Python byMicha Gorelick and Ian Ozsvald Copyright © 2020 Micha Gorelick and Ian Ozsvald. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Tyler Ortman Indexer: Potomac Indexing, LLC Development Editor: Sarah Grey Interior Designer: David Futato Production Editor: Christopher Faucher Cover Designer: Karen Montgomery Copyeditor: Arthur Johnson Illustrator: Rebecca Demarest Proofreader: Sharon Wilkey September 2014: First Edition May 2020: Second Edition Revision History for the Second Edition
  • 21.
    2020-04-30: First release Seehttp://oreilly.com/catalog/errata.csp?isbn=9781492055020 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. High Performance Python, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the authors, and do not represent the publisher’s views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. High Performance Python is available under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 International License. 978-1-492-05502-0 [LSI]
  • 23.
    Foreword When you thinkabout high performance computing, you might imagine giant clusters of machines modeling complex weather phenomena or trying to understand signals in data collected about far-off stars. It’s easy to assume that only people building specialized systems should worry about the performance characteristics of their code. By picking up this book, you’ve taken a step toward learning the theory and practices you’ll need to write highly performant code. Every programmer can benefit from understanding how to build performant systems. There are an obvious set of applications that are just on the edge of possible, and you won’t be able to approach them without writing optimally performant code. If that’s your practice, you’re in the right place. But there is a much broader set of applications that can benefit from performant code. We often think that new technical capabilities are what drives innovation, but I’m equally fond of capabilities that increase the accessibility of technology by orders of magnitude. When something becomes ten times cheaper in time or compute costs, suddenly the set of applications you can address is wider than you imagined. The first time this principle manifested in my own work was over a decade ago, when I was working at a social media company, and we ran an analysis over multiple terabytes of
  • 24.
    data to determinewhether people clicked on more photos of cats or dogs on social media. It was dogs, of course. Cats just have better branding. This was an outstandingly frivolous use of compute time and infrastructure at the time! Gaining the ability to apply techniques that had previously been restricted to sufficiently high-value applications, such as fraud detection, to a seemingly trivial question opened up a new world of now- accessible possibilities. We were able to take what we learned from these experiments and build a whole new set of products in search and content discovery. For an example that you might encounter today, consider a machine-learning system that recognizes unexpected animals or people in security video footage. A sufficiently performant system could allow you to embed that model into the camera itself, improving privacy or, even if running in the cloud, using significantly less compute and power—benefiting the environment and reducing your operating costs. This can free up resources for you to look at adjacent problems, potentially building a more valuable system. We all desire to create systems that are effective, easy to understand, and performant. Unfortunately, it often feels like we have to pick two (or one) out of the three! High Performance Python is a handbook for people who want to make things that are capable of all three.
  • 25.
    This book standsapart from other texts on the subject in three ways. First, it’s written for us—humans who write code. You’ll find all of the context you need to understand why you might make certain choices. Second, Gorelick and Ozsvald do a wonderful job of curating and explaining the necessary theory to support that context. Finally, in this updated edition, you’ll learn the specific quirks of the most useful libraries for implementing these approaches today. This is one of a rare class of programming books that will change the way you think about the practice of programming. I’ve given this book to many people who could benefit from the additional tools it provides. The ideas that you’ll explore in its pages will make you a better programmer, no matter what language or environment you choose to work in. Enjoy the adventure. Hilary Mason, Data Scientist in Residence at Accel
  • 26.
    Preface Python is easyto learn. You’re probably here because now that your code runs correctly, you need it to run faster. You like the fact that your code is easy to modify and you can iterate with ideas quickly. The trade-off between easy to develop and runs as quickly as I need is a well-understood and often-bemoaned phenomenon. There are solutions. Some people have serial processes that have to run faster. Others have problems that could take advantage of multicore architectures, clusters, or graphics processing units. Some need scalable systems that can process more or less as expediency and funds allow, without losing reliability. Others will realize that their coding techniques, often borrowed from other languages, perhaps aren’t as natural as examples they see from others. In this book we will cover all of these topics, giving practical guidance for understanding bottlenecks and producing faster and more scalable solutions. We also include some war stories from those who went ahead of you, who took the knocks so you don’t have to. Python is well suited for rapid development, production deployments, and scalable systems. The ecosystem is full of
  • 27.
    people who areworking to make it scale on your behalf, leaving you more time to focus on the more challenging tasks around you.
  • 28.
    Who This BookIs For You’ve used Python for long enough to have an idea about why certain things are slow and to have seen technologies like Cython, numpy, and PyPy being discussed as possible solutions. You might also have programmed with other languages and so know that there’s more than one way to solve a performance problem. While this book is primarily aimed at people with CPU-bound problems, we also look at data transfer and memory-bound solutions. Typically, these problems are faced by scientists, engineers, quants, and academics. We also look at problems that a web developer might face, including the movement of data and the use of just-in-time (JIT) compilers like PyPy and asynchronous I/O for easy-win performance gains. It might help if you have a background in C (or C++, or maybe Java), but it isn’t a prerequisite. Python’s most common interpreter (CPython—the standard you normally get if you type python at the command line) is written in C, and so the hooks and libraries all expose the gory inner C machinery. There are lots of other techniques that we cover that don’t assume any knowledge of C. You might also have a lower-level knowledge of the CPU, memory architecture, and data buses, but again, that’s not
  • 29.
  • 30.
    Who This BookIs Not For This book is meant for intermediate to advanced Python programmers. Motivated novice Python programmers may be able to follow along as well, but we recommend having a solid Python foundation. We don’t cover storage-system optimization. If you have a SQL or NoSQL bottleneck, then this book probably won’t help you. What You’ll Learn Your authors have been working with large volumes of data, a requirement for I want the answers faster! and a need for scalable architectures, for many years in both industry and academia. We’ll try to impart our hard-won experience to save you from making the mistakes that we’ve made. At the start of each chapter, we’ll list questions that the following text should answer. (If it doesn’t, tell us and we’ll fix it in the next revision!) We cover the following topics: Background on the machinery of a computer so you know what’s happening behind the scenes Lists and tuples—the subtle semantic and speed differences in these fundamental data structures Dictionaries and sets—memory allocation strategies and access algorithms in these important data
  • 31.
    structures Iterators—how to writein a more Pythonic way and open the door to infinite data streams using iteration Pure Python approaches—how to use Python and its modules effectively Matrices with numpy—how to use the beloved numpy library like a beast Compilation and just-in-time computing—processing faster by compiling down to machine code, making sure you’re guided by the results of profiling Concurrency—ways to move data efficiently multiprocessing—various ways to use the built-in multiprocessing library for parallel computing and to efficiently share numpy matrices, and some costs and benefits of interprocess communication (IPC) Cluster computing—convert your multiprocessing code to run on a local or remote cluster for both research and production systems Using less RAM—approaches to solving large problems without buying a humungous computer Lessons from the field—lessons encoded in war stories from those who took the blows so you don’t have to Python 3 Python 3 is the standard version of Python as of 2020, with Python 2.7 deprecated after a 10-year migration process. If you’re still on Python 2.7, you’re doing it wrong—many libraries
  • 32.
    are no longersupported for your line of Python, and support will become more expensive over time. Please do the community a favor and migrate to Python 3, and make sure that all new projects use Python 3. In this book, we use 64-bit Python. Whilst 32-bit Python is supported, it is far less common for scientific work. We’d expect all the libraries to work as usual, but numeric precision, which depends on the number of bits available for counting, is likely to change. 64-bit is dominant in this field, along with *nix environments (often Linux or Mac). 64-bit lets you address larger amounts of RAM. *nix lets you build applications that can be deployed and configured in well-understood ways with well- understood behaviors. If you’re a Windows user, you’ll have to buckle up. Most of what we show will work just fine, but some things are OS- specific, and you’ll have to research a Windows solution. The biggest difficulty a Windows user might face is the installation of modules: research in sites like Stack Overflow should give you the solutions you need. If you’re on Windows, having a virtual machine (e.g., using VirtualBox) with a running Linux installation might help you to experiment more freely. Windows users should definitely look at a packaged solution like those available through Anaconda, Canopy, Python(x,y), or Sage. These same distributions will make the lives of Linux and Mac users far simpler too.
  • 33.
    Changes from Python2.7 If you’ve upgraded from Python 2.7, you might not be aware of a few relevant changes: / meant integer division in Python 2.7, whereas it performs float division in Python 3. str and unicode were used to represent text data in Python 2.7; in Python 3, everything is a str, and these are always Unicode. For clarity, a bytes type is used if we’re using unencoded byte sequences. If you’re in the process of upgrading your code, two good guides are “Porting Python 2 Code to Python 3” and “Supporting Python 3: An in-depth guide”. With a distribution like Anaconda or Canopy, you can run both Python 2 and Python 3 simultaneously—this will simplify your porting. License This book is licensed under Creative Commons Attribution- NonCommercial-NoDerivs 3.0. You’re welcome to use this book for noncommercial purposes, including for noncommercial teaching. The license allows only for complete reproductions; for partial reproductions, please contact O’Reilly (see “How to Contact Us”). Please attribute the book as noted in the following section.
  • 34.
    We negotiated thatthe book should have a Creative Commons license so the contents could spread further around the world. We’d be quite happy to receive a beer if this decision has helped you. We suspect that the O’Reilly staff would feel similarly about the beer. How to Make an Attribution The Creative Commons license requires that you attribute your use of a part of this book. Attribution just means that you should write something that someone else can follow to find this book. The following would be sensible: “High Performance Python, 2nd ed., by Micha Gorelick and Ian Ozsvald (O’Reilly). Copyright 2020 Micha Gorelick and Ian Ozsvald, 978-1-492- 05502-0.” Errata and Feedback We encourage you to review this book on public sites like Amazon—please help others understand if they would benefit from this book! You can also email us at feedback@highperformancepython.com. We’re particularly keen to hear about errors in the book, successful use cases where the book has helped you, and high performance techniques that we should cover in the next edition. You can access the web page for this book at https://oreil.ly/high-performance-python-2e.
  • 35.
    Complaints are welcomedthrough the instant-complaint- transmission-service > /dev/null. Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, datatypes, environment variables, statements, and keywords. Constant width bold Shows commands or other text that should be typed literally by the user. Constant width italic Shows text that should be replaced with user-supplied values or by values determined by context. TIP This element signifies a tip, suggestion, or critical thinking question.
  • 36.
    NOTE This element signifiesa general note. WARNING This element indicates a warning or caution. Using Code Examples Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/mynameisfiber/high_performance_python_2 e. If you have a technical question or a problem using the code examples, please send email to bookquestions@oreilly.com. This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this
  • 37.
    book into yourproduct’s documentation does require permission. If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. O’Reilly Online Learning NOTE For more than 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit http://oreilly.com. How to Contact Us Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc.
  • 38.
    1005 Gravenstein HighwayNorth Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) 707-829-0515 (international or local) 707-829-0104 (fax) Email bookquestions@oreilly.com to comment or ask technical questions about this book. For news and more information about our books and courses, see our website at http://oreilly.com. Find us on Facebook: http://facebook.com/oreilly Follow us on Twitter: http://twitter.com/oreillymedia Watch us on YouTube: http://youtube.com/oreillymedia Acknowledgments Hilary Mason wrote our foreword—thanks for composing such a wonderful opening narrative for our book. Giles Weaver and Dimitri Denisjonok provided invaluable technical feedback on this edition; great work, chaps. Thanks to Patrick Cooper, Kyran Dale, Dan Foreman-Mackey, Calvin Giles, Brian Granger, Jamie Matthews, John
  • 39.
    Montgomery, Christian SchouOxvig, Matt “snakes” Reiferson, Balthazar Rouberol, Michael Skirpan, Luke Underwood, Jake Vanderplas, and William Winter for invaluable feedback and contributions. Ian thanks his wife, Emily, for letting him disappear for another eight months to write this second edition (thankfully, she’s terribly understanding). Ian apologizes to his dog for sitting and writing rather than walking in the woods quite as much as she’d have liked. Micha thanks Marion and the rest of his friends and family for being so patient while he learned to write. O’Reilly editors are rather lovely to work with; do strongly consider talking to them if you want to write your own book. Our contributors to the “Lessons from the Field” chapter very kindly shared their time and hard-won lessons. We give thanks to Soledad Galli, Linda Uruchurtu, Vanentin Haenel, and Vincent D. Warmerdam for this edition and to Ben Jackson, Radim Řehůřek, Sebastjan Trepca, Alex Kelly, Marko Tasic, and Andrew Godwin for their time and effort during the previous edition.
  • 40.
    Chapter 1. Understanding PerformantPython QUESTIONS YOU’LL BE ABLE TO ANSWER AFTER THIS CHAPTER What are the elements of a computer’s architecture? What are some common alternate computer architectures? How does Python abstract the underlying computer architecture? What are some of the hurdles to making performant Python code? What strategies can help you become a highly performant programmer? Programming computers can be thought of as moving bits of data and transforming them in special ways to achieve a particular result. However, these actions have a time cost. Consequently, high performance programming can be thought of as the act of minimizing these operations either by reducing the overhead (i.e., writing more efficient code) or by changing the way that we do these operations to make each one more meaningful (i.e., finding a more suitable algorithm). Let’s focus on reducing the overhead in code in order to gain more insight into the actual hardware on which we are moving these bits. This may seem like a futile exercise, since Python works quite hard to abstract away direct interactions with the hardware. However, by understanding both the best way that
  • 41.
    bits can bemoved in the real hardware and the ways that Python’s abstractions force your bits to move, you can make progress toward writing high performance programs in Python. The Fundamental Computer System The underlying components that make up a computer can be simplified into three basic parts: the computing units, the memory units, and the connections between them. In addition, each of these units has different properties that we can use to understand them. The computational unit has the property of how many computations it can do per second, the memory unit has the properties of how much data it can hold and how fast we can read from and write to it, and finally, the connections have the property of how fast they can move data from one place to another. Using these building blocks, we can talk about a standard workstation at multiple levels of sophistication. For example, the standard workstation can be thought of as having a central processing unit (CPU) as the computational unit, connected to both the random access memory (RAM) and the hard drive as two separate memory units (each having different capacities and read/write speeds), and finally a bus that provides the connections between all of these parts. However, we can also go into more detail and see that the CPU itself has several memory units in it: the L1, L2, and sometimes even the L3 and L4 cache, which have small capacities but very fast speeds (from several kilobytes to a dozen megabytes). Furthermore,
  • 42.
    new computer architecturesgenerally come with new configurations (for example, Intel’s SkyLake CPUs replaced the frontside bus with the Intel Ultra Path Interconnect and restructured many connections). Finally, in both of these approximations of a workstation we have neglected the network connection, which is effectively a very slow connection to potentially many other computing and memory units! To help untangle these various intricacies, let’s go over a brief description of these fundamental blocks. Computing Units The computing unit of a computer is the centerpiece of its usefulness—it provides the ability to transform any bits it receives into other bits or to change the state of the current process. CPUs are the most commonly used computing unit; however, graphics processing units (GPUs) are gaining popularity as auxiliary computing units. They were originally used to speed up computer graphics but are becoming more applicable for numerical applications and are useful thanks to their intrinsically parallel nature, which allows many calculations to happen simultaneously. Regardless of its type, a computing unit takes in a series of bits (for example, bits representing numbers) and outputs another set of bits (for example, bits representing the sum of those numbers). In addition to the basic arithmetic operations on integers and real numbers and bitwise operations on binary numbers, some computing units also provide very specialized operations, such
  • 43.
    as the “fusedmultiply add” operation, which takes in three numbers, A, B, and C, and returns the value A * B + C. The main properties of interest in a computing unit are the number of operations it can do in one cycle and the number of cycles it can do in one second. The first value is measured by its instructions per cycle (IPC), while the latter value is measured by its clock speed. These two measures are always competing with each other when new computing units are being made. For example, the Intel Core series has a very high IPC but a lower clock speed, while the Pentium 4 chip has the reverse. GPUs, on the other hand, have a very high IPC and clock speed, but they suffer from other problems like the slow communications that we discuss in “Communications Layers”. Furthermore, although increasing clock speed almost immediately speeds up all programs running on that computational unit (because they are able to do more calculations per second), having a higher IPC can also drastically affect computing by changing the level of vectorization that is possible. Vectorization occurs when a CPU is provided with multiple pieces of data at a time and is able to operate on all of them at once. This sort of CPU instruction is known as single instruction, multiple data (SIMD). In general, computing units have advanced quite slowly over the past decade (see Figure 1-1). Clock speeds and IPC have both been stagnant because of the physical limitations of making transistors smaller and smaller. As a result, chip 1
  • 44.
    manufacturers have beenrelying on other methods to gain more speed, including simultaneous multithreading (where multiple threads can run at once), more clever out-of-order execution, and multicore architectures. Hyperthreading presents a virtual second CPU to the host operating system (OS), and clever hardware logic tries to interleave two threads of instructions into the execution units on a single CPU. When successful, gains of up to 30% over a single thread can be achieved. Typically, this works well when the units of work across both threads use different types of execution units—for example, one performs floating-point operations and the other performs integer operations. Out-of-order execution enables a compiler to spot that some parts of a linear program sequence do not depend on the results of a previous piece of work, and therefore that both pieces of work could occur in any order or at the same time. As long as sequential results are presented at the right time, the program continues to execute correctly, even though pieces of work are computed out of their programmed order. This enables some instructions to execute when others might be blocked (e.g., waiting for a memory access), allowing greater overall utilization of the available resources. Finally, and most important for the higher-level programmer, there is the prevalence of multicore architectures. These architectures include multiple CPUs within the same unit, which increases the total capability without running into barriers to
  • 45.
    making each individualunit faster. This is why it is currently hard to find any machine with fewer than two cores—in this case, the computer has two physical computing units that are connected to each other. While this increases the total number of operations that can be done per second, it can make writing code more difficult! Figure 1-1. Clock speed of CPUs over time (from CPU DB) Simply adding more cores to a CPU does not always speed up a program’s execution time. This is because of something known as Amdahl’s law. Simply stated, Amdahl’s law is this: if a program designed to run on multiple cores has some subroutines that must run on one core, this will be the limitation for the maximum speedup that can be achieved by allocating more cores. For example, if we had a survey we wanted one hundred people to fill out, and that survey took 1 minute to complete, we could complete this task in 100 minutes if we had one person asking the questions (i.e., this person goes to participant 1, asks the questions, waits for the responses, and then moves to participant 2). This method of having one person asking the questions and waiting for responses is similar to a serial process. In serial processes, we have operations being satisfied one at a time, each one waiting for the previous operation to complete. However, we could perform the survey in parallel if we had two people asking the questions, which would let us finish the
  • 46.
    process in only50 minutes. This can be done because each individual person asking the questions does not need to know anything about the other person asking questions. As a result, the task can easily be split up without having any dependency between the question askers. Adding more people asking the questions will give us more speedups, until we have one hundred people asking questions. At this point, the process would take 1 minute and would be limited simply by the time it takes a participant to answer questions. Adding more people asking questions will not result in any further speedups, because these extra people will have no tasks to perform—all the participants are already being asked questions! At this point, the only way to reduce the overall time to run the survey is to reduce the amount of time it takes for an individual survey, the serial portion of the problem, to complete. Similarly, with CPUs, we can add more cores that can perform various chunks of the computation as necessary until we reach a point where the bottleneck is the time it takes for a specific core to finish its task. In other words, the bottleneck in any parallel calculation is always the smaller serial tasks that are being spread out. Furthermore, a major hurdle with utilizing multiple cores in Python is Python’s use of a global interpreter lock (GIL). The GIL makes sure that a Python process can run only one instruction at a time, regardless of the number of cores it is currently using. This means that even though some Python code has access to multiple cores at a time, only one core is
  • 47.
    running a Pythoninstruction at any given time. Using the previous example of a survey, this would mean that even if we had 100 question askers, only one person could ask a question and listen to a response at a time. This effectively removes any sort of benefit from having multiple question askers! While this may seem like quite a hurdle, especially if the current trend in computing is to have multiple computing units rather than having faster ones, this problem can be avoided by using other standard library tools, like multiprocessing (Chapter 9), technologies like numpy or numexpr (Chapter 6), Cython (Chapter 7), or distributed models of computing (Chapter 10). NOTE Python 3.2 also saw a major rewrite of the GIL, which made the system much more nimble, alleviating many of the concerns around the system for single-thread performance. Although it still locks Python into running only one instruction at a time, the GIL now does better at switching between those instructions and doing so with less overhead. Memory Units Memory units in computers are used to store bits. These could be bits representing variables in your program or bits representing the pixels of an image. Thus, the abstraction of a memory unit applies to the registers in your motherboard as well as your RAM and hard drive. The one major difference between all of these types of memory units is the speed at which they can read/write data. To make things more
  • 48.
    complicated, the read/writespeed is heavily dependent on the way that data is being read. For example, most memory units perform much better when they read one large chunk of data as opposed to many small chunks (this is referred to as sequential read versus random data). If the data in these memory units is thought of as pages in a large book, this means that most memory units have better read/write speeds when going through the book page by page rather than constantly flipping from one random page to another. While this fact is generally true across all memory units, the amount that this affects each type is drastically different. In addition to the read/write speeds, memory units also have latency, which can be characterized as the time it takes the device to find the data that is being used. For a spinning hard drive, this latency can be high because the disk needs to physically spin up to speed and the read head must move to the right position. On the other hand, for RAM, this latency can be quite small because everything is solid state. Here is a short description of the various memory units that are commonly found inside a standard workstation, in order of read/write speeds: Spinning hard drive Long-term storage that persists even when the computer is shut down. Generally has slow read/write speeds because the disk must be physically spun and moved. Degraded 2
  • 49.
    performance with randomaccess patterns but very large capacity (10 terabyte range). Solid-state hard drive Similar to a spinning hard drive, with faster read/write speeds but smaller capacity (1 terabyte range). RAM Used to store application code and data (such as any variables being used). Has fast read/write characteristics and performs well with random access patterns, but is generally limited in capacity (64 gigabyte range). L1/L2 cache Extremely fast read/write speeds. Data going to the CPU must go through here. Very small capacity (megabytes range). Figure 1-2 gives a graphic representation of the differences between these types of memory units by looking at the characteristics of currently available consumer hardware. A clearly visible trend is that read/write speeds and capacity are inversely proportional—as we try to increase speed, capacity gets reduced. Because of this, many systems implement a tiered approach to memory: data starts in its full state in the hard drive, part of it moves to RAM, and then a much smaller subset moves to the L1/L2 cache. This method of tiering enables programs to keep memory in different places depending on access speed requirements. When trying to optimize the memory patterns of a program, we are simply
  • 50.
    Exploring the Varietyof Random Documents with Different Content
  • 51.
    Devas.—A Manual ofPolitical Economy. By C. S. Devas, M.A., Cr. 8vo., 7s. 6d. (Stonyhurst Philosophical Series.) Jordan.—The Standard of Value. By William Leighton Jordan. Cr. 8vo., 6s. Lawrence.—Local Variations in Wages. By F. W. Lawrence, M.A. With Index and 18 Maps and Diagrams. 4to., 8s. 6d. Leslie.—Essays on Political Economy. By T. E. Cliffe Leslie, Hon. Ll.D., Dubl. 8vo., 10s. 6d. Macleod (Henry Dunning). Economics for Beginners. Crown 8vo., 2s. The Elements of Economics. 2 vols. Crown 8vo., 3s. 6d. each. Bimetalism. 8vo., 5s. net. The Elements of Banking. Cr. 8vo., 3s. 6d. The Theory and Practice Of Banking. Vol. I. 8vo., 12s. Vol. II. 14s. The Theory of Credit. 8vo. In 1 Vol., 30s. net; or separately, Vol. I., 10s. net. Vol. II., Part I., 10s. net. Vol II., Part II. 10s. net. Indian Currency. 8vo., 2s. 6d. net. Mill.—Political Economy. By John Stuart Mill. Popular Edition. Cr. 8vo., 3s. 6d. Library Edition. 2 vols. 8vo., 30s. Mulhall.—Industries and Wealth of Nations. By Michael G. Mulhall, F.S.S. With 32 Diagrams. Cr. 8vo., 8s. 6d. Spahr.—America’s Working People. By Charles B. Spahr. Crown 8vo., 5s. net. Symes.—Political Economy: a Short Text-book of Political Economy. With Problems for Solution, Hints for Supplementary Reading, and a Supplementary Chapter on Socialism. By J. E. Symes, M.A. Crown 8vo., 2s. 6d.
  • 52.
    Toynbee.—Lectures on theIndustrial Revolution of the 18th Century in England. By Arnold Toynbee. 8vo., 10s. 6d. Webb (Sidney and Beatrice). The History of Trade Unionism. With Map and Bibliography. 8vo., 18s. Industrial Democracy: a Study in Trade Unionism. 2 vols. 8vo., 25s. net. Problems of Modern Industry: Essays. 8vo., 7s. 6d. Evolution, Anthropology, &c. Clodd (Edward). The Story of Creation: a Plain Account of Evolution. With 77 Illustrations. Crown 8vo., 3s. 6d. A Primer of Evolution: being a Popular Abridged Edition of ‘The Story of Creation’. With Illustrations. Fcp. 8vo., 1s. 6d. Lang (Andrew). Custom and Myth: Studies of Early Usage and Belief. With 15 Illustrations. Crown 8vo., 3s. 6 d. Myth, Ritual, and Religion. 2 vols. Crown 8vo., 7s. Modern Mythology: a Reply to Professor Max Müller. 8vo., 9s. The Making of Religion. Cr. 8vo., 5 s. net. Lubbock.—The Origin of Civilisation, and the Primitive Condition of Man. By Sir J. Lubbock, Bart., M.P. (Lord Avebury). With 5 Plates and 20 Illustrations. 8vo., 18 s. Max Müller (The Right Hon. F.). Chips from a German Workshop. Vol. IV. Essays on Mythology and Folk Lore. Crown 8vo., 5s. Contributions to the Science of Mythology. 2 vols. 8vo., 32s.
  • 53.
    Romanes (George John). Essays.Edited by C. Lloyd Morgan. Crown 8vo., 5s. net. Darwin, and after Darwin: an Exposition of the Darwinian Theory, and a Discussion on Post-Darwinian Questions. Part I. The Darwinian Theory. With Portrait of Darwin and 125 Illustrations. Crown 8vo., 10s. 6d. Part II. Post-Darwinian Questions: Heredity and Utility. With Portrait of the Author and 5 Illustrations. Cr. 8vo., 10s. 6d. Part III. Post-Darwinian Questions: Isolation and Physiological Selection. Crown 8vo., 5s. An Examination of Weismannism. Crown 8vo., 6s. Classical Literature, Translations, &c. Abbott.—Hellenica. A Collection of Essays on Greek Poetry, Philosophy, History, and Religion. Edited by Evelyn Abbott, M.A., LL.D. Crown 8vo., 7s. 6d. Æschylus.—Eumenides of Æschylus. With Metrical English Translation. By J. F. Davies. 8vo., 7s. Aristophanes.—The Acharnians of Aristophanes, translated into English Verse. By R. Y. Tyrrell. Crown 8vo., 1s. Becker (W. A.), Translated by the Rev. F. Metcalfe, B.D. Gallus: or, Roman Scenes in the Time of Augustus. With Notes and Excursuses. With 26 Illustrations. Crown 8vo., 3s. 6d. Charicles: or, Illustrations of the Private Life of the Ancient Greeks. With Notes and Excursuses. With 26 Illustrations. Crown 8vo., 3s. 6d. Butler.—The Authoress of the Odyssey, where and when She wrote, who She was, the Use She made of the Iliad, and how the Poem grew under
  • 54.
    Her hands. BySamuel Butler. With 14 Illustrations and 4 Maps. 8vo., 10s. 6d. Campbell.—Religion in Greek Literature. By the Rev. Lewis Campbell, M.A., LL.D., Emeritus Professor of Greek, University of St. Andrews. 8vo., 15s. Cicero.—Cicero’s Correspondence. By R. Y. Tyrrell. Vols. I., II., III., 8vo., each 12s. Vol. IV., 15s. Vol. V., 14s. Vol. VI., 12s. Vol. VII. Index, 7s. 6d. Harvard Studies in Classical Philology, 1900. Edited by a Committee of the Classical Instructors of Harvard University. Vol. XI. 1900. 8vo., 6s. 6d. net. Hime.—Lucian, the Syrian Satirist. By Lieut.-Col. Henry W. L. Hime, (late) Royal Artillery. 8vo., 5s. net. Homer. The Iliad of Homer. Freely rendered into English Prose for the use of those who cannot read the original. By Samuel Butler, Author of ‘Erewhon,’ etc. Crown 8vo., 7s. 6d. The Odyssey. Rendered into English Prose for the use of those that cannot read the original. By Samuel Butler. With 4 Maps and 7 Illustrations. 8vo., 7s. 6d. The Odyssey of Homer. Done into English Verse. By William Morris. Crown 8vo., 6s. Horace.—The Works of Horace, rendered into English Prose. With Life, Introduction and Notes. By William Coutts, M.A. Crown 8vo., 5s. net. Lang.—Homer and the Epic. By Andrew Lang. Crown 8vo., 9s. net. Lucan.—The Pharsalia of Lucan. Translated into Blank Verse. By Sir Edward Ridley. 8vo., 14s. Mackail.—Select Epigrams from the Greek Anthology. By J. W. Mackail. Edited with a Revised Text, Introduction, Translation, and Notes.
  • 55.
    8vo., 16s. Rich.—A Dictionaryof Roman and Greek Antiquities. By A. Rich, B.A. With 2000 Woodcuts. Crown 8vo., 6s. net. Sophocles.—Translated into English Verse. By Robert Whitelaw, M.A., Assistant Master in Rugby School. Cr. 8vo., 8s. 6d. Tyrrell.—Dublin Translations into Greek and Latin Verse. Edited by R. Y. Tyrrell. 8vo., 6s. Virgil. The Poems of Virgil. Translated into English Prose by John Conington. Crown 8vo., 6s. The Æneid of Virgil. Translated into English Verse by John Conington. Crown 8vo., 6s. The Æneids of Virgil. Done into English Verse. By William Morris. Crown 8vo., 6s. The Æneid of Virgil, freely translated into English Blank Verse. By W. J. Thornhill. Crown 8vo., 6s. net. The Æneid of Virgil. Translated into English Verse by James Rhoades. Books I.-VI. Crown 8vo., 5s. Books VII.-XII. Crown 8vo., 5s. The Eclogues and Georgics of Virgil. Translated into English Prose by J. W. Mackail, Fellow of Balliol College, Oxford. 16mo., 5s. Wilkins.—The Growth of the Homeric Poems. By G. Wilkins. 8vo., 6s. Poetry and the Drama. Arnold.—The Light of the World: or, The Great Consummation. By Sir Edwin Arnold. With 14 Illustrations after Holman Hunt. Crown 8vo., 5s. net. Bell (Mrs. Hugh).
  • 56.
    Chamber Comedies: aCollection of Plays and Monologues for the Drawing Room. Crown 8vo., 5s. net. Fairy Tale Plays, and How to Act Them. With 91 Diagrams and 52 Illustrations. Crown 8vo., 3s. net. Rumpelstiltzkin: a Fairy Play in Five Scenes (Characters, 7 Male; 1 Female). From ‘Fairy Tale Plays and How to Act Them’. With Illustrations, Diagrams and Music. Cr. 8vo., sewed, 6d. Bird.—Ronald’s Farewell, and other Verses. By George Bird, M.A., Vicar of Bradwell, Derbyshire. Fcp. 8vo., 4s. 6d. net. Coleridge.—Selections from. With Introduction by Andrew Lang. With 18 Illustrations by Patten Wilson. Crown 8vo., 3s. 6d. Comparetti.—The Traditional Poetry of the Finns. By Domenico Comparetti, Socio dell’Accademia dei Lincei, Membre de l’Académie des Inscriptions, etc. Translated by Isabella M. Anderton. With Introduction by Andrew Lang. 8vo., 16s. Goethe.—The First Part of the Tragedy of Faust in English. By Thos. E. Webb, LL.D., sometime Fellow of Trinity College; Professor of Moral Philosophy in the University of Dublin, etc. New and Cheaper Edition, with The Death of Faust, from the Second Part. Crown 8vo., 6s. Ingelow (Jean). Poetical Works. Complete in One Volume. Crown 8vo., 6s. net. Lyrical and other Poems. Selected from the Writings of Jean Ingelow. Fcp. 8vo., 2s. 6d. cloth plain, 3s. cloth gilt. Lang (Andrew). Grass of Parnassus. Fcp, 8vo., 2s. 6d. net. The Blue Poetry Book. Edited by Andrew Lang. With 100 Illustrations. Crown 8vo., 6s. Lecky.—Poems. By the Right Hon. W. E. H. Lecky. Fcp. 8vo., 5s. Lytton (The Earl of), (Owen Meredith).
  • 57.
    The Wanderer. Cr.8vo., 10s. 6d. Lucile. Crown 8vo., 10s. 6d. Selected Poems. Cr. 8vo., 10s. 6d. Macaulay.—Lays of Ancient Rome, with ‘Ivry’ and ‘The Armada’. By Lord Macaulay. Illustrated by G. Scharf. Fcp. 4to., 10s. 6d. —— Bijou Edition. 18mo., 2s. 6d. gilt top. —— Popular Edition. Fcp. 4to., 6d. sewed, 1s. cloth. Illustrated by J. R. Weguelin. Crown 8vo., 3s. net. Annotated Edition. Fcp. 8vo., 1s. sewed, 1s. 6d. cloth. MacDonald (George, LL.D.). A Book of Strife, in the Form of the Diary of an Old Soul: Poems. 18mo., 6s. Rampolli: Growths from a Long-Planted Root: being Translations, New and Old (mainly in verse), chiefly from the German; along with ‘A Year’s Diary of an Old Soul’. Crown 8vo., 6s. Moffat.—Crickety Cricket: Rhymes and Parodies. By Douglas Moffat. With Frontispiece by the late Sir Frank Lockwood, and 53 Illustrations by the Author. Crown 8vo, 2s. 6d. Moon.—Poems of Love and Home. By George Washington Moon, Hon. F.R.S.L. With Portrait. 16mo., 2s. 6d. Morris (William). POETICAL WORKS—Library Edition. Complete in 11 volumes. Crown 8vo., price 5s. net each. The Earthly Paradise. 4 vols. Crown 8vo., 5s. net each. The Life and Death of Jason. Crown 8vo., 5s. net. The Defence of Guenevere, and other Poems. Crown 8vo., 5s. net.
  • 58.
    The Story ofSigurd the Volsung, and The Fall of the Niblungs. Cr. 8vo., 5s. net. Poems by the Way, and Love is Enough. Crown 8vo., 5s. net. The Odyssey of Homer. Done into English Verse. Crown 8vo., 5s. net. The Æneids of Virgil. Done into English Verse. Crown 8vo., 5s. net. The Tale of Beowulf, sometime King of the Folk of the Wedergeats. Translated by William Morris and A. J. Wyatt. Crown 8vo., 5s. net. Certain of the Poetical Works may also be had in the following Editions:— The Earthly Paradise. Popular Edition. 5 vols. 12mo., 25s.; or 5s. each, sold separately. The same in Ten Parts, 25s.; or 2s. 6d. each, sold separately. Cheap Edition, in 1 vol. Crown 8vo., 6s. net. Poems by the Way. Square crown 8vo., 6s. ⁂ For Mr. William Morris’s Prose Works, see pp. 22 and 31. Morte Arthur: an Alliterative Poem of the Fourteenth Century. Edited from the Thornton MS., with Introduction, Notes and Glossary. By Mary Macleod Banks. Fcp. 8vo., 3s. 6d. Nesbit.—Lays and Legends. By E. Nesbit (Mrs. Hubert Bland). First Series. Crown 8vo., 3s. 6d. Second Series. With Portrait. Crown 8vo., 5s. Pooler.—Translations, and other Verses. By C. K. Pooler, M.A. Fcp. 8vo., 3s. net.
  • 59.
    Riley.—Old Fashioned Roses:Poems. By James Whitcomb Riley. 12mo., 5s. Romanes.—A Selection from the Poems of George John Romanes, M.A., LL.D., F.R.S. With an Introduction by T. Herbert Warren, President of Magdalen College, Oxford. Crown 8vo., 4s. 6d. Shakespeare. Bowdler’s Family Shakespeare. With 36 Woodcuts. 1 vol. 8vo., 14s. Or in 6 vols. Fcp. 8vo., 21s. The Shakespeare Birthday Book. By Mary F. Dunbar. 32mo., 1s. 6d. Shakespeare’s Sonnets. Reconsidered, and in part Rearranged, with Introductory Chapters and a Reprint of the Original 1609 Edition, by Samuel Butler, Author of ‘Erewhon’. 8vo., 10s. 6d. Savage-Armstrong.—Ballads of Down. By G. F. Savage-Armstrong, M.A., D.Litt. Crown 8vo., 7s. 6d. Stevenson.—A Child’s Garden of Verses. By Robert Louis Stevenson. Fcp. 8vo., 5s. Wagner.—The Nibelungen Ring. Done into English Verse by Reginald Rankin, B.A. of the Inner Temple, Barrister-at-Law. Vol. I. Rhine Gold and Valkyrie. Fcp. 8vo., 4s. 6d. Wordsworth.—Selected Poems. By Andrew Lang. With Photogravure Frontispiece of Rydal Mount. With 16 Illustrations and numerous Initial Letters. By Alfred Parsons, A.R.A. Crown 8vo., gilt edges, 3s. 6d. Wordsworth and Coleridge.—A Description of the Wordsworth and Coleridge Manuscripts in the Possession of Mr. T. Norton Longman. Edited, with Notes, by W. Hale White. With 3 Facsimile Reproductions. 4to., 10s. 6d. Fiction, Humour, &c.
  • 60.
    Anstey.—Voces Populi. (Reprintedfrom ‘Punch’.) By F. Anstey, Author of ‘Vice Versâ’. First Series. With 20 Illustrations by J. Bernard Partridge. Cr. 8vo., 3s. net. Second Series. With 25 Illustrations by J. Bernard Partridge. Cr. 8vo., 3s. net. Bailey.—My Lady of Orange: a Romance of the Netherlands in the Days of Alva. By H. C. Bailey. With 8 Illustrations. Crown 8vo., 6s. Beaconsfield (The Earl of). Novels and Tales. Complete in 11 vols. Crown 8vo., 1s. 6d. each. Vivian Grey. The Young Duke, etc. Alroy, Ixion, etc. Contarini Fleming, etc. Tancred. Sybil. Henrietta Temple. Venetia. Coningsby. Lothair. Endymion. Novels and Tales. The Hughenden Edition. With 2 Portraits and 11 Vignettes. 11 Vols. Crown 8vo., 42s. ‘Chola.’—A New Divinity, and other Stories of Hindu Life. By ‘Chola’. Crown 8vo., 2s. 6d. Churchill.—Savrola: a Tale of the Revolution in Laurania. By Winston Spencer Churchill, M.P. Cr. 8vo., 6s. Crawford.—The Autobiography of a Tramp. By J. H. Crawford. With a Photogravure Frontispiece ‘The Vagrants,’ by Fred. Walker, and 8
  • 61.
    other Illustrations. Crown8vo., 5s. net. Creed.—The Vicar of St. Luke’s: a Novel. By Sibyl Creed. Cr. 8vo., 6s. Dougall.—Beggars All. By L. Dougall. Crown 8vo., 3s. 6d. Doyle (A. Conan). Micah Clarke: A Tale of Monmouth’s Rebellion. With 10 Illustrations. Cr. 8vo., 3s. 6d. The Refugees: A Tale of the Huguenots. With 25 Illustrations. Cr. 8vo., 3s. 6d. The Stark Munro Letters. Cr. 8vo, 3s. 6d. The Captain of the Polestar, and other Tales. Cr. 8vo., 3s. 6d. Farrar (F. W., Dean of Canterbury). Darkness and Dawn: or, Scenes in the Days of Nero. An Historic Tale. Cr. 8vo., 6s. net. Gathering Clouds: a Tale of the Days of St. Chrysostom. Cr. 8vo., 6s. net. Fowler (Edith H.). The Young Pretenders. A Story of Child Life. With 12 Illustrations by Sir Philip Burne-Jones, Bart. Crown 8vo., 6s. The Professor’s Children. With 24 Illustrations by Ethel Kate Burgess. Crown 8vo., 6s. Francis (M. E.). Yeoman Fleetwood. Cr. 8vo., 6s. Pastorals of Dorset. With 8 Illustrations. Crown 8vo., 6s. Froude.—The Two Chiefs of Dunboy: an Irish Romance of the Last Century. By James A. Froude. Cr. 8vo., 3s. 6d. Gurdon.—Memories and Fancies: Suffolk Tales and other Stories; Fairy Legends; Poems; Miscellaneous Articles. By the late Lady Camilla Gurdon. Cr. 8vo., 5s.
  • 62.
    Haggard (H. Rider). AllanQuatermain. With 31 Illustrations. Crown 8vo., 3s. 6d. Allan’s Wife. With 34 Illustrations. Crown 8vo., 3s. 6d. Beatrice. With Frontispiece and Vignette. Cr. 8vo., 3s. 6d. Black Heart and White Heart, and other Stories. With 33 Illustrations. Crown 8vo., 6s. Cleopatra. With 29 Illustrations. Crown 8vo., 3s. 6d. Colonel Quaritch, V.C. With Frontispiece and Vignette. Cr. 8vo., 3s. 6d. Dawn. With 16 Illustrations. Cr. 8vo., 3s. 6d. Dr. Therne. Crown 8vo., 3s. 6d. Eric Brighteyes. With 51 Illustrations. Crown 8vo., 3s. 6d. Heart of the World. With 15 Illustrations. Crown 8vo., 3s. 6d. Joan Haste. With 20 Illustrations. Crown 8vo., 3s. 6d. Maiwa’s Revenge. Cr. 8vo., 1s. 6d. Lysbeth. With 26 Illustrations. Crown 8vo., 6s. Montezuma’s Daughter. With 24 Illustrations. Crown 8vo., 3s. 6d. Mr. Meeson’s Will. With 16 Illustrations. Crown 8vo., 3s. 6d. Nada the Lily. With 23 Illustrations. Crown 8vo., 3s. 6d. She. With 32 Illustrations. Crown 8vo., 3s. 6d. Swallow: a Tale of the Great Trek. With 8 Illustrations. Crown 8vo., 6s. The People of the Mist. With 16 Illustrations. Crown 8vo., 3s. 6d. The Witch’s Head. With 16 Illustrations. Crown 8vo., 3s. 6d. Haggard and Lang.—The World’s Desire. By H. Rider Haggard and Andrew Lang. With 27 Illustrations. Crown 8vo., 3s. 6d.
  • 63.
    Harte.—In the CarquinezWoods. By Bret Harte. Crown 8vo., 3s. 6d. Hope.—The Heart of Princess Osra. By Anthony Hope. With 9 Illustrations. Crown 8vo., 3s. 6d. Howard.—The Undoing of John Brewster. By Lady Mabel Howard. Crown 8vo., 6s. Jerome.—Sketches in Lavender: Blue and Green. By Jerome K. Jerome, Author of ‘Three Men in a Boat,’ etc. Crown 8vo., 3s. 6d. Joyce.—Old Celtic Romances. Twelve of the most beautiful of the Ancient Irish Romantic Tales. Translated from the Gaelic. By P. W. Joyce, LL.D. Crown 8vo., 3s. 6d. Lang.—A Monk of Fife; a Story of the Days of Joan of Arc. By Andrew Lang. With 13 Illustrations by Selwyn Image. Crown 8vo., 3s. 6d. Levett-Yeats.—The Chevalier D’Auriac. By S. Levett-Yeats. Crown 8vo., 3s. 6d. Lyall (Edna). The Autobiography of a Slander. Fcp. 8vo., 1s., sewed. Presentation Edition. With 20 Illustrations by Lancelot Speed. Crown 8vo., 2s. 6d. net. The Autobiography of a Truth. Fcp. 8vo., 1s., sewed; 1s. 6d., cloth. Doreen. The Story of a Singer. Crown 8vo., 6s. Wayfaring Men. Crown 8vo., 6s. Hope the Hermit: a Romance of Borrowdale. Crown 8vo., 6s. Marchmont.—In the Name of a Woman: a Romance. By Arthur W. Marchmont. With 8 Illustrations. Crown 8vo., 6s. Mason and Lang.—Parson Kelly. By A. E. W. Mason and Andrew Lang. Crown 8vo., 6s. Max Müller.—Deutsche Liebe (German Love): Fragments from the Papers of an Alien. Collected by F. Max Müller. Translated from
  • 64.
    the German byG. A. M. Crown 8vo., 5s. Melville (G. J. Whyte). The Gladiators. The Interpreter. Good for Nothing. The Queen’s Maries. Holmby House. Kate Coventry. Digby Grand. General Bounce. Crown 8vo., 1s. 6d. each. Merriman.—Flotsam: A Story of the Indian Mutiny. By Henry Seton Merriman. With Frontispiece and Vignette by H. G. Massey. Cr. 8vo., 3s. 6d. Morris (William). The Sundering Flood. Cr. 8vo., 7s. 6d. The Water of the Wondrous Isles. Crown 8vo., 7s. 6d. The Well at the World’s End. 2 vols. 8vo., 28s. The Wood Beyond the World. Crown 8vo, 6s. net. The Story of the Glittering Plain, which has been also called The Land of the Living Men, or The Acre of the Undying. Square post 8vo., 5s. net. The Roots of the Mountains, wherein is told somewhat of the Lives of the Men of Burgdale, their Friends, their Neighbours, their Foemen, and their Fellows-in-Arms. Written in Prose and Verse. Square crown 8vo., 8s. A Tale of the House of the Wolfings, and all the Kindreds of the Mark. Written in Prose and Verse. Square crown 8vo., 6s. A Dream of John Ball, and a King’s Lesson. 12mo., 1s. 6d.
  • 65.
    News from Nowhere;or, An Epoch of Rest. Being some Chapters from an Utopian Romance. Post 8vo., 1s. 6d. The Story of Grettir the Strong. Translated from the Icelandic by Eiríkr Magnússon and William Morris. Cr. 8vo., 5s. net. Three Northern Love Stories, and Other Tales. Translated from the Icelandic by Eiríkr Magnússon and William Morris. Crown 8vo., 6s. net. ⁂ For Mr. William Morris’s Poetical Works, see p. 19. Newman (Cardinal). Loss and Gain: The Story of a Convert. Crown 8vo. Cabinet Edition, 6s.; Popular Edition, 3s. 6d. Callista: A Tale of the Third Century. Crown 8vo. Cabinet Edition, 6s.; Popular Edition, 3s. 6d. Phillipps-Wolley.—Snap: a Legend of the Lone Mountain. By C. Phillipps-Wolley. With 13 Illustrations. Crown 8vo., 3s. 6d. Raymond (Walter). Two Men o’ Mendip. Cr. 8vo., 6s. No Soul Above Money. Cr. 8vo., 6s. Reader.—Priestess and Queen: a Tale of the White Race of Mexico; being the Adventures of Ignigene and her Twenty-six Fair Maidens. By Emily E. Reader. Illustrated by Emily K. Reader. Crown 8vo., 6s. Ridley.—Anne Mainwaring. By Alice Ridley, Author of ‘The Story of Aline’. Crown 8vo., 6s. Sewell (Elizabeth M.). A Glimpse of the World. Laneton Parsonage. Margaret Percival. Katharine Ashton.
  • 66.
    The Earl’s Daughter. TheExperience of Life. Amy Herbert. Cleve Hall. Gertrude. Home Life. After Life. Ursula. Ivors. Cr. 8vo., 1s. 6d. each cloth plain. 2s. 6d. each cloth extra, gilt edges. Somerville (E. [OE].) and Ross (Martin). Some Experiences of an Irish R.M. With 31 Illustrations by E. [OE]. Somerville. Crown 8vo., 6s. The Real Charlotte. Crown 8vo., 3s. 6d. The Silver Fox. Cr. 8vo., 3s. 6d. Stebbing.—Probable Tales. Edited by William Stebbing. Crown 8vo., 4s. 6d. Stevenson (Robert Louis). The Strange Case of Dr. Jekyll and Mr. Hyde. Fcp. 8vo., 1s. sewed. 1s. 6d. cloth. The Strange Case of Dr. Jekyll and Mr. Hyde; with other Fables. Crown 8vo., 3s. 6d. More New Arabian Nights—The Dynamiter. By Robert Louis Stevenson and Fanny van de Grift Stevenson. Crown 8vo., 3s. 6d. The Wrong Box. By Robert Louis Stevenson and Lloyd Osbourne. Crown 8vo., 3s. 6d. Suttner.—Lay Down Your Arms (Die Waffen Nieder): The Autobiography of Martha von Tilling. By Bertha von Suttner. Translated by T. Holmes. Cr. 8vo., 1s. 6d. Swan.—Ballast. By Myra Swan. Crown 8vo., 6s.
  • 67.
    Taylor.—Early Italian Love-Stories.Taken from the Originals by Una Taylor. With 13 Illustrations by Henry J. Ford. Crown 4to., 15s. net. Trollope (Anthony). The Warden. Cr. 8vo., 1s. 6d. Barchester Towers. Cr. 8vo., 1s. 6d. Walford (L. B.). One of Ourselves. Cr. 8vo., 6s. The Intruders. Crown 8vo., 2s. 6d. Leddy Marget. Crown 8vo., 2s. 6d. Iva Kildare: a Matrimonial Problem. Crown 8vo., 2s. 6d. Mr. Smith: a Part of his Life. Crown 8vo., 2s. 6d. The Baby’s Grandmother. Cr. 8vo., 2s. 6d. Cousins. Crown 8vo., 2s. 6d. Troublesome Daughters. Cr. 8vo., 2s. 6d. Pauline. Crown 8vo., 2s. 6d. Dick Netherby. Cr. 8vo., 2s. 6d. The History of a Week. Cr. 8vo., 2s. 6d. A Stiff-necked Generation. Cr. 8vo., 2s. 6d. Nan, and other Stories. Cr. 8vo., 2s. 6d. The Mischief of Monica. Cr. 8vo., 2s. 6d. The One Good Guest. Cr. 8vo., 2s. 6d. ‘Ploughed,’ and other Stories. Crown 8vo., 2s. 6d. The Matchmaker. Cr. 8vo., 2s. 6d. Ward.—One Poor Scruple. By Mrs. Wilfrid Ward. Crown 8vo., 6s.
  • 68.
    West.—Edmund Fulleston; or,The Family Evil Genius. By B. B. West, Author of ‘Half Hours with the Millionaires,’ etc. Crown 8vo., 6s. Weyman (Stanley). The House of the Wolf. With Frontispiece and Vignette. Crown 8vo., 3s. 6d. A Gentleman of France. With Frontispiece and Vignette. Cr. 8vo., 6s. The Red Cockade. With Frontispiece and Vignette. Crown 8vo., 6s. Shrewsbury. With 24 Illustrations by Claude A. Shepperson. Cr. 8vo., 6s. Sophia. With Frontispiece. Crown 8vo., 6s. Popular Science (Natural History, &c.). Butler.—Our Household Insects. An Account of the Insect-Pests found in Dwelling-Houses. By Edward A. Butler, B.A., B.Sc. (Lond.). With 113 Illustrations. Crown 8vo., 3s. 6d. Furneaux (W.). The Outdoor World; or The Young Collector’s Handbook. With 18 Plates (16 of which are coloured), and 549 Illustrations in the Text. Crown 8vo., 6s. net. Butterflies and Moths (British). With 12 coloured Plates and 241 Illustrations in the Text. Crown 8vo., 6s. net. Life in Ponds and Streams. With 8 coloured Plates and 331 Illustrations in the Text. Crown 8vo., 6s. net. Hartwig (George). The Sea and its Living Wonders. With 12 Plates and 303 Woodcuts. 8vo., 7s. net. The Tropical World. With 8 Plates and 172 Woodcuts. 8vo., 7s. net.
  • 69.
    The Polar World.With 3 Maps, 8 Plates and 85 Woodcuts. 8vo., 7s. net. The Subterranean World. With 3 Maps and 80 Woodcuts. 8vo., 7s. net. Heroes of the Polar World. With 19 Illustrations. Cr. 8vo., 2s. Wonders of the Tropical Forests. With 40 Illustrations. Cr. 8vo., 2s. Workers under the Ground. With 29 Illustrations. Cr. 8vo., 2s. Marvels Over our Heads. With 29 Illustrations. Cr. 8vo., 2s. Sea Monsters and Sea Birds. With 75 Illustrations. Cr. 8vo., 2s. 6d. Denizens of the Deep. With 117 Illustrations. Cr. 8vo., 2s. 6d. Volcanoes and Earthquakes. With 30 Illustrations. Cr. 8vo., 2s. 6d. Wild Animals of the Tropics. With 66 Illustrations. Cr. 8vo., 3s. 6d. Helmholtz.—Popular Lectures on Scientific Subjects. By Hermann von Helmholtz. With 68 Woodcuts. 2 vols. Cr. 8vo., 3s. 6d. each. Hudson (W. H.). Nature in Downland. With 12 Plates and 14 Illustrations in the Text by A. D. McCormick. 8vo., 10s. 6d. net. British Birds. With a Chapter on Structure and Classification by Frank E. Beddard, F.R.S. With 16 Plates (8 of which are Coloured), and over 100 Illustrations in the Text. Cr. 8vo., 6s. net. Birds in London. With 17 Plates and 15 Illustrations in the Text, by Bryan Hook, A. D. McCormick, and from Photographs from Nature, by R. B. Lodge. 8vo., 12s. Proctor (Richard A.). Light Science for Leisure Hours. Familiar Essays on Scientific Subjects. Vol. I. Crown 8vo., 3s. 6d.
  • 70.
    Rough Ways madeSmooth. Familiar Essays on Scientific Subjects. Crown 8vo., 3s. 6d. Pleasant Ways in Science. Crown 8vo., 3s. 6d. Nature Studies. By R. A. Proctor, Grant Allen, A. Wilson, T. Foster and E. Clodd. Crown 8vo., 3s. 6d. Leisure Readings. By R. A. Proctor, E. Clodd, A. Wilson, T. Foster and A. C. Ranyard. Cr. 8vo., 3s. 6d. ⁂ For Mr. Proctor’s other books see pp. 14 and 28, and Messrs. Longmans & Co.’s Catalogue of Scientific Works. Stanley.—A Familiar History of Birds. By E. Stanley, D.D., formerly Bishop of Norwich. With 160 Illustrations. Cr. 8vo., 3s. 6d. Wood (Rev. J. G.). Homes without Hands: A Description of the Habitations of Animals, classed according to the Principle of Construction. With 140 Illustrations. 8vo., 7s. net. Insects at Home: A Popular Account of British Insects, their Structure, Habits and Transformations. With 700 Illustrations. 8vo., 7s. net. Out of Doors; a Selection of Original Articles on Practical Natural History. With 11 Illustrations. Cr. 8vo., 3s. 6d. Strange Dwellings: a Description of the Habitations of Animals, abridged from ‘Homes without Hands’. With 60 Illustrations. Cr. 8vo., 3s. 6d. Petland Revisited. With 33 Illustrations. Cr. 8vo., 3s. 6d. Bird Life of the Bible. With 32 Illustrations. Cr. 8vo., 3s. 6d. Wonderful Nests. With 30 Illustrations. Cr. 8vo., 3s. 6d. Homes under the Ground. With 28 Illustrations. Cr. 8vo., 3s. 6d. Wild Animals of the Bible. With 29 Illustrations. Cr. 8vo., 3s. 6d.
  • 71.
    Domestic Animals ofthe Bible. With 23 Illustrations. Cr. 8vo., 3s. 6d. The Branch Builders. With 28 Illustrations. Cr. 8vo., 2s. 6d. Social Habitations and Parasitic Nests. With 18 Illustrations. Cr. 8vo., 2s. Works of Reference. Gwilt.—An Encyclopædia of Architecture. By Joseph Gwilt, F.S.A. With 1700 Engravings. Revised (1888), with Alterations and Considerable Additions by Wyatt Papworth. 8vo., 21s. net. Maunder (Samuel). Biographical Treasury. With Supplement brought down to 1889. By Rev. James Wood. Fcp. 8vo., 6s. Treasury of Geography, Physical, Historical, Descriptive, and Political. With 7 Maps and 16 Plates. Fcp. 8vo., 6s. The Treasury of Bible Knowledge. By the Rev. J. Ayre, M.A. With 5 Maps, 15 Plates, and 300 Woodcuts. Fcp. 8vo., 6s. Treasury of Knowledge and Library of Reference. Fcp. 8vo., 6s. Historical Treasury. Fcp. 8vo, 6s. The Treasury of Botany. Edited by J. Lindley, F.R.S., and T. Moore, F.L.S. With 274 Woodcuts and 20 Steel Plates. 2 vols. Fcp. 8vo., 12s. Roget.—Thesaurus of English Words and Phrases. Classified and Arranged so as to Facilitate the Expression of Ideas and assist in Literary Composition. By Peter Mark Roget, M.D., F.R.S. Recomposed throughout, enlarged and improved, partly from the Author’s Notes, and with a full Index, by the Author’s Son, John Lewis Roget. Crown 8vo., 10s. 6d.
  • 72.
    Willich.—Popular Tables forgiving information for ascertaining the value of Lifehold, Leasehold, and Church Property, the Public Funds, etc. By Charles M. Willich. Edited by H. Bence Jones. Crown 8vo., 10s. 6d. Children’s Books. Brown.—The Book of Saints and Friendly Beasts. By Abbie Farwell Brown. With 8 Illustrations by Fanny Y. Cory. Crown 8vo., 4s. 6d. net. Buckland.—Two Little Runaways. Adapted from the French of Louis Desnoyers. By James Buckland. With 110 Illustrations by Cecil Aldin. Cr. 8vo., 6s. Corbin and Going.—Urchins of the Sea. By Marie Overton Corbin and Charles Buxton Going. With Drawings by F. I. Bennett. Oblong 4to., 3s. 6d. Crake (Rev. A. D.). Edwy the Fair; or, The First Chronicle of Æscendune. Cr. 8vo., 2s. net. Alfgar the Dane; or, The Second Chronicle of Æscendune. Cr. 8vo., 2s. net. The Rival Heirs: being the Third and Last Chronicle of Æscendune. Cr. 8vo., 2s. net. The House of Walderne. A Tale of the Cloister and the Forest in the Days of the Barons’ Wars. Crown 8vo., 2s. net. Brian Fitz-Count. A Story of Wallingford Castle and Dorchester Abbey. Cr. 8vo., 2s. net. Henty (G. A.).—Edited by. Yule Logs: A Story-Book for Boys. By Various Authors. With 61 Illustrations. Crown 8vo., 6s.
  • 73.
    Yule Tide Yarns:A Story-Book for Boys. By Various Authors. With 45 Illustrations. Crown 8vo., 6s. Lang (Andrew).—Edited by. The Blue Fairy Book. With 138 Illustrations. Crown 8vo., 6s. The Red Fairy Book. With 100 Illustrations. Crown 8vo., 6s. The Green Fairy Book. With 99 Illustrations. Crown 8vo., 6s. The Grey Fairy Book. With 65 Illustrations. Crown 8vo., 6s. The Yellow Fairy Book. With 104 Illustrations. Crown 8vo., 6s. The Pink Fairy Book. With 67 Illustrations. Crown 8vo., 6s. The Blue Poetry Book. With 100 Illustrations. Crown 8vo., 6s. The True Story Book. With 66 Illustrations. Crown 8vo., 6s. The Red True Story Book. With 100 Illustrations. Crown 8vo., 6s. The Animal Story Book. With 67 Illustrations. Crown 8vo., 6s. The Red Book of Animal Stories. With 65 Illustrations. Crown 8vo., 6s. The Arabian Nights Entertainments. With 66 Illustrations. Cr. 8vo., 6s. Meade (L. T.). Daddy’s Boy. With 8 Illustrations. Crown 8vo., 3s. net. Deb and the Duchess. With 7 Illustrations. Crown 8vo., 3s. net. The Beresford Prize. With 7 Illustrations. Crown 8vo., 3s. net. The House of Surprises. With 6 Illustrations. Crown 8vo., 3s. net. Praeger (Rosamond). The Adventures of the Three Bold Babes: Hector, Honoria and Alisander. A Story in Pictures. With 24 Coloured Plates and 24 Outline Pictures. Oblong 4to., 3s. 6d.
  • 74.
    The Further Doingsof the Three Bold Babes. With 24 Coloured Pictures and 24 Outline Pictures. Oblong 4to., 3s. 6d. Stevenson.—A Child’s Garden of Verses. By Robert Louis Stevenson. Fcp. 8vo., 5s. Upton (Florence K. and Bertha). The Adventures of Two Dutch Dolls and a ‘Golliwogg’. With 31 Coloured Plates and numerous Illustrations in the Text. Oblong 4to., 6s. The Golliwogg’s Bicycle Club. With 31 Coloured Plates and numerous Illustrations in the Text. Oblong 4to., 6s. The Golliwogg at the Seaside. With 31 Coloured Plates and numerous Illustrations in the Text. Oblong 4to., 6s. The Golliwogg in War. With 31 Coloured Plates. Oblong 4to., 6s. The Golliwogg’s Polar Adventures. With 31 Coloured Plates. Oblong 4to., 6s. The Vege-Men’s Revenge. With 31 Coloured Plates and numerous Illustrations in the Text. Oblong 4to., 6s. The Silver Library. Crown 8vo. 3s. 6d. each Volume. Arnold’s (Sir Edwin) Seas and Lands. With 71 Illustrations. 3s. 6d. Bagehot’s (W.) Biographical Studies. 3s. 6d. Bagehot’s (W.) Economic Studies. 3s. 6d. Bagehot’s (W.) Literary Studies. With Portrait. 3 vols, 3s. 6d. each. Baker’s (Sir S. W.) Eight Years in Ceylon. With 6 Illustrations. 3s. 6d.
  • 75.
    Baker’s (Sir S.W.) Rifle and Hound in Ceylon. With 6 Illustrations. 3s. 6d. Baring-Gould’s (Rev. S.) Curious Myths of the Middle Ages. 3s. 6d. Baring-Gould’s (Rev. S.) Origin and Development of Religious Belief. 2 vols. 3s. 6d. each. Becker’s (W. A.) Gallus: or, Roman Scenes in the Time of Augustus. With 26 Illus. 3s. 6d. Becker’s (W. A.) Charicles: or, Illustrations of the Private Life of the Ancient Greeks. With 26 Illustrations. 3s. 6d. Bent’s (J. T.) The Ruined Cities of Mashonaland. With 117 Illustrations. 3s. 6d. Brassey’s (Lady) A Voyage in the ‘Sunbeam’. With 66 Illustrations. 3s. 6d. Churchill’s (W. Spencer) The Story of the Malakand Field Force, 1897. With 6 Maps and Plans. 3s. 6d. Clodd’s (E.) Story of Creation: a Plain Account of Evolution. With 77 Illustrations. 3s. 6d. Conybeare (Rev. W. J.) and Howson’s (Very Rev. J. S.) Life and Epistles of St. Paul. With 46 Illustrations. 3s. 6d. Dougall’s (L.) Beggars All: a Novel. 3s. 6d. Doyle’s (A. Conan) Micah Clarke. A Tale of Monmouth’s Rebellion. With 10 Illusts. 3s. 6d. Doyle’s (A. Conan) The Captain of the Polestar, and other Tales. 3s. 6d. Doyle’s (A. Conan) The Refugees: A Tale of the Huguenots. With 25 Illustrations. 3s. 6d. Doyle’s (A. Conan) The Stark Munro Letters. 3s. 6d.
  • 76.
    Froude’s (J. A.)The History of England, from the Fall of Wolsey to the Defeat of the Spanish Armada. 12 vols. 3s. 6d. each. Froude’s (J. A.) The English in Ireland. 3 vols. 10s. 6d. Froude’s (J. A.) The Divorce of Catherine of Aragon. 3s. 6d. Froude’s (J. A.) The Spanish Story of the Armada, and other Essays. 3s. 6d. Froude’s (J. A.) English Seamen in the Sixteenth Century. 3s. 6d. Froude’s (J. A.) Short Studies on Great Subjects. 4 vols. 3s. 6d. each. Froude’s (J. A.) Oceana, or England and Her Colonies. With 9 Illustrations. 3s. 6d. Froude’s (J. A.) The Council of Trent. 3s. 6d. Froude’s (J. A.) The Life and Letters of Erasmus. 3s. 6d. Froude’s (J. A.) Thomas Carlyle: a History of his Life. 1795-1835. 2 vols. 7s. 1834-1881. 2 vols. 7s. Froude’s (J. A.) Cæsar: a Sketch. 3s. 6d. Froude’s (J. A.) The Two Chiefs of Dunboy: an Irish Romance of the Last Century. 3s. 6d. Gleig’s (Rev. G. R.) Life of the Duke of Wellington. With Portrait. 3s. 6d. Greville’s (C. C. F.) Journal of the Reigns of King George IV., King William IV., and Queen Victoria. 8 vols., 3s. 6d. each. Haggard’s (H. R.) She: A History of Adventure. With 32 Illustrations. 3s. 6d. Haggard’s (H. R.) Allan Quatermain. With 20 Illustrations. 3s. 6d.
  • 77.
    Haggard’s (H. R.)Colonel Quaritch, V.C.: a Tale of Country Life. With Frontispiece and Vignette. 3s. 6d. Haggard’s (H. R.) Cleopatra. With 29 Illustrations. 3s. 6d. Haggard’s (H. R.) Eric Brighteyes. With 51 Illustrations. 3s. 6d. Haggard’s (H. R.) Beatrice. With Frontispiece and Vignette. 3s. 6d. Haggard’s (H. R.) Allan’s Wife. With 34 Illustrations. 3s. 6d. Haggard (H. R.) Heart of the World. With 15 Illustrations. 3s. 6d. Haggard’s (H. R.) Montezuma’s Daughter. With 25 Illustrations. 3s. 6d. Haggard’s (H. R.) The Witch’s Head. With 16 Illustrations. 3s. 6d. Haggard’s (H. R.) Mr. Meeson’s Will. With 16 Illustrations. 3s. 6d. Haggard’s (H. R.) Nada the Lily. With 23 Illustrations. 3s. 6d. Haggard’s (H. R.) Dawn. With 16 Illusts. 3s. 6d. Haggard’s (H. R.) The People of the Mist. With 16 Illustrations. 3s. 6d. Haggard’s (H. R.) Joan Haste. With 20 Illustrations. 3s. 6d. Haggard (H. R.) and Lang’s (A.) The World’s Desire. With 27 Illustrations. 3s. 6d. Harte’s (Bret) In the Carquinez Woods and other Stories. 3s. 6d. Helmholtz’s (Hermann von) Popular Lectures on Scientific Subjects. With 68 Illustrations. 2 vols. 3s. 6d. each. Hope’s (Anthony) The Heart of Princess Osra. With 9 Illustrations. 3s. 6d.
  • 78.
    Welcome to ourwebsite – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebooknice.com