Instant Access to Python High Performance Programming Boost the performance of your Python programs using advanced techniques 1st Edition Gabriele Lanaro ebook Full Chapters
Instant Access to Python High Performance Programming Boost the performance of your Python programs using advanced techniques 1st Edition Gabriele Lanaro ebook Full Chapters
com
https://ebookname.com/product/python-high-performance-
programming-boost-the-performance-of-your-python-programs-
using-advanced-techniques-1st-edition-gabriele-lanaro/
OR CLICK BUTTON
DOWLOAD EBOOK
https://ebookname.com/product/python-high-performance-2nd-edition-
gabriele-lanaro/
ebookname.com
https://ebookname.com/product/fundamentals-of-python-first-
programs-1st-edition-kenneth-a-lambert/
ebookname.com
https://ebookname.com/product/beginning-python-using-python-2-6-and-
python-3-1-wrox-programmer-to-programmer-james-payne/
ebookname.com
https://ebookname.com/product/jstl-practical-guide-for-jsp-
programmers-1st-edition-sue-spielman/
ebookname.com
Water Recycling and Resource Recovery in Industry Analysis
Technologies and Implementation 1st Edition P. Lens
https://ebookname.com/product/water-recycling-and-resource-recovery-
in-industry-analysis-technologies-and-implementation-1st-edition-p-
lens/
ebookname.com
https://ebookname.com/product/serotonin-receptor-technologies-1st-
edition-wolfgang-blenau/
ebookname.com
https://ebookname.com/product/oxide-scale-behavior-in-high-
temperature-metal-processing-1st-edition-michal-krzyzanowski/
ebookname.com
https://ebookname.com/product/financial-accounting-and-reporting-12th-
ed-edition-barry-elliott/
ebookname.com
Repainting the Little Red Schoolhouse A History of Eastern
German Education 1945 1995 First Edition. Edition John
Rodden
https://ebookname.com/product/repainting-the-little-red-schoolhouse-a-
history-of-eastern-german-education-1945-1995-first-edition-edition-
john-rodden/
ebookname.com
Python High Performance
Programming
Gabriele Lanaro
BIRMINGHAM - MUMBAI
Python High Performance Programming
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78328-845-8
www.packtpub.com
Reviewers Proofreader
Daniel Arbuckle Linda Morris
Mike Driscoll
Albert Lukaszewski Indexer
Rekha Nair
Acquisition Editors
Owen Roberts Production Coordinators
Pooja Chiplunkar
Harsha Bharwani
Manu Joseph
Commissioning Editor
Shaon Basu Cover Work
Pooja Chiplunkar
Technical Editors
Akashdeep Kundu
Faisal Siddiqui
About the Author
Mike Driscoll has been programming in Python since Spring 2006. He enjoys
writing about Python on his blog at http://www.blog.pythonlibrary.org/.
Mike also occasionally writes for the Python Software Foundation, i-Programmer,
and Developer Zone. He enjoys photography and reading a good book. Mike has
also been a technical reviewer for Python 3 Object Oriented Programming, Python
2.6 Graphics Cookbook, and Tkinter GUI Application Development Hotshot.
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
http://PacktLib.PacktPub.com
Why Subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print and bookmark content
• On demand and accessible via web browser
[ ii ]
Preface
Python is a programming language renowned for its simplicity, elegance, and
the support of an outstanding community. Thanks to the impressive amount
of high-quality third-party libraries, Python is used in many domains.
Python is an easier language to deal with and it can be used to quickly write
complex applications. Thanks to its tight integration with C, Python is able to
avoid the performance drop associated with dynamic languages. You can use
blazing fast C extensions for performance-critical code and retain all the
convenience of Python for the rest of your application.
In this book, you will learn, in a step-by-step method how to find and speedup
the slow parts of your programs using basic and advanced techniques.
The style of the book is practical; every concept is explained and illustrated with
examples. This book also addresses common mistakes and teaches how to avoid
them. The tools used in this book are quite popular and battle-tested; you can be
sure that they will stay relevant and well-supported in the future.
This book starts from the basics and builds on them, therefore, I suggest you
to move through the chapters in order.
Chapter 2, Fast Array Operations with NumPy is a guide to the NumPy package.
NumPy is a framework for array calculations in Python. It comes with a clean
and concise API, and efficient array operations.
The book was written and tested on Ubuntu 13.10. The examples will likely run on
Mac OS X with little or no changes.
[2]
Preface
However, the scope of this book is broad and the concepts can be applied to any
domain. Since the book addresses both basic and advanced topics, it contains
useful information for programmers with different Python proficiency levels.
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"The plot function included in matplotlib can display our particles as points
on a Cartesian grid and the FuncAnimation class can animate the evolution of
our particles over time."
def visualize(simulator):
[3]
Preface
When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
In [1]: import purepy
In [2]: %timeit purepy.loop()
100 loops, best of 3: 8.26 ms per loop
In [3]: %timeit purepy.comprehension()
100 loops, best of 3: 5.39 ms per loop
In [4]: %timeit purepy.generator()
100 loops, best of 3: 5.07 ms per loop
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes, for example, appear in the text like this: "You
can navigate to the Call Graph or the Caller Map tabs by double-clicking on the
rectangles."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for
us to develop titles that you really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.
[4]
Preface
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you would report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the errata submission form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list of
existing errata, under the Errata section of that title. Any existing errata can be viewed
by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors, and our ability to bring you
valuable content.
Questions
You can contact us at [email protected] if you are having a problem with
any aspect of the book, and we will do our best to address it.
[5]
Benchmarking and Profiling
Recognizing the slow parts of your program is the single most important task when it
comes to speeding up your code. In most cases, the bottlenecks account for a very small
fraction of the program. By specifically addressing those critical spots you can focus on
the parts that need improvement without wasting time in micro-optimizations.
You may also want to assess the total execution time of your program and see how
it is affected by your changes. We will learn how to write benchmarks and how to
accurately time your programs.
In the early development stages, the design of the program can change quickly,
requiring you to rewrite and reorganize big chunks of code. By testing different
prototypes without bothering about optimizations, you learn more about your
program, and this will help you make better design decisions.
Benchmarking and Profiling
The mantras that you should remember when optimizing your code, are as follows:
• Make it run: We have to get the software in a working state, and be sure that
it produces the correct results. This phase serves to explore the problem that
we are trying to solve and to spot major design issues in the early stages.
• Make it right: We want to make sure that the design of the program is solid.
Refactoring should be done before attempting any performance optimization.
This really helps separate the application into independent and cohesive
units that are easier to maintain.
• Make it fast: Once our program is working and has a good design we want
to optimize the parts of the program that are not fast enough. We may also
want to optimize memory usage if that constitutes an issue.
In this section we will profile a test application—a particle simulator. The simulator
is a program that takes some particles and evolves them over time according to a
set of laws that we will establish. Those particles can either be abstract entities or
correspond to physical objects. They can be, for example, billiard balls moving on
a table, molecules in gas, stars moving through space, smoke particles, fluids in a
chamber, and so on.
Those simulations are useful in fields such as Physics, Chemistry, and Astronomy,
and the programs used to simulate physical systems are typically performance-
intensive. In order to study realistic systems it's often necessary to simulate the
highest possible number of bodies.
In our first example, we will simulate a system containing particles that constantly
rotate around a central point at various speeds, like the hands of a clock.
The necessary information to run our simulation will be the starting positions of
the particles, the speed, and the rotation direction. From these elements, we have
to calculate the position of the particle in the next instant of time.
[8]
Chapter 1
(vx, vy)
(x, y)
(0, 0)
The basic feature of a circular motion is that the particles always move
perpendicularly to the direction connecting the particle and the center, as shown in
the preceding image. To move the particle we simply change the position by taking a
series of very small steps in the direction of motion, as shown in the following figure:
[9]
Benchmarking and Profiling
Another class, called ParticleSimulator will encapsulate our laws of motion and
will be responsible for changing the positions of the particles over time. The __
init__ method will store a list of Particle instances and the evolve method will
change the particle positions according to our laws.
We want the particles to rotate around the point (x, y), which, here, is equal to (0, 0),
at constant speed. The direction of the particles will always be perpendicular to the
direction from the center (refer to the first figure of this chapter). To find this vector
v=(vx ,vy)
(corresponding to the Python variables v_x and v_y) it is sufficient to use these
formulae:
If we let one of our particles move, after a certain time dt, it will follow a circular path,
reaching another position. To let the particle follow that trajectory we have to divide
the time interval dt into very small time steps where the particle moves tangentially
to the circle. The final result, is just an approximation of a circular motion and, in fact,
it's similar to a polygon. The time steps should be very small, otherwise the particle
trajectory will diverge quickly, as shown in the following figure:
[ 10 ]
Chapter 1
In a more schematic way, to calculate the particle position at time dt we have to carry
out the following steps:
for i in range(nsteps):
for p in self.particles:
p.x += d_x
p.y += d_y
# 3. repeat for all the time steps
[ 11 ]
Benchmarking and Profiling
We can use the matplotlib library to visualize our particles. This library is not
included in the Python standard library. To install it, you can follow the instructions
included in the official documentation at:
http://matplotlib.org/users/installing.html
The plot function included in matplotlib can display our particles as points on
a Cartesian grid and the FuncAnimation class can animate the evolution of our
particles over time.
The visualize function accomplishes this by taking the particle simulator and
displaying the trajectory in an animated plot.
• Setup the axes and display the particles as points using the plot function
• Write an initialization function (init) and an update function
(animate) that changes the x, y coordinates of the data points using the
line.set_data method
• Create a FuncAnimation instance passing the functions and some parameters
• Run the animation with plt.show()
def visualize(simulator):
fig = plt.figure()
ax = plt.subplot(111, aspect='equal')
line, = ax.plot(X, Y, 'ro')
# Axis limits
plt.xlim(-1, 1)
plt.ylim(-1, 1)
[ 12 ]
Chapter 1
def animate(i):
# We let the particle evolve for 0.1 time units
simulator.evolve(0.01)
X = [p.x for p in simulator.particles]
Y = [p.y for p in simulator.particles]
line.set_data(X, Y)
return line,
simulator = ParticleSimulator(particles)
visualize(simulator)
if __name__ == '__main__':
test_visualize()
We need a test that checks whether the results produced by the simulation are
correct or not. In the optimization process we will rewrite the code to try different
solutions; by doing so we may easily introduce bugs. Maintaining a solid test suite
is essential to avoid wasting time on broken code.
[ 13 ]
Benchmarking and Profiling
Our test will take three particle and let the system evolve for 0.1 time units. We
then compare our results, up to a certain precision, with those from a reference
implementation:
def test():
particles = [Particle( 0.3, 0.5, +1),
Particle( 0.0, -0.5, -1),
Particle(-0.1, -0.4, +3)]
simulator = ParticleSimulator(particles)
simulator.evolve(0.1)
if __name__ == '__main__':
test()
We also want to write a benchmark that can measure the performance of our
application. This will provide an indication of how much we have improved
over the previous implementation.
def benchmark():
particles = [Particle(uniform(-1.0, 1.0),
uniform(-1.0, 1.0),
uniform(-1.0, 1.0))
for i in range(1000)]
simulator = ParticleSimulator(particles)
simulator.evolve(0.1)
if __name__ == '__main__':
benchmark()
[ 14 ]
Chapter 1
The time command is not available for Windows, but can be found
in the cygwin shell that you can download from the official website
http://www.cygwin.com/.
• real: The actual time spent in running the process from start to finish, as if it
was measured by a human with a stopwatch
• user: The cumulative time spent by all the CPUs during the computation
• sys: The cumulative time spent by all the CPUs during system-related tasks
such as memory allocation
Notice that sometimes user + sys might be greater than real, as multiple processors
may work in parallel.
time also offers several formatting options; for an overview you can
explore its manual (by using the man time command). If you want a
summary of all the metrics available, you can use the -v option.
The Unix time command is a good way to benchmark your program. To achieve
a more accurate measurement, the benchmark should run long enough (in the
order of seconds) so that the setup and tear-down of the process become small,
compared to the execution time. The user metric is suitable as a monitor for the
CPU performance, as the real metric includes also the time spent in other
processes or waiting for I/O operations.
Another useful program to time Python scripts is the timeit module. This module
runs a snippet of code in a loop for n times and measures the time taken. Then, it
repeats this operation r times (by default the value of r is 3) and takes the best of
those runs. Because of this procedure, timeit is suitable to accurately time small
statements in isolation.
[ 15 ]
Benchmarking and Profiling
The timeit module can be used as a Python module, from the command line, or
from IPython.
IPython is a Python shell designed for interactive usage. It boosts tab completion and
many utilities to time, profile, and debug your code. We will make use of this shell to
try out snippets throughout the book. The IPython shell accepts magic commands—
statements that start with a % symbol—that enhance the shell with special behaviors.
Commands that start with %% are called cell magics, and these commands can be
applied on multi-line snippets (called cells).
In the following code we show how to use timeit from IPython, from the command
line and as a Python module:
# IPython Interface
$ ipython
In [1]: from simul import benchmark
In [2]: %timeit benchmark()
1 loops, best of 3: 782 ms per loop
# Python Interface
# put this function into the simul.py script
import timeit
result = timeit.timeit('benchmark()',
setup='from __main__ import
benchmark', number=10)
# result is the time (in seconds) to run the whole loop
[ 16 ]
Discovering Diverse Content Through
Random Scribd Documents
serve God and man in this country must haul his own weight and
bear others’ burdens too. He must lay aside hindrances—he must
forfeit love of home and kindred—he must learn to keep normal and
cheerful in the aching solitudes.
Many are with the Doctor for a season or so. Some like Dr. Little,
Dr. Paddon and Dr. Andrews and certain others who deserve to be
named honoris causa—have stood by him year after year. But by this
time there is a small army of short-term or long-term Grenfell
graduates—men and women—who had “their souls in the work of
their hands” and whose precious memories are of the days they
spent in assuaging the torment, physical or spiritual, of plain fisher-
folk. It is not possible to separate in this case the care of bodies
from the cure of souls. The “wops” who brought the schooner
George B. Cluett from Boston year after year, laden with lumber and
supplies, and then went ashore to be plumbers and carpenters and
jacks-of-all-trades for love and not for hire have their own stories to
tell of “simple service simply given to their own kind in their human
need.” Most of them knew just what they would be up against; they
knew it would not be a glorified house-party; but they accepted the
isolation and the crudeness and the cold and the unremitting toil,
and in the spirit of good sportsmanship which is the ruling spirit of
the Grenfell undertaking they played the game, and what they did is
graven deep in the Doctor’s grateful memory.
The Doctor wins and keeps the enthusiastic loyalty of his
colleagues because he is so ready with the word of emphatic praise
for what they do when it is the right thing to do. He is fearless to
condemn, but he would rather commend, and the flush of pleasure
in the face of the one praised tells how much his approval has meant
to the recipient. He knows how many persons in this human, fallible
world of ours travel faster for a pat than for a kick or a blow.
A halt was called at Forteau for a few hours’ conference with one
of the remarkable women who have put their shoulders under the
load of the Labrador—Sister Bailey, once a co-worker with Edith
Cavell. At Forteau she has a house that holds an immaculate
hospital-ward and an up-to-date dispensary. For twelve years—
except for two visits in England—she has held the fort here without
the company of her peers, except at long intervals. She has kept
herself surrounded with books and flowers, and her geraniums are
exquisite. Sister Bailey’s cow, bought for $40 in a bargain at Bonne
Esperance (“Bony,”) is a wonder, and I took pains to stroke the nose
of this “friendly cow” and praise her life-giving endeavours. For each
day at the crack of dawn there is a line-up of people with all sorts of
containers to get the milk. The dogs, of course, would cheerfully kill
the animal if they could pull her down, but she fights them off with
her horns, and they have learned a wholesome fear. She is not like
the cow at Bonne Esperance today, which has suffered the loss of
part of its hind quarters because it was too gentle.
Under Sister Bailey’s roof three maids, aged 12, 13 and 22, are
being educated in household management. She has a garden with
the dogs fenced out, and there is a skirmish with the weeds all
through the summer into which winter breaks so suddenly. There is
no spring; there is no fall; flowers, vegetables and weeds appear
almost explosively together.
Artificial flowers are beautifully made—with dyes from Paris—by
the girls of Forteau Cove, under Sister Bailey’s supervision. The hues
are remarkably close to the original and the imitation of petal and
leaf is so close as to be startling.
ST. ANTHONY HOSPITAL IN WINTER.
SOME OF THE HELPERS.
The word “copy” comes from the childish game of following the
leader and doing as he does. A little piece of ice is called a knob,
and a larger piece is a pan. A pan is the same thing as a floe, but
the latter expression is not in common usage.
Every youth who aspires to qualify as a skipper must go before
an examining board of old sea-wise and weather-wise pilots, and
prove himself letter-perfect in the text of that big book, “The
Newfoundland and Labrador Pilot and Guide.” His examiners scorn
the knowledge of the book, very often, for they have the facts at the
fingers’ ends from long and harsh experience of the treacherous
waters, with the criss-cross currents, the hidden reefs, the sudden
fogs, the contrary winds. So they delight to make life miserable for
the young mariner by heckling him.
The disasters that now and then overtake the sealing-fleet are
ever present in the minds of those who do business in these waters.
They know what it means for a ship’s company to be caught out on
the ice in a snow-storm, far from the vessel. In early March the
wooden ships race for the Straits of Belle Isle, and three days later
the faster iron ships follow. When they get to where the seals are
sunning themselves around the blow-holes in the ice, the crew go
out with their gaffs (staves) and kill the usually unresisting animals
by hitting them over the back of the head. It sounds like simple and
easy hunting, and in good weather it is. But a long-continued storm
changes the complexion of the adventure to that of the gravest peril.
One captain saved his men by making them dance like mad the
long night through, while he crooned the music to them. At the end
of each five minutes he let them rest on their piles of gaffs, and then
they were made to spring to their feet again and resume the frantic
gyrations that kept them from freezing to death. In the same storm,
the Greenland of Harbour Grace lost 52 of her 100 men.
They still talk of the fate of the Queen on Gull Island off Cape St.
John, though the wreck took place nigh unto forty years ago. There
was no lighthouse then. The island lifts its head hundreds of feet
above the mean of the tides, and only the long rank grass and the
buttercups live there in summer. But this was in a December night,
and the wind blew a gale. There were six passengers—a woman
among them. When the passengers had battled their way ashore
through the leaping surf, the crew went back on the doomed ship to
salvage some of the provisions. For they knew that at this forsaken
angle of the island no help from any passing ship was likely till the
spring.
The passengers toiled to the top of the bleak islet, lugging with
them a fragment of a sail. The crew, aboard the vessel, were carried
by the furious winds and waters out to the Old Harry Shoals, where
they lost their lives when the sea beat the vessel to pieces.
The sequel is known by a little diary in which a doctor—one of
the hapless half-dozen—made notes with his own blood till his
stiffening fingers refused to scrawl another entry.
It seems from this pathetic note-book that the six at the end of a
few days, tortured with thirst and starvation, drew lots to see who
should die.
The lot fell to the woman. Her brother offered himself in her
place.
Then the entries in the book cease; and the curtain that fell was
not lifted till spring brought a solitary hunter to the island. He shot a
duck from his boat, and it fell in the breakers. Afterwards he said it
was a phantom fowl, sent from heaven to guide him. For he did not
see it again, though he landed and searched the beach.
But he saw splinters flung high by the surf that seemed to him a
clear indication of a wreck.
He clambered to the top of the islet. There he found, under the
rotted sail, the six bodies, and in the hand of one, was a piece of
flesh torn from one of the bodies.
Even when their lives are endangered the fishermen preserve
their keen mindfulness of the religious proprieties. Caught on an ice-
pan together, Protestants and Catholics prayed, their backs to one
another, on opposite sides of the pan—and the same thing has
happened in ships’ cabins. The sailors are not above a round oath
now and then, but there are many God-fearing, prayerful men
among them. “These are my sailing orders, sir,” said an old retired
sea-dog to me as he patted the cheek of his Bible.
Phrases of the sea enter into every phase of daily human
intercourse. “You should have given yourself more room to veer and
haul,” said the same old sailor to me when I was in a hurry. Fish
when half-cured are said to be “half-saved,” and a man who is “not
all there” is likely to be styled “half-saved.”
“Down killik” is used impartially on arrival at the fishing grounds
or at home after a voyage—the “killik” being a stone anchor for
small craft or for nets. (A “killy-claw” is of wood with the stone in the
middle.) You may hear an old fisherman say of his retirement from
the long warfare with the sea for a living: “My killiks are down; my
boat is moored.” One of them who was blind in his left eye, said as
he lay dying, referring to his own soul: “She’s on her last tack,
heading for I don’t know where: the port light is out, and the
starboard is getting very dim.” A few minutes later he passed away.
The ordinary talk is full of poetry. “If I could only rig up a derrick,
now, to hoist me over the fore part of the winter,” an old salt will
say, “wi’ the help o’ God and a sou’westerly wind and a few swyles I
could last till the spring.” By “swyles,” of course, he means “seals.” A
man’s a man when he has killed his seal. Seal-meat is an anti-
scorbutic, and the sealers present the “paws,” or flippers, as great
delicacies to their friends. A “big feed” is a “scoff.” Sealing brings
men together in conviviality and comaraderie, and it is the great
ambition of most of the youth of Newfoundland to “go to the ice.”
Many are the stowaways aboard the sealing craft. If a man goes
“half his hand” it means he gets half his catch for his labour.
“Seal” is pronounced “swyle,” “syle,” or “swoyle” and Swale
Island also takes its name from this most important mammal. Seals
wandering in search of their blow-holes have been found as far as
six or seven miles inland.
As might be expected, there survives in the vernacular—
especially of the older people—many words and phrases that smack
of their English dialect origin, and words that were the English
undefiled of Chaucer’s or Shakespeare’s day. Certain proper names
represent a curious conversion of a French name no longer
understood.
In Dorsetshire dialect v is used for f, and in Newfoundland one
hears “fir” pronounced “vir” or “var.” Firewood is “vir-wood.” Women
who are “vuzzing up their vires” are fussing (making ready) their
fires. We have “it wouldn’t be vitty” in place of “it wouldn’t be
fitting.” A pig “veers”; it does not farrow. The use of “thiccy” for
“this” is familiar to readers of “Lorna Doone.” “The big spuds are not
very jonnick yet” means that the potatoes are not well done. If
something “hatches” in your “glutch,” it catches in your throat.
Blizzard is a word not used, and a lass at school, confusing it with
gizzard, said it meant the insides of a hen. The remains of birds or of
animals are the “rames.” “O yes you, I ’low” is a common form of
agreement. To be photographed is to be “skitched off,” and of
snapshots it is sometimes said by an old fisherman to a “kodak
fiend”: “I heard ye firin’ of ’em.”
“Cass ’n goo,” for “can’t you go” may be heard at Notre Dame
Bay, as well as “biss ’n gwine” for “aren’t you going?” and “thees
cass’n do it” for “thee can’t do it.” The berries called “harts” (whorts)
are, I presume, the “hurts” of Surrey.
A vivid toast for a sealer going to the icefields was “Bloody decks
to ’im!”
When bad weather is brewing, “We’re going to have dirt” is a
common expression.
A fisherman who had hooked a queer creature that must have
been first cousin to the sea-serpent said, “It had a head like a hulf, a
neck like a harse; I cut the line and let it go to hell.”
Here is a puzzler: “Did ye come on skits or on cart and dogs?”
That means, “Did you come on skates or on a dog-sledge?” Dog-cat
is a dog-sledge. Cat is short for catamaran, which is not a sea-boat
but a land-sledge, so that when you hear it said: “He’s taken his dog
and his cat and gone to the woods” you may know that it means
“He’s taken his dog and his sledge.”
Just as we change the position of the r in going from three to
third, we find the letters transposed in “aps” for aspen, “haps” for
hasp, “waps” for “wasp” and “wordle” for world. Labrador is
Larbador, and “down to the Larbador” or “down on the Larbador”
are common expressions.
Instead of “the hatch” the telescoped form “th’ ’atch” is used. We
have “turr” for “tern” and “loo” for “loon,” and “yammit” (emmet) for
“ant.”
The tendency to combine syllables is illustrated in the
pronunciation of Twillingate as Twulngate.
A scaffolding for fish is known as a “flake.” Here the split cod are
outspread to dry and, by the way, a decision of the Newfoundland
Supreme Court declares “cod” and “fish” synonymous. The
scaffolding is made of poles called longers, and it is suggested that
these “longers” are the “longiores” which Caesar used to build
bridges, according to his Commentaries. A silk hat is known as a
beaver, or behaviour, and so when you hear it said, “I saw Tom
Murphy; he must have been at a funeral; he had his behaviour on,”
it means not that he was circumspect in his conduct, but that he
wore the formal headgear. “Sammy must ’a’ been writin’ some
poetry. I saw him just now a-humourin’ of it with his foot.” Cannot
you see the bard beating out the rhythm with his foot, as a musician
sometimes does when he is sure that he is in time and the rest are
mistaken?
“South’ard,” “north’ard,” “east’ard,” “west’ard” are current
maritime usage, and the adjective “wester” is heard.
Legal Latin is drawn upon for “tal qual”—talis qualis—applied in a
bargain for fish “just as they come.”
Here is a quaint one. The end of a pile, above the surface of a
wharf, is a gump-head. Gump and block are one and the same thing.
We of the United States use the word “gump” or “chump”
figuratively for a “blockhead.”
“The curse o’ Crummle on ye” is a rural expression still heard,
and refers to Cromwell’s bloody descent on Ireland.
“I find my kinkhorn and I can’t glutch” means “I have a pain in
my throat and I can’t swallow.” The kinkhorn is the Adam’s apple. A
man at Chimney Cove remarked: “I have a pain in my kinkhorn and
it has gone to my wizen (chest).”
A dog is often called a “crackie.” Caribou is shortened to “boo.” A
door that has stuck is said to be “plimmed up.” A man who ate hard
bread and drank water said “It plimmed up inside and nearly killed
me.”
To say of a girl that she “blushed up like a bluerag” refers to the
custom of enclosing a lump of blueing in a cloth when laundering
clothes. “The wind baffles round the house” is a beautiful way of
saying that it was blustering.
“Bruise” is a very popular dish of hard bread boiled with fish, and
with “scrunchins” (pork) fried and put over it. It is the equivalent of
Philadelphia’s famous “scrapple.” A guide, admitting that bread and
tea are the staple articles of diet in many an outpost, said
reflectively: “Yes, that’s all those people live on. Now there’s other
things. There’s beans.”
When a man says that his hands are “hard afrore” (hard frozen)
we remember Milton in “Paradise Lost,” “the air burns frore.” Frozen
potatoes are “frosty tiddies.” Head is often called “heed.” “Tigyer,”
said by an old man to a mischievous lad, means “Take yerself off.”
“Is en?” is a way of saying “Is he?” An old man cut his finger and
said that he had a “risen” on it, which is certainly more of a finality
than a “rising.” “I’m going chock to Gargamelle” means “I’m going all
the way to Gargamelle,” the latter name from “garçon gamelle,” said
to signify “the boy who looks after the soup.”
Instead of “squashed,” “squatted” is a common word, as in the
expression “I squatted my finger.” And there are many other
provincialisms not in the dictionaries.
The fathom is a land-measure of length, as well as a sea-
measure of depth. The leading dog of a team is six or seven
“fathoms” ahead of the komatik.
“Start calm” means perfectly calm, and then they may say
expressively “The wind’s up and down the mast.”
“Puddick” is a common name for the stomach.
“Take it abroad” is “take it apart”; “do you relish enough,” is
“have you eaten plenty?” “Poor sign fish” means that fish are scarce.
Woods that are tall are said to be “taunt.”
These few examples of distinctive phraseology might be
multiplied a thousand-fold.
As for the proper names, a fascinating field of research lies
before a patient investigator who commands the leisure. Here are
but a few of countless examples that might be cited.
French names have been Anglicized in strange ways. Isle aux
Bois thus becomes Isle of Boys—or, as pronounced on the south
coast, Oil of Boys or Oil o’ Boy. Baie de Boules has lost the
significance of boulders that bestud its shores in the name Bay Bulls.
The famous and dreaded Cape Race, near the spot where the
beautiful Forizel was lost, gets its name from the French “razé,”
signifying “sheer.” Reucontre is Round Counter; Cinq Isles has
become St. Keels, and Peignoir is altered to Pinware or Pinyare.
Grand Bruit is Grand Brute; the rocky headland of Blomidon that
nobly commands the mouth of the Humber is commonly called Blow-
me-down; Roche Blanche is Rose Blanche.
One would scarcely recognize Lance-au-Diable in Nancy Jobble.
Bay d’Espoir has been turned into its exact antithesis, in the shape
of Bay Despair. L’Argent Bay is now Bay Le John. Out of Point Enrage
is evolved Point Rosy, and St. Croix is modified to Sancroze
(Sankrose).
Children’s names are likely to be Biblical. They are often called by
the middle name as well—William James, Henry George, Albert
Edward. Merchants’ ledgers must take account of a vast number of
nicknames that are often slight variants on the same name—Yankee
Peter, Foxy Peter, Togo Ben, Sailor Ben, Bucky Ben, Big Tom, Deaf
Tom, Young Tom, Big Jan, Little Jan, Susy’s Jan, Ripple Jan, Happy
Jack. Thomas Cluett comes to be called Tommy Fiddler, whereupon
all the children become Fiddlers, and the wife is Mrs. Fiddler. The
family of Maynards is known as the Miners.
The little boys have a mischievous way of teasing one another as
“bay noddies.” The noddy is a stupid fish that is very good at
catching the smaller fry and then easily allows itself to be robbed of
its prey. The children cry:
Or:
Or:
Or:
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.
ebookname.com